HowTos/Easy Postfix

From Scalix Wiki
Jump to: navigation, search

Scalix Wiki -> How-Tos -> Easy Postfix

Here is a single server, 10 Minute Postfix Conf that works well with Scalix 11. This config is especially suited to servers which are NATed, uses the ISP's SMTP relay to send emails and doesn't have any sort of split dns running.

Tested with 11.x on Centos 5

Original attributed to gareth - http://www.scalix.com/forums/viewtopic.php?t=5791&highlight=postfix with small mods by myself, mainly in the transports section and more details w.r.t the scalix config editing.

Enjoy !

-- Mogamat tech[at]cyber-worx.co.za


1. Disable Sendmail, as per Scott HowTos/Complete_Postfix it is best not to completely remove Sendmail as package management depends on it.


service sendmail stop
chkconfig --level 2345 sendmail off

2. Get and install Postfix

yum install postfix

3. edit /etc/postfix/main.cf, replace <your smart relay> with the name of your ISP's SMTP server.

inet_interfaces = loopback-only
local_recipient_maps =
relayhost = <your smart relay>
mynetworks = 127.0.0.0/8
transport_maps = ldap:/etc/postfix/ldap-transport.cf, ldap:/etc/postfix/ldap-transport2.cf

4. Add /etc/postfix/ldap-transport.cf:

bind = no
query_filter = (&(mail=%s)(omUlClass=*))
result_format = lmtp:[127.0.0.1]:24
result_attribute = omMailnode
debuglevel = 0

5. Add /etc/postfix/ldap-transport2.cf:

bind = no
query_filter = (&(mail=catchall@%d)(omUlClass=*))
result_format = lmtp:[127.0.0.1]:24
result_attribute = omMailnode
debuglevel = 0


6. Edit your /var/opt/scalix/XXXX/s/sys/smtpd.conf file to turn on lmtp and to add a catchall user, this is for catching mail to unrecognised local users from within Scalix :

LMTP=ON

CATCH @<yourdomain.com> sxadmin@<yourdomain.com>


6. For each domain you host, add an entry for a catchall user to any Scalix user which should receive lost emails for that domain. So if your domain is popo.com and you want any unmatched emails to go to sxadmin@popo.com, add an alias catchall@popo.com in SAC for the sxadmin user. This ensures that postfix will send all mail for recognised domains to scalix.

7. Test by sending a mail from the console


''mail sxadmin@yourdomain.com''
Subject: ''A tEst''
''lineklsjdksjlasjkd
alsjkdlkasjd
laksjdls''
Cc: user@externaldomain.com

You should get a mail in your sxadmin account and in the external mailbox. If not tail /var/log/maillog is your friend ;-)

8. Most likely you want to setup fetchmail to download your domain mailbox over pop3 and inject into Postfix. HowTos/Fetchmail {Take this howto with some salt and spices, it is intended for sendmail, if enough people express an interest I will share my fetchmail config here}

9. If it all works, congratulations, pat yourself on the back!