Skip to content

Instantly share code, notes, and snippets.

@t-chab
Last active October 22, 2020 21:45
Show Gist options
  • Save t-chab/13d9979c0a50a3f0d70cee5f3331a41e to your computer and use it in GitHub Desktop.
Save t-chab/13d9979c0a50a3f0d70cee5f3331a41e to your computer and use it in GitHub Desktop.
Simple smtp setup

How to quickly setup an forwarding SMTP with Postfix

Requirements

Install Postfix

Configuration

Without auth

postconf -e relayhost=target.mailserver
postconf -e myorigin=$HOSTNAME.mydomain

With auth and TLS :

postconf -e relayhost=[target.mailserver]:587
postconf -e myorigin=$HOSTNAME.mydomain
postconf -e smtp_tls_security_level=may
postconf -e smtp_use_tls=yes
postconf -e smtp_sasl_auth_enable=yes
postconf -e smtp_sasl_password_maps=texthash:/etc/postfix/sasl_password
postconf -e smtp_sasl_security_options=
echo "[target.mailserver]:587 username:password" >> /etc/postfix/sasl_password

Sources :

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment