From wiki
Jump to: navigation, search


This is mainly about emailing users when their jobs are finished.

Only an easy workable solution is presented and it relies on gmail servers and having a special gmail address.

On the frontend, first focus on the followinng file:


Look for the relayhost parameter. We will set it as follows:

relayhost = []:587

This means that postfix will outsource most of the email subtasks to gmail's servers. Though this may sound easy, it also means one must comply with gmail rules which can be quite stringent (i.e. require more work in setting up) in terms of security. Something to get right is TLS and SASL.

For TLS, first of all let's get a good certificate. One that works is:


Which may be found in


We can copy it over into a new name to create


Then we want to get the following lines into

smtp_use_tls = yes 
smtp_tls_CAfile = /etc/postfix/cacert.pem

Now for SASL. We need to create a file called


put all the gmail user and password details. I.e.

[]:587 <gmail_address> <password>

A hash of this must be generated. Postfix has its own hasher, so it can be done as follows:

postmap sasl_passwd

You should get a new file called


after this operation.

Now needs to be told about all of this , so the following shoudl be included.

smtp_sasl_auth_enable = yes 
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous

This should get you most of the way there.