Thursday, November 23, 2006

Troubleshooting SMTP using Telnet

Today, I have been confronted to configuring Virtuozzo + Plesk on our new VPS web site server to send emails from ASP.NET code.

On our old Plesk 7 server, we used to send emails from an email account which had no mailbox but the same configuration did not seem to work in the more recent Plesk 7.6. I am not a Plesk aficionado, so I went the old way to find out what was going wrong.
  1. Open a command windows by typing cmd in the Start -> Run… dialog box and click OK.
  2. At the prompt, type telnet mail.yourdomain.tld 25 + Enter
  3. The mail server should display version information.
  4. Type HELO + Enter.
  5. Type AUTH LOGIN + Enter.
  6. Type your mailbox username or username@ yourdomain.tld encoded in base64 + Enter. ESMTP requires a login in the form username@ yourdomain.tld. A helpful site to get a base64 encoded value is http://www.motobit.com/util/base64-decoder-encoder.asp.
  7. Type your mailbox password encoded in base64 + Enter.
  8. If you have successfully authenticated, the server will reply "235 authenticated".
  9. Type MAIL FROM: username@ yourdomain.tld + Enter.
  10. Type RCPT TO: anothermailbox@ yourdomain.tld + Enter.
  11. Type DATA + Enter.
  12. Type Subject: Test + Enter + Enter (Send a blank line to separate the headers from the message body).
  13. Type SMTP test + Enter.
  14. Type . + Enter (a dot, then Enter).
  15. The server should reply "250 Message queued"
  16. Type QUIT + Enter.
  17. Close the command window and check your mailbox.
In my case, the message that I was getting in .NET was “no email account can send to anothermailbox@ yourdomain.tld”, which is not very helpful but the procedure above was showing that step 8 was actually going wrong. After a few changes in the Plesk configuration I have discovered that the email account required a mailbox to send emails.

No comments: