Pages

Welcome to My Blog

This is to share my IT experience with friends all around the world.
I have been working in Linux Fedora Systems for more than 8 years. Its fun to share knowledge and learn..
As everyone knows when a problem arises in your systems "googling" is the way that many depend on..

All the posts here are my working experiences during my working life.. So you can count on it..

I have added the references where I got help in solving IT issues


Monday, September 12, 2011

Two Postfix Instances in One Server

Actually this was required to me to configure a server
  • to work as a mail relay for my domain say chamara.xy (External people/mail servers should send emails to someone@chamara.xy to this server)
  • to work as the submission server for my clients (someone@chamara.xy should send mail to any outside domain after authenticated by the server)
There are several mechanisms to implement this and following given are some important references;
http://www.postfix.org/MULTI_INSTANCE_README.html
http://www.howtoforge.com/forums/showthread.php?t=4788

When I reading the details I found following link (http://linuxpoison.blogspot.com/2008/02/howto-make-two-instance-of-postfix.html) which was quite easy and interesting. I configured the server referring the above document. The steps I followed is as given below;

Consider the main instance of Postfix is having its configurations in /etc/postfix
  • Copy the /etc/postfix directory and all files to another directory (Say /etc/postfix_smtp)
  • Change the parameters in the /etc/postfix_smtp/main.cf according to the new instance of the postfix
Here the spool folder should be different and should be created.
The document says Each instance of Postfix must have it's own mail spool directory.
To avoid file conflicts, the default directory /var/spool/postfix must not be shared among instances.

  • Edit the master.cf file in /etc/postfix-smtp and enable it to run on port 25
smtp inet n - n - - smtpd
  • Edit the master.cf in /etc/postfix and enable the submission port for the smtpd daemon
submission inet n - n - - smtpd
  • Edit the file /etc/postfix/main.cf and add the following near the bottom of the file:
alternate_config_directories = /etc/postfix-smtp

The above setting is required to inform the Postfix daemons about the second instance


Now you have 2 instances with 2 different configuration settings (i.e. /etc/postfix and /etc/postfix_smtp). You need to create startup scripts to both. One instance can run postfix in port 587 with relevant authentication configurations while other can run on port 25 as a mail relay server for your domain)

No comments:

Post a Comment