This website is deprecated, and remains online only for historic access to old issues and docs for historic versions of Virtualmin. It has been unmaintained for several years, and should not be relied on for up-to-date information. Please visit www.virtualmin.com instead.
Bump.
To configure Postfix for relaying emails through mailjet
postconf -e 'relayhost = in-v3.mailjet.com'
postconf -e 'smtp_sasl_auth_enable = yes'
postconf -e 'smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd'
postconf -e 'smtp_sasl_security_options ='
Create the file sasl_passwd and insert the following line
in-v3.mailjet.com [Big lump of password from mailjet]
I used sudo nano sasl_passwd and pasted it in but you could do this instead
echo "in-v3.mailjet.com [Big lump of guff from mailjet]" > /etc/postfix/sasl_passwd
chown root:root sasl_passwd
chmod 600 sasl_passwd
Now convert /etc/postfix/sasl_passwd into a format that Postfix can read:
postmap /etc/postfix/sasl_passwd
This will create the file /etc/postfix/sasl_passwd.db.
All that is left to do is restart Postfix:
/etc/init.d/postfix restart
The following links are good info.
https://app.mailjet.com/account/setup
and
https://www.howtoforge.com/postfix_relaying_through_another_mailserver