First, install sSMTP, since in this instance postfix is overkill. Yes, this will remove postfix. Do we care? Not really.
sudo apt-get install ssmtp
- Configure sSMTP by editing
#Config file for sSMTP sendmail
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
#I recommend setting this
# Where will the mail seem to come from?
#The full hostname
hostname=[some hostname here]
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
# This is optional if you're going to use revaliases - I didn't
Now, we need to set permissions on
/etc/ssmtp/ssmtp.conf to help (it isn't foolproof) protect your plaintext password.
sudo chown root:nagios /etc/ssmtp/ssmtp.conf
sudo chmod 640 /etc/ssmtp/ssmtp.conf
Restart nagios and you should be set.
sudo service nagios3 restart