I'm experiencing lockout issue with gmail postfix relay. I'm using centos 5.9 and zoneminder 1.25. I could successfully send the test mails but after some time mail sending fails with the following error:
Mar 22 13:33:22 MYSERVER sendmail[4516]: r2M4HQFx020433: to=<cctv@gmail.com>, ctladdr=<root@localhost.localdomain> (0/0), delay=03:45:56, xdelay=00:00:00, mailer=esmtp, pri=570366, relay=alt4.gmail-smtp-in.l.google.com., dsn=4.0.0, stat=Deferred: Connection timed out with alt4.gmail-smtp-in.l.google.com.
Please help.
I followed the configuration given below. My centos version is 5.9.
For Centos 5.3
Verify package installed
# rpm -qa |grep postfix
postfix-2.3.3-2.1.el5_2
# rpm -qa |grep sasl
cyrus-sasl-lib-2.1.22-5.el5
cyrus-sasl-2.1.22-5.el5
cyrus-sasl-plain-2.1.22-5.el5
# rpm -qa |grep openssl
openssl-perl-0.9.8e-12.el5_4.1
openssl-devel-0.9.8e-12.el5_4.1
xmlsec1-openssl-1.2.9-8.1.1
openssl-0.9.8e-12.el5_4.1
openssl097a-0.9.7a-9.el5_2.1
Copy root CA certificates. Postfix needs to know the location of root CA.
# cp /etc/pki/tls/certs/ca-bundle.crt /etc/postfix/cacert.pem
Create file that stores GMAIL user and password.
# vi /etc/postfix/sasl_passwd
smtp.gmail.com user@domain:password
#postmap /etc/postfix/sasl_passwd
Edit /etc/postfix/main.cf
# Relay all e-mail via GMail.
relayhost = [smtp.gmail.com]:587
# SASL authentication
smtp_sasl_auth_enable=yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
smtp_sasl_tls_security_options = noanonymous
smtp_sasl_mechanism_filter = login
# TLS
smtp_tls_eccert_file =
smtp_tls_eckey_file =
smtp_use_tls = yes
smtp_enforce_tls = no
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_received_header = yes
tls_random_source = dev:/dev/urandom
Finally, restart postfix.
Deferred: Connection timed out error for gmail postfix relay
Re: Deferred: Connection timed out error for gmail postfix r
Resolved:
Postfix had a conflict with sendmail for listener ip 127.0.0.1. Stopping & uninstalling sendmail resolved the issue.
Postfix had a conflict with sendmail for listener ip 127.0.0.1. Stopping & uninstalling sendmail resolved the issue.