Extending MailEnable authentication functionality

glopez
Posts: 5
Joined: Wed Jul 29, 2009 2:12 pm

Extending MailEnable authentication functionality

Postby glopez » Wed Jul 29, 2009 2:20 pm

Hi,

This is my first post to this forum.

We are evaluating MailEnable, but we need to extend its authentication capabilities to fit our requirements.

My question is: can I write a plug-in for MailEnable that implements our way of authenticating users? If yes, could you please point any reference in MailEnable documentation that explains how to do this? I've taken a brief look at the MailEnable API and didn't find a clear way of implementing an authentication module.

Thanks in advance,

Guillermo

glopez
Posts: 5
Joined: Wed Jul 29, 2009 2:12 pm

Postby glopez » Thu Jul 30, 2009 6:49 am

Hi again,

I've taken a look at the MailEnable documentation and found references to connector development. Do you think that connectors can be used to extend MailEnable's authentication functionality? If yes, where can I find an example on how to develop one? The API documentation talks about a "System Manual" that describes connectors, but I couldn't find this document in the developers resources page.

Kind regards,

Guillermo

glopez
Posts: 5
Joined: Wed Jul 29, 2009 2:12 pm

Postby glopez » Mon Aug 03, 2009 7:23 am

Good morning,

Well, what our custom authentication module actually does is, given some login credentials (an user name and a password), connect to another IMAP server and authenticate using those credentials. If that authentication succeeds, then our custom authentication succeeds. In any other case our authentication fails.

Do you know if there is any exisiting plug-in or configuration parameter for MailEnable that provides this functionality? If yes, where can I find it?

Thanks very much,

Guillermo

MailEnable
Site Admin
Posts: 4441
Joined: Tue Jun 25, 2002 3:03 am
Location: Melbourne, Victoria Australia

Postby MailEnable » Mon Aug 03, 2009 11:05 am

MailEnable already has this functionality built in. It also migrates folders and pulls messages into the mailenable mailbox. There are many settings that can be configured for this extension.

If you install MailEnable you will find a Migration program group and the utility exists under that path.

A PDF outling the functionality under the same program group and is available here: http://www.mailenable.com/documentation/mecapture.pdf.

To answer your question about intercepting/proxying authentication (other than using the above mentioned utility) - this is not possible (without writing a proxy DLL - something requiring some considerable effort). Such a proxy dll would need to be developed to export the same functions as the MEAITD.DLL file. If you are interested in this route, then I can post the function prototypes .
Regards, Andrew

glopez
Posts: 5
Joined: Wed Jul 29, 2009 2:12 pm

Postby glopez » Mon Aug 03, 2009 1:09 pm

Hi,

Thank you for your reply.

Regarding the migration utility, I'm not trying to migrate another mail server, but use an external system that handles accounting and authentication. The way this system authenticates users is through an IMAP interface, however this system is not an IMAP server (it only recognizes the "LOGIN" IMAP command returning "OK" or "NO").

I would like to take a look at those function prototypes, where can I obtain them? Is there any documentation describing how to use them?

Kind regards,

Guillermo

MailEnable
Site Admin
Posts: 4441
Joined: Tue Jun 25, 2002 3:03 am
Location: Melbourne, Victoria Australia

Postby MailEnable » Tue Aug 04, 2009 1:31 pm

Oh OK - sorry - I misread. There is no documentation for hooking the providers as such, although my crude overview will outline how it can be done.

It is probably easiest to do in C/C++ (since thats the same as the original code I sourced the prototypes from).

What can do is to write your own dll that has these entry points - and then MailEnable will call your DLL instead of its own.

I do suggest though that your DLL should loadlibrary("MEAIAUTD.DLL") and have your implementation call the "real" functions in it.
(That way, you get the ability to work with the data being passed and fetched in the structures, but you dont have to implement all functions).
You will presumably just need to hook the LoginGet function - since thats the one that services eventually call when they want to verify MailEnable passwords.

0. Write the DLL as mentioned above

1. Add a new key to host your DLL under:
HKEY_LOCAL_MACHINE\SOFTWARE\Mail Enable\Mail Enable\Providers\Authentication

2. Configure the "Current Provider" reg value to point to your new Authentication Provider key

3. Craft sockets calls to issue and respond to IMAP LOGIN to the remote host for the LoginGet call.

The relevant structure and function signatures that your DLL would need to export follow:

#define LOGINTYPE_USERNAME_BUFLEN 64
#define LOGINTYPE_PASSWORD_BUFLEN 64
#define LOGINTYPE_ACCOUNT_BUFLEN 128
#define LOGINTYPE_RIGHTS_BUFLEN 128
#define LOGINTYPE_DESCRIPTION_BUFLEN 1024

typedef struct
{
char UserName[LOGINTYPE_USERNAME_BUFLEN];
long Status;
char Password[LOGINTYPE_PASSWORD_BUFLEN];
char Account[LOGINTYPE_ACCOUNT_BUFLEN];
char Rights[LOGINTYPE_RIGHTS_BUFLEN];
char Description[LOGINTYPE_DESCRIPTION_BUFLEN];
long LoginAttempts;
long LastAttempt;
long LastSuccessfulLogin;
} LOGINTYPE;


long __stdcall LoginAdd(LOGINTYPE *AuthLogin);
long __stdcall LoginGet(LOGINTYPE *AuthLogin);
long __stdcall LoginEdit(LOGINTYPE *AuthLoginCriteria,LOGINTYPE *AuthLoginData);
long __stdcall LoginRemove(LOGINTYPE *AuthLoginCriteria);
long __stdcall LoginFindFirst(LOGINTYPE *AuthLogin);
long __stdcall LoginFindNext(LOGINTYPE *AuthLogin);
Regards, Andrew

glopez
Posts: 5
Joined: Wed Jul 29, 2009 2:12 pm

Postby glopez » Tue Aug 04, 2009 4:10 pm

Hi Andrew,

Thanks very much for your detailed response, I think we can start working from here.

Best,

Guillermo

Who is online

Users browsing this forum: No registered users and 1 guest