Forked from wnasich/outgoing_emails_with_sendgrid.sh
Created
October 4, 2018 17:13
-
-
Save akeemoduola/57f825fa52dea20276113ef4cbb9cfb7 to your computer and use it in GitHub Desktop.
Install outgoing email from Debian/Ubuntu system through SendGrid
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo apt install postfix mailutils | |
| # Choose host type 'No configuration' | |
| $ sudo cp /usr/share/postfix/main.cf.debian /etc/postfix/main.cf | |
| $ sudo vi /etc/postfix/main.cf | |
| # Add lines below | |
| smtp_sasl_auth_enable = yes | |
| smtp_sasl_password_maps = static:apikey:paste_your_key_here | |
| smtp_sasl_security_options = noanonymous | |
| smtp_tls_security_level = encrypt | |
| header_size_limit = 4096000 | |
| relayhost = [smtp.sendgrid.net]:587 | |
| # Redirect root emails to real email address | |
| $ sudo vi /etc/aliases | |
| root: [host]_postfix@[your domain] | |
| $ sudo service postfix restart | |
| # Check logs | |
| $ tail -f /var/log/mail.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment