We are using sendmail for email notifications in centos 7, we observed that, there are many pending mails in mailq. In the maillog, it says " Deferred: Connection timed out with aspmx3.googlemail.com".
i ran “sendmail -v -q” to flush the pending mails, but no use. Please help me in this issue.
We didn’t edit sendmail.mc file, it has the default entries, and it is observed that, when we run “sendmail -q” command, all the mails are going at a time.
Did you configured MX server host name or ip in sendmail configuration file…?
if not, then add the mx sever ip in sendmail.mc and restart the sendmail service
#vim /etc/mail/sendmail.mc
dnl # be sent out through an external mail server:
dnl #
dnl define(SMART_HOST',’[XX.XX.XX.XX]’)dnl define(SMART_HOST',’[XX.XX.XX.XX]’)dnl
dnl #
define(confDEF_USER_ID', ``8:12'')dnl dnl define(confAUTO_REBUILD’)dnl
define(confTO_CONNECT',1m’)dnl
define(confTRY_NULL_MX_LIST',True’)dnl
save the file restart the service
#/etc/init.d/sendmail restart
without configuring send mail you are not allowed to send mails from your server.