![]() |
|||||||||||||||||||||||||||
| This website is not maintained anymore. Please visit www.nerdgirl.dkinstead | |||||||||||||||||||||||||||
|
This page was last modified: July 27 2010 13:22:12 | ||||||||||||||||||||||||||
Mail setup tutorial - Testing and startup
This article assumes that you've followed the steps in the previous articles of this tutorial You are now ready to test if everything works as intended. Postfix has a check command that provides validation of the configuration files. It will inform you of any errors. It doesn't matter which folder you're currently positioned in, when you do this: postfix check If Postfix correctly installed and configured, nothing is returned. If there are any problems the command will report them to you both on screen and in your log file (/var/log/maillog). After a succesfull check, you can start Postfix: postfix start You also need to start IMAP and POP3 services:
cd /usr/local/etc/rc.d/ The system should now respond to the following ports:
The netstat command will show you if this is actually the case: netstat -p tcp -an Check for these lines in the output Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp4 0 0 *.25 *.* LISTEN tcp4 0 0 *.110 *.* LISTEN tcp4 0 0 *.995 *.* LISTEN tcp4 0 0 *.993 *.* LISTEN tcp4 0 0 *.143 *.* LISTEN Testing incoming mailThe accounts you've created can not be used for sending mail if the folder of the account has not been created yet in /usr/local/virtual/. But the system creates it automatically the first time it receives a mail for the account. Try to send a mail to the account you've created earlier. Use your hotmail account or another account from outside your server. If the mail has been received correctly, the message is stored in the folder of the account:
cd /usr/local/virtual/postmaster@domain.tld/new/ Since mail is received for a local user, the SMTP authentication with SASL doesn't take effekt. This only happens when mail is received for delivery outside the system (aka relaying). Testing relayYour system should be water-proof ... relay from localhost is always okay, but if anyone tries to connect from the outside world, your mail server should ask them to authenticate. Here's a simpel test on localhost (bold text is provided by you):
telnet mail.domain.tld 25 Remember to replace 'domain.tld' with your own domain name. Note that you can send mail with no questions asked. But if you connect to your server from another server, this is what should happen:
telnet mail.domain.tld 25 As you can se from the above, you are presented with different methods of authentication. If you try to send a mail anyway, you'll be rejected. But if you have an account, you can login and do your business...:
telnet mail.domain.tld 25 Username and password must be encoded in base64. Remember that the username in this mail setup is the complete mail address. Below I've provided a little tool for this: Note the two lines 250-AUTH LOGIN PLAIN and 250-AUTH=LOGIN PLAIN. If they don't show up in your test, SASL hasn't been configurated correctly. Testing IMAP and POP3Now is the time to see if users can connect through a mail client. I use Mozilla Thunderbird, but you might have another favorite client you want to use. If things don't work as expected, don't jump to conclusions thinking that you probably did something wrong at your server. I struggled for two days checking logs and configurations files ... then I found out that Norton Antivirus was interfering. Also later I came across a server-side firewall where port 143 was blocked. If you are sure that client- and/or server-side antivirus- and firewall software is not the reason for your trouble, take a look at your logs (both maillog and mysqllog). Most of the time they will give you hints in the right direction.
|
|||||||||||||||||||||||||||