Setting up postfix send only SMTP server for Jenkins

Turn-by-turn tutorial to set up a SMTP server to use with Jenkins (or any service which needs to send notification) on Debian based systems:

Install mailutils (which will bring Postfix as well):

apt-get install mailutils

During configure, choose the 'Internet site' server configuration, set the domain name. If the Postfix configure wouldn't show up, probably Postfix was already installed, so you can reconfigure it with:

dpkg-reconfigure postfix

in the /etc/postfix/ file set:

inet_interfaces = localhost

Restart postfix:

service postfix restart

Test the config:

echo "It works" | mail -s "Does it work?"

Chances are, that your first mail will end up in the Spam folder, depending on your domain you use.

In Jenkins, leave the SMPT server field empty, so it will use the local server. The sender will be your  the value of your System Admin e-mail address global config option, better to set it something like '', so your users won't think they can answer to the notification mails

Currently unrated