Fix authentication issue on mail server with Telnet
Q I am trying to fix an authentication issue with my mail server, and the only way I have been to test it is by setting it up in Evolution. Is there any way that I could try without having to set an account in Evolution?
A One of the best ways to test a range of different services, including SMPTP SAUTH, is to use Telnet. Now, I would never recommend normal Telnet to log in to a machine, but for testing some services it is invaluable. To trouble shoot your problem, what we want to do is to connect to the mail server on port 25 and authenticate using the encoded base 64 (read about it at http://en.wikipedia.org/wiki/Base64). First, a few helpful decoded strings, encoded with www.dillfrog.com/tools/base-64_encode:
'VXNlcm5hbWU6' decodes to
'UGFzc3dvcmQ6' decodes to
'dGVzdF9seGZAcmV6ZC5jby51aw==' decodes to 'email@example.com'
'Zm9vYmFy' decodes to 'foobar'
The following lines are the dialogue to test the server is authenticating. We use base 64 encoding for some of the strings, which are detailed above. First, Telnet to the mail server domain/IP address (ie mail.rezd.co.uk or 10.0.0.1) on port 25:
telnet 10.0.0.1 25
The server will answer with an SMTP banner:
Connected to mail.rezd.co.uk
Escape character is '^]'.
220 mail.rezd.co.uk ESMTP
Issue the EHLO command:
Next, the server tells us what it supports. This can very from mail server to mail server.
250-mail.rezd.co.uk Hello other.
pleased to meet you
250-AUTH DIGEST-MD5 CRAM-
MD5 LOGIN PLAIN
Authenticate to the mail server with
It sends out the username prompt:
Now we send the name of a user that we are going to authenticate with, eg firstname.lastname@example.org:
Next it asks for the password:
And we supply it:
And finally it says yes, so we know that authentication is working:
235 2.0.0 OK Authenticated
If we get the following, we know that there is an issue with the authentication in some way:
535 5.7.0 authentication failed
This is sufficient to test authentication; if we wanted to test sending mail we could continue the SMTP dialogue.
Follow us on Identi.ca or Twitter