In some cases, we need to make the mail handling of server name itself to be done by a remote server. Let the server name be test.com. Then if you sent a mail from the server of test.com (from backend or through a php mailer) using sendmail to user@test.com, then the mail will be tried to be delivered locally in the main server rather than actual mail handling server and this results in a failure. In that case, what I did was the following: Hope this might help you.
checked /etc/mail/local-host-names and make sure that server name (test.com) is not there. Then did the following:
1. Open /etc/mail/sendmail.mc
vi /etc/mail/sendmail.mc
2. Added the following in the end:
define(`MAIL_HUB', `test.com.')dnl define(`LOCAL_RELAY', `test.com.')dnl 3. ran the following command to reflect the changes:
sendmailconfig
Restarted the sendmail service and I was able to send mail to the remote mail server fine.






0 comments:
Post a Comment