


echo "Test mail from postfix" | mail -s "Test Postfix" If you have configured everything correctly, following command should generate a test mail from your server to your mailbox. Thanks Alexander Bakker for the note.įinally, reload postfix config for changes to take effect: sudo /etc/init.d/postfix reload Testing Check if mails are sent via Gmail SMTP server

Note: If you run into issues with above command, try changing certificate name to thawte_Primary_Root_CA.pem in above command. Just run following command: cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem Next, validate certificates to avoid running into error.
Linux mac os x postfix send test email update#
If you want to use your Google App’s domain, please replace your permission and update postfix config to use sasl_passwd file: sudo chmod 400 /etc/postfix/sasl_passwd Open/Create vim /etc/postfix/sasl_passwdĪnd add following line: :587 :PASSWORD You might have noticed that we haven’t specified our Gmail username and password in above lines. Smtp_tls_CAfile = /etc/postfix/cacert.pem Smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd Then open your postfix config file: vim /etc/postfix/main.cfĪnd following lines to it: relayhost = :587 Just select your server as Internet Site and for FQDN use something like If you do not have postfix installed before, postfix configuration wizard will ask you some questions.
Linux mac os x postfix send test email install#
Relaying Postfix mails via :įirst, install all necessary packages: sudo apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules If you face any issue, feel free to use comments-section below. If you want to use a Gmail account as a free SMTP server on your Ubuntu-Linux server, you will find this article useful. Update: This article is part of WordPress-Nginx tutorials series.
