sudo pacman -S postfix mailutils mailx
Edit /etc/postfix/main.cf
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
#smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_use_tls = yes
alias_maps = hash:/etc/postfix/aliases
Nothing to edit on /etc/postfix/master.cf
maybe uncomment this:
-o smtpd_tls_auth_only=yes
[smtp.gmail.com]:587 [email protected]:APP_PASSWORD_GENERATED_UNDER_ACCOUNT_SECURIY_SETTINGS
sudo nano /etc/postfix/sasl_passwd
sudo chmod 400 /etc/postfix/sasl_passwd
sudo newaliases
sudo postmap /etc/postfix/sasl_passwd
sudo systemctl restart postfix.service
echo "`date` Just testing my sendmail gmail relay" | mail -s "Sendmail gmail Relay" [email protected]
If everything works, enable the service:
sudo systemctl enable --now postfix.service