- OS: Centos
- User: root
yum install postfix mailx cyrus-sasl cyrus-sasl-plainTo configure postfix to use Gmail as a Mail Relay
vi /etc/postfix/main.cfAdd or modify the following as below:
#To use smpt gmail with 587 portTo configure Gmail authentication
relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
smtp_tls_security_level = encrypt
# Location of CA certificates
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
vi /etc/postfix/sasl_passwdAdd the line as below:
[smtp.gmail.com]:587 [email protected]:passwordRunning commands as below:
chmod 600 /etc/postfix/sasl_passwdTo restart postfix service
chown root:root /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
postmap /etc/postfix/sasl_passwd
service postfix startTest send a email
echo "Test Mail" | mailx -v -r "A[email protected]" -s "Test Mail 01" [email protected]
Troubleshooting - Enable "Less secure apps" access
The solve problem to link: https://support.google.com/accounts/answer/6010255?hl=enThanks for reading Configure Postfix to use Gmail as a Mail Relay My blog Effortless Zimbra Mail Management: Unleashing the Power of Linux Commands, How-To, and Bash Scripts I hope this is useful.
1 Comments :
Ummid hai ki aapko ye article bahut pasand aayega aur agar kuch galat lage toh comment karke jaroor bataye aur ye bhi bataye ki aapko ye post kaisi lagi. create gmail account
Relay