Monday 7 July 2008

How to test Qmail+vpopmail for SMTP AUTH

Well, every time I need to check whether an installation of an email server is completely working I need to search google for this bit of information. Sometime is hard to fin exactly what you want. Suprisingly some of the examples don work with qmail.

To generate the AUTH string you need to issue the following command:

perl -MMIME::Base64 -e 'print encode_base64("\000user\@domain.net\000my.password")'

If you are using qmailrocks instalation, perl should have everything to handle this. If should generate an string like this:

AHVzZXJAZG9tYWluLm5ldABteS5wYXNzd29yZA==

To test you qmail instalation do the following:

> telnet newserver.net 587
Trying 123.123.123.1...
Connected to newserver.net.
Escape character is '^]'.
220 smtp.newserver.net ESMTP
ehlo my.machine.net
250-smtp.newserver.net
250-PIPELINING
250-8BITMIME
250-SIZE 0
250 AUTH LOGIN PLAIN
AUTH PLAIN
AHVzZXJAZG9tYWluLm5ldABteS5wYXNzd29yZA==
235 ok, go ahead (#2.0.0)
mail from:
250 ok
rcpt to:
250 ok
data
354 go ahead
Subject: Test

Test
.
250 ok 1215413930 qp 87194
quit
221 smtp.newserver.net
Connection closed by foreign host.

This should deliver the message (if you chnage the fake emails and server name to your reality). If you get any other message, your smtp auth is not working with qmail.

No comments: