Title: Message
Hello all!
 
I have a few questions in how to use cram-md5 authentication. The platform I have started with is Windows XP. I have a basic understanding of c-client library but there may be something obvious I have missed when using the library.
 
How is the user set? I tried mail_parameters(NIL,SET_USERNAME,"xxxx"); This did not work.
 
The way I got it to work somewhat is to use this:
 stream = smtp_open_full (NIL,hostlist,"service=smtp/user=xxxx",SMTPTCPPORT,SOP_DSN|OP_DEBUG|SOP_DSN_NOTIFY_FAILURE);
 
But it still wants the user in the mm_login callback! So I fill in the same user in this function and call auth_md5_pwd() with the user like this:
 
void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
{
 strcpy(user,"xxxx");
 strcpy(pwd,auth_md5_pwd(user));
}
Then it seems to work ... but I have not been able to get the authorization to work. (500 5.7.0 authentication failed). I have verified that there is an exchange of:
"334 PDM4NTk2MDE1MDcuMTAzODM1NDFAc3RyZWFtc2VydmUuY29tPg=="
"dGdhMDEgMTkxMDBiODRiYjFiODBjYTYxNzI0MzliNjE0NjM5OGY="
I have tried version 2000a and now 2002e. The behaviour seems identical. I am using makefile.nt without modification. I removed two leading backslashes from the content of MD5ENABLE to read "cram-md5.pwd" instead.
 
In order to set the service argument to  smtp_open_full with ,"service=smtp/user=xxxx" I had to modify a sprintf() like this in smtp.c:smtp_open_full:
    sprintf (tmp,"{%.800s/%.200s}",*hostlist,service ? service : "smtp"); The previous behaviour was to use only 20 characters in service.
 
I have configured sendmail-8.11.6-25.72 to support cram-md5 (250-AUTH DIGEST-MD5 CRAM-MD5).
 
Any pointers would be very much appreciated!
 

Torbj�rn Gard

Reply via email to