Skip to content

Instantly share code, notes, and snippets.

@killfill
Created February 19, 2015 21:06
Show Gist options
  • Save killfill/e93bb4de17aae577f4eb to your computer and use it in GitHub Desktop.
Save killfill/e93bb4de17aae577f4eb to your computer and use it in GitHub Desktop.
Quick way to make SmartOS Zone send emails through gmail
pkgin -y in cy2-login
sed -i "s|localhost|localhost localhost.localdomain|g" /etc/hosts
echo "relayhost = [smtp.gmail.com]:587" >> /opt/local/etc/postfix/main.cf
echo "smtp_use_tls = yes" >> /opt/local/etc/postfix/main.cf
echo "smtp_sasl_auth_enable = yes" >> /opt/local/etc/postfix/main.cf
echo "smtp_sasl_password_maps = hash:/opt/local/etc/postfix/relay_passwords" >> /opt/local/etc/postfix/main.cf
echo "smtp_sasl_security_options = noanonymous" >> /opt/local/etc/postfix/main.cf
echo "smtp_always_send_ehlo = yes" >> /opt/local/etc/postfix/main.cf
echo "[smtp.gmail.com]:587 system@gmail.com:thepassword" > /opt/local/etc/postfix/relay_passwords
echo "root: wanted@mail.com" >> /opt/local/etc/postfix/aliases
postmap /opt/local/etc/postfix/relay_passwords
postalias /opt/local/etc/postfix/aliases
svcadm restart postfix
echo "Test mail" | mail -s "Test" wanted@mail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment