Monday, August 15, 2022

connection timeout with smtp server

Issue: 


 I have faced this issue after I did inplace upgrade from OEL 6 to OEL 7. I am not able to send email and the maillog [/var/log/] updated with below error. 


 node-02 sendmail[27436]: 27E5KQWW098928: to=, ctladdr= (1001/1001), delay=00:20:52, xdelay=00:00:00, mailer=esmtp, pri=480584, relay=test.com., dsn=4.0.0, stat=Deferred: Connection timed out with test.com. 
node-02 sendmail[27544]: 27E5eOXd027538: to=, ctladdr= (1001/1001), delay=00:01:00, xdelay=00:01:00, mailer=esmtp, pri=120584, relay=test.com. [192.23.6.77], dsn=4.0.0, stat=Deferred: Connection timed out with test.com.



Reason For this issue: 

In our infra, our mail server dns name is “mail.test.com” and there is separate server for hosting one website called “test.com”. Due to that, If I use “mail.test.com”, The linux server resolves “test.com” instead of “mail.test.com” and ended with timeout error.



Solution: 
Update the IP instead of dns in the configuration. 
• systemctl stop sendmail 
• vi /etc/mail/sendmail.mc 
• Add the below entry [replace the hostname with IP] 
            o define(`SMART_HOST', `192.168.10.111')dnl 
• m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf 
• systemctl restart sendmail 

 If the same issue happens, do the below steps and restart sendmail services.
 • grep DS /etc/mail/sendmail.cf 

Sample output: DS192.168.10.111 If there is no IP, add mail server IP.

No comments:

Post a Comment