Configure Postfix to use Gmail as a Mail Relay on Fedora
Summary:
#dnf update && dnf install postfix cyrus-sasl cyrus-sasl-plain mailx
#vi /etc/postfix/sasl_passwd
[smtp.gmail.com]:587 username@gmail.com:password
#chmod 600 /etc/postfix/sasl_passwd
#vi /etc/postfix/main.cf
Add or modify the following values:
relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
#postmap /etc/postfix/sasl_passwd
#systemctl restart postfix.service
https://myaccount.google.com/lesssecureapps
#mail -s "Subject Here" recipient@domain.com < textfile
or
#telnet localhost 25
mail from:
rcpt to:
data
your_messages
.
quit
Troubleshooting:
journalctl -u postfix
#dnf update && dnf install postfix cyrus-sasl cyrus-sasl-plain mailx
#vi /etc/postfix/sasl_passwd
[smtp.gmail.com]:587 username@gmail.com:password
#chmod 600 /etc/postfix/sasl_passwd
#vi /etc/postfix/main.cf
Add or modify the following values:
relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
#postmap /etc/postfix/sasl_passwd
#systemctl restart postfix.service
https://myaccount.google.com/lesssecureapps
#mail -s "Subject Here" recipient@domain.com < textfile
or
#telnet localhost 25
mail from:
rcpt to:
data
your_messages
.
quit
Troubleshooting:
journalctl -u postfix
Komentar