First of all, I'm using a MDaemon 9.0.4 server and I have to make a small
SMTP client (linked to this server) for a website in PHP.
When I send the "EHLO" command, the server says:
250-he8us.XXXX.XXX Hello exponline, pleased to meet you
250-AUTH LOGIN CRAM-MD5
250 SIZE 0
So, I choose to authenticate with CRAM-MD5 method. I send the command and
the server says:
334 UGFzc3dvcmQ6 (the string is always the same)
I think the string is the thing you call "challenge" and I "base64 decode"
The first thing I do is to send my base64_encoded password but I had the
"535 Authentication failed" response.
So I base64_decode the string, I hash_hmac("md5", $challenge, $pass) (the
manual of the function: http://be.php.net/manual/en/function.hash-hmac.php)
That gave me:
I made the CRAM-MD5 string:
I base64_encode it
And I sended it to the server and I had the same error "535 Authentication
I tried without base64_decode the challenge => error
Without base64_decode the challenge and base64_encode the CRAM-MD5 => error
Without the base64_encode the CRAM-MD5 => error...
Does somebody have an idea on why it doesn't work?
Wich other authentication method can I use?
Thanks a lot for the response...