Walker News

How To Configure Sendmail On Linux Without DNS?

Suppose the IP address of smart host is static and not likely to change, you might want to configure Sendmail to run without DNS server or name server for translation service.

Without referring to DNS server, the overall performance of Sendmail might improve too, since there is lesser burden of latency.

Configure Sendmail without DNS

This guide is using Sendmail version 8.13.8 on Redhat Enterprise Linux (RHEL5.2). The smart host is Microsoft Exchange server (running ESMTP service, a.k.a. Extended SMTP or Enhanced SMTP), with IP address and registered as exch01.walkernews.net on official DNS server (though it is not used by Sendmail).
  1. Edit /etc/hosts to add IP-DNS mapping for the smart host. With /etc/hosts file, you can use a different name to refer the smart host IP. For example:   esmtp   esmtp.walkernews.net
  2. Create /etc/mail/service.switch, which contains only this line:
    hosts files
  3. Edit /etc/mail/sendmail.cf:
    • Locate “DS” and replace it to become (replace the host name with the one you have defined in /etc/hosts file):
    • Locate “ServiceSwitchFile” and change it to become as follow (or just add in this following line if there is no ServiceSwitchFile in sendmail.cf yet):
      O ServiceSwitchFile=/etc/mail/service.switch
  4. Restart Sendmail service to verify sendmail.cf configuration
    service sendmail restart

Now, try to send a test email, using Sendmail to relay to Microsoft Exchange server:
mail -s "Test email" walker@walkernews.net </dev/null

On Microsoft Outlook that connect to Exchange server, just press F9 to synchronize Inbox immediately.

If the Exchange server allows email relay from this particular Linux SMTP server, the test email should be delivered. Otherwise, try to use telnet to connect SMTP server for troubleshooting.

Custom Search

  1. Walter 17-01-13@20:14

    Thanks, I’ve been all over the internet and this easy to understand method worked 100%. Thanks for sharing.

2018  •  Privacy Policy