5 tips for setting up a mail server postfix + courier

Hi,

i’m still making server administration and a migration and i learned a few things that could help you at this matter :D

1) look for a tutorial that fit your needs

in my case i was needed to set up a mail server. the old server have used courier for imap and pop3 and exim for smtp. event that i tried to accomplish the same, some technical problems don’t let me to do it and i made several mistakes in the process. before you write any command on the console, make a deep research in what do you need and how you can accomplish it. in the net there are a lot of tutorial that will explain you step by step what is needed to do, just follow it and all will be fine

2) a postix with mysql is your best option

i need to say it, something that worried me was that maybe i will have performance problems using mysql with postfix and courier. really the server is do not have a high load in terms of mail but even if it have it, i will research to avoid it and still using mysql. the facility to make changes, as forwarders, accounts, and a lot of stuff worth any performance consumtion, more if you need to manage a lot of accounts.

3) if you have sendmail or exim, uninstall it before anything

postfix have their own sendmail command, so is a good action to uninstall any MTA that will not be used.

4) security and iptables

flush all iptables at the time of testing, so you don’t get anything blocked, and change the default port to others. when you finish, lock all the entrant and out traffic except the used port for your services. configure and use tls, even that is better that the user will be forced to use tls, maybe is a good option to leave both options enabled for the future.

5) commons errors

a list of commons errors you can find, usually you can get a very detailed log if you edit your master.cf and add a -v at the inet smtpd directive

/home/vmail/user is not found : that means that the directory where the user emails should be stored is empty, check it and create the correct directorie(s) (depend if you are using maildir and mailbox

invalid command : this is a esoteric error and depends a lot of the context it appear, is why the server don’t recognize the client command. could be a client error or a server misconfiguration (usually is problem of the server if you are using a popular client as thunderbird)

configure postfix to use it by PHP in the mail () function : this is something cost me to figure out, as screw up installing first postfix, and later exim and get replaced the sendmail command. for this, you should have correctly installed and configured postfix, and have the sendmail command available (if you get a command not found error, backup the config files and re-install it). to configure the php to use postfix, just edit your php.ini and set the sendmail_path = sendmail -t -i (like this, as is, whiteout a full path)

fail user authentication: if you set the -v flag, you should easily see where is the error, could be that the query’s set for postfix sasl are wrong, or the mysql user used to connect to the database is wrong, or the user data in the DB is wrong. remember that the password of the user should be encrypted, you can use the mysql function ENCRYPT for that (using phpmyadmin is very easy)

i hope this help you and save you some time in this matter

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Related Post

Still quiet here.sas

Leave a Response