Now that everything is configured and started you want to make sure that everything works. You could fire up a mail client and make it connect to the server, but here are some alternatives listed that will make it easier to test the seperate components and make it easier to debug as you see what is going on.
To test the TLS capabilities of Postfix we will telnet to the server and try to activate the SSL session:
telnet your.mailserver.tld 25
The server will answer with:
Trying your.mailserver.tld... Connected to your.mailserver.tld. Escape character is ^] 220 your.mailserver.tld ESMTP Postfix
Then type in:
And again your server will answer it’s capabilities:
250-your.mailserver.tld 250-PIPELINING 250-SIZE 10240000 250-ETRN 250-STARTTLS 250 8BITMIME
Now it’s time to test TLS and enter in capitals:
and the server should respond with:
220 Ready to start TLS
Then you know this part will work.
Because the configuration of Dovecot won’t allow plain password login over plain connection we have to use the IMAPS (IMAP over SSL) capabilities to test this. We’ll use the openssl client mode for testing:
openssl s_client -connect your.mailserver.tld:993
The server will return a lot of output on the SSL session but should ultimatly return with:
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
Now we can try to login. If you haven’t created any users please use postfixadmin to create some users and mailboxes. To logon issue the following commands (with the a) and replace emailaddress and password to one existing in your setup.
a login emailaddress password
Where if everything went allright the server will answer with:
a OK [ ****removed**** ] Logged in
Next as an extra test you could see if the INBOX folder is there:
b select inbox
From which the server should answer:
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft) * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted. * 1 EXISTS * 0 RECENT * OK [UIDVALIDITY 1246736982] UIDs valid * OK [UIDNEXT 2] Predicted next UID * OK [HIGHESTMODSEQ 1] b OK [READ-WRITE] Select completed.
As a last test you could ask the server to list all your users mailfolders:
c list "" *
If something might fail turn on as much debug information as you can. Both Postfix and Dovecot give excellent message information in the logfile. I always keep a second terminal window open where I put the command:
tail -f /var/log/mail.log
And I see everything that is happening in the server. If everything is working as it should turn of all the debug information as it will slow your server down.
If something is wrong and you don’t see an error in the logfile you might sometimes find the explanation in the system logfile. Use the following command to check that one:
tail -f /var/log/system.log