Remote connection .NET assembly
Remote connection .NET assembly
I want to create postoffices, mailboxes, users with the .NET assembly. I found in another post here on the forum that the .NET assembly is "remotable". I understand from this that we can use the dll on another system and create mailboxes,... on the mail server.
This is exactly what we require, because our provisioning is on a centralized system. This system most be able to make a remote connection to the MailEnable server, but I can not find how this is done. How can I pass the servername, user and password for the mailenable server in my code using the .NET Administration Assemebly?
Wim
This is exactly what we require, because our provisioning is on a centralized system. This system most be able to make a remote connection to the MailEnable server, but I can not find how this is done. How can I pass the servername, user and password for the mailenable server in my code using the .NET Administration Assemebly?
Wim
Re: Remote connection .NET assembly
Anyone?
How can I create a mailbox/addressmap/postoffice on the MailEnabled server, from an IIS Website that is not hosted on the same server as the MailEnable server? I also can not see anything to pass a username and password.
How can I create a mailbox/addressmap/postoffice on the MailEnabled server, from an IIS Website that is not hosted on the same server as the MailEnable server? I also can not see anything to pass a username and password.
Re: Remote connection .NET assembly
Can maybe someone from MailEnable take the time to answer my question? This forum is not highly used, so my question remains. I also found a lot of old posts, that remain unanswered, but basically asked the same question.
I have found this posts: http://forum.mailenable.com/viewtopic.p ... emote#wrap
Is a web service still the only way to do it, because I tried like this (the objects in the API doc are apperently not available in the .NET version):
I also wonder that I am using the latest version (found on the site): 1.0.2447.28179
I have found this posts: http://forum.mailenable.com/viewtopic.p ... emote#wrap
Is a web service still the only way to do it, because I tried like this (the objects in the API doc are apperently not available in the .NET version):
Code: Select all
Dim oHost As New MailEnable.Administration.Server
oHost.Host = "10.0.2.108"
oHost.SetHost()
oHost.Status = -1
oHost.Port = 8081
oHost.DisplayName = ""
oHost.Address = "10.0.2.108"
Response.Write("Result: " & oHost.FindFirstServer())
Re: Remote connection .NET assembly
Did you ever get any answers on this topic? I am looking for the same answers. Please let me know what you found out or what your solution was.
Thanks,
DeShark
Thanks,
DeShark
Re: Remote connection .NET assembly
I've never seen documentation that this is possible. I ended up creating a service to run on the server where mailenable is installed, with a UDP server integrated. I then access this service from my other computers to create mailboxes, postoffice, check mailbox enabled/disabled, reset passwords, etc. I would be willing to share this service, written in C# in VS 2010.
Greg
Greg
-
- Site Admin
- Posts: 4441
- Joined: Tue Jun 25, 2002 3:03 am
- Location: Melbourne, Victoria Australia
Re: Remote connection .NET assembly
The .NET way of doing this is through web services.
Please see "Web services" on the developer tools page at: http://www.mailenable.com/developer-resources.asp
(The interface has existed for some time, but I believe it has only recently been posted to the developer tools pages).
The readme in the zip file has instructions for deploying the asmx fles:
To install:
1.) Create a folder in the Mail Enable\bin directory called "WebServices"
2.) Put the asmx files into this directory
3.) Put the dlls into a subdirectory of the "WebServices" folder called "bin"
4.) Use the IIS Manager applet to create an application under a web site, for example, "MEWebServices"
5.) For the application, set the physical path to be the Mail Enable\bin\WebServices directory
6.) Set the Application Pool for this application to be MailEnableAppPool (this is what the webmail runs under)
7.) You should be able to test the web services now by using the URL http://localhost/mewebservices/postoffice.asmx (where localhost would be the site)
8.) You will need to secure the application so that it is only accessible by the clients you specify. Otherwise any connection has full access to the MailEnable configuration information
Please see "Web services" on the developer tools page at: http://www.mailenable.com/developer-resources.asp
(The interface has existed for some time, but I believe it has only recently been posted to the developer tools pages).
The readme in the zip file has instructions for deploying the asmx fles:
To install:
1.) Create a folder in the Mail Enable\bin directory called "WebServices"
2.) Put the asmx files into this directory
3.) Put the dlls into a subdirectory of the "WebServices" folder called "bin"
4.) Use the IIS Manager applet to create an application under a web site, for example, "MEWebServices"
5.) For the application, set the physical path to be the Mail Enable\bin\WebServices directory
6.) Set the Application Pool for this application to be MailEnableAppPool (this is what the webmail runs under)
7.) You should be able to test the web services now by using the URL http://localhost/mewebservices/postoffice.asmx (where localhost would be the site)
8.) You will need to secure the application so that it is only accessible by the clients you specify. Otherwise any connection has full access to the MailEnable configuration information
Regards, Andrew
Re: Remote connection .NET assembly
Remote connection .Net Assembly is done via web services in .Net,this is third party services...........
Re: Remote connection .NET assembly
Hi.
I have also decided to write my own WCF in C#.
For now I only needed 4 Methods:
bool CreateMailbox(string postOffice, string mailbox, string password) This Works ok.
bool DeleteMailbox(string postOffice, string mailbox) This Works ok.
List<string> ListMailboxes(string postOffice) This Works ok. (and fast because of Size = -4
)
bool ResetPassword(string postOffice, string mailbox, string newPassword) Here I have problems.
I have this code:
It returns true when editing a valid login, but the password stays the same.
I have also tried to change the password of a non-existing mailbox, and it returns false, as expected.
Anyone?
And of course the solution came to me seconds later...:
If anyone is interested in my Little project, or have a project of their own, they would like to share, send me a mail 
I have also decided to write my own WCF in C#.
For now I only needed 4 Methods:
bool CreateMailbox(string postOffice, string mailbox, string password) This Works ok.
bool DeleteMailbox(string postOffice, string mailbox) This Works ok.
List<string> ListMailboxes(string postOffice) This Works ok. (and fast because of Size = -4

bool ResetPassword(string postOffice, string mailbox, string newPassword) Here I have problems.

I have this code:
Code: Select all
public bool ResetPassword(string postOffice, string mailbox, string newPassword)
{
Login l = new Login();
l.Account = postOffice;
l.UserName = String.Format("{0}@{1}", mailbox, postOffice);
if (l.Exists(l.UserName))
{
if (l.EditLogin(l.UserName, 1, newPassword, l.Account, "", -1, -1, -1, "USER") == 1)
{
return true;
}
}
return false;
}
I have also tried to change the password of a non-existing mailbox, and it returns false, as expected.
Anyone?
And of course the solution came to me seconds later...:
Code: Select all
public bool ResetPassword(string postOffice, string mailbox, string newPassword)
{
Login l = new Login();
l.Account = postOffice;
l.UserName = String.Format("{0}@{1}", mailbox, postOffice);
l.Description = "";
l.Password = "";
l.Status = -1;
l.LoginAttempts = -1;
l.LastAttempt = -1;
l.LastSuccessfulLogin = -1;
l.Rights = "";
if (l.FindFirstLogin() == 1)
{
if (l.EditLogin(l.UserName, l.Status, newPassword, l.Account, l.Description, l.LoginAttempts, l.LastAttempt, l.LastSuccessfulLogin,l.Rights) == 1)
{
return true;
}
}
return false;
}

Re: Remote connection .NET assembly
In the unlikely event you are still monitoring the forum, I'd welcome a copy of your WCF application
Re: Remote connection .NET assembly
I finally got this installed and it says "UnSupported"...
I have professional edition.
I have professional edition.