Saturday, December 12, 2009

Minimal Postfix (SMTP only)

While configuring Aide on a standalone system, I needed to configure SMTP in order to receive the cron job output. In absence of a mail gateway server willing to relay, I was left with the only option of running a local SMTP daemon. I installed Postfix and noticed that by default it runs on loopback interface and starts approximately 83 processes.

[root@localhost postfix]# netstat -ap | grep master | wc -l

I didn't really need all the additional Postfix features, so I set out to configure the bare minimum setup.

After spending some time going through the /etc/postfix/ file, and some trial and error, I managed to narrowed the configuration down to the following:

smtp inet n - n - - smtpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
smtp unix - - n - - smtp

Now, Postfix starts up only 20 processes.
[root@localhost postfix]# netstat -ap | grep master | wc -l

Note: Mail sent using such a setup is most likely to end-up in your spam folder.


No comments:

Post a Comment