From Bibliotheca Anonoma

This contacts you in case something goes wrong.

Set up SSL Certificate[edit]

You will need to set up a hostname (such as a subdomain, and an ssl certificate for that domain before you can send mail over SMTP.

Once you are done, link your certifiate to the postfix one:

sudo ln -s /etc/ssl/certs/ca-bundle.crt /etc/postfix/cacert.pem

Set up Postfix[edit]

You will need an SMTP server to send mail. This doesn't handle recieving mail. Setting it up is similar to setting up a SMTP mail client on your phone or with Thunderbird.

Install the postfix SMTP Server (usually already installed on RHEL):

sudo yum install postfix mailx

Setup with Amazon SES[edit]

Amazon SES does put you in a sandbox by default to reduce spam.

But you can verify the email addresses that are supposed to recieve it, which is great for just simple status reports from the server.

Using SASL[edit]

You'll need to set up SASL support to use an SES account:

yum install cyrus-sasl-plain
service postfix restart

Now everything works fine for me:

[[email protected] postfix]# echo "SES test" | mail -s "SES test `date +%s`" -r "[email protected]" [email protected]

Setup With Gmail[edit]

Edit the postfix configuration file, and configure it with, for example, the Gmail SMTP servers:

sudo nano /etc/postfix/

relayhost = []:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes

Next, configure your email account, in this case Gmail:

sudo nano /etc/postfix/sasl_passwd

[]:587    [email protected]:PASSWORD

Generate the hashed password db:

cd /etc/postfix
sudo postmap sasl_passwd

And now you're ready to send mail using Postfix. Here's an example command:

 echo "This is the message text." | mail -s "the message subject" [email protected]

Set up Systemd Notification[edit]