I just recently set up reverse DNS on our system and set the hostname of the server to mydomain.com. Since I've done this -- Sendmail will send to any domain except mydomain.com. I have read THIS QUESTION, but the OP in that question had no "real" validation that the domain belonged to the server. I have a web site with mydomain.com on the server, the A and PTR records all point correctly to the server. The MX records for mydomain.com point to mx1.emailsrvr.com and mx2.emailsrvr.com correctly (Rackspace).

I am assuming that it thinks that the mail is local, and thus not sending it "out" but I am not sure.

Here is an example of a log for a message that was sent, and received correctly:

Oct 29 16:29:10 mydomain sendmail[1421]: w9TLTA1w001421: from=zak, size=389, class=0, nrcpts=1, msgid=<[email protected]>, relay=zak@localhost
Oct 29 16:29:10 mydomain sm-mta[1422]: w9TLTABl001422: from=<[email protected]>, size=565, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=mydomain.com []
Oct 29 16:29:10 mydomain sendmail[1421]: w9TLTA1w001421: [email protected], ctladdr=zak (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30389, relay=[] [], dsn=2.0.0, stat=Sent (w9TLTABl001422 Message accepted for delivery)
Oct 29 16:29:11 mydomain sm-mta[1424]: STARTTLS=client, relay=gmail-smtp-in.l.google.com., version=TLSv1.2, verify=FAIL, cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128/128
Oct 29 16:29:11 mydomain sm-mta[1424]: w9TLTABl001422: to=<[email protected]>, ctladdr=<[email protected]> (1000/1000), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=120565, relay=gmail-smtp-in.l.google.com. [], dsn=2.0.0, stat=Sent (OK 1540848551 k3-v6si10178885ite.86 - gsmtp)

Here is an example of an email that was never received on the other side:

Oct 29 16:24:31 mydomain sendmail[544]: w9TLOV8v000544: from=zak, size=375, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
Oct 29 16:24:31 mydomain sm-mta[545]: w9TLOVxv000545: from=<[email protected]>, size=552, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=mydomain.com []
Oct 29 16:24:31 mydomain sendmail[544]: w9TLOV8v000544: [email protected], ctladdr=zak (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30375, relay=[] [], dsn=2.0.0, stat=Sent (w9TLOVxv000545 Message accepted for delivery)
Oct 29 16:24:31 mydomain sm-mta[546]: w9TLOVxv000545: to=<[email protected]>, ctladdr=<zak@mydomain com> (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30762, dsn=2.0.0, stat=Sent

Here is my sendmail.mc

VERSIONID(`$Id: sendmail.mc, v 8.15.2-3 2015-12-10 18:02:49 cowboy Exp $')
dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE
dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE
dnl #
dnl # General defines
dnl #
dnl # SAFE_FILE_ENV: [undefined] If set, sendmail will do a chroot()
dnl #   into this directory before writing files.
dnl #   If *all* your user accounts are under /home then use that
dnl #   instead - it will prevent any writes outside of /home !
dnl #   define(`confSAFE_FILE_ENV',             `')dnl
dnl #
dnl # Daemon options - restrict to servicing LOCALHOST ONLY !!!
dnl # Remove `, Addr=' clauses to receive from any interface
dnl # If you want to support IPv6, switch the commented/uncommentd lines
dnl #
dnl DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission, M=Ea, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet,  Name=MSP-v4, Port=submission, M=Ea, Addr=')dnl
dnl #
dnl # Be somewhat anal in what we allow
dnl #
dnl # Define connection throttling and window length
define(`confCONNECTION_RATE_THROTTLE', `15')dnl
dnl #
dnl # Features
dnl #
dnl # use /etc/mail/local-host-names
dnl #
dnl # The access db is the basis for most of sendmail's checking
FEATURE(`access_db', , `skip')dnl
dnl #
dnl # The greet_pause feature stops some automail bots - but check the
dnl # provided access db for details on excluding localhosts...
FEATURE(`greet_pause', `1000')dnl 1 seconds
dnl #
dnl # Delay_checks allows sender<->recipient checking
FEATURE(`delay_checks', `friend', `n')dnl
dnl #
dnl # If we get too many bad recipients, slow things down...
dnl #
dnl # Stop connections that overflow our concurrent and time connection rates
FEATURE(`conncontrol', `nodelay', `terminate')dnl
FEATURE(`ratecontrol', `nodelay', `terminate')dnl
dnl #
dnl # If you're on a dialup link, you should enable this - so sendmail
dnl # will not bring up the link (it will queue mail for later)
dnl define(`confCON_EXPENSIVE',`True')dnl
dnl #
dnl # Dialup/LAN connection overrides
dnl #
dnl #
dnl # Default Mailer setup
define(`MAIL_HUB`, 'mydomain.com.')dnl
define(`LOCAL_RELAY`, 'mydomain.com.')dnl

Is there anything glaring as to why sendmail will send to every domain except mydomain.com? We use Rackspace for mydomain.coms email. If I do a dig MX for mydomain.com, the MX records come up correctly as well. I am stumped!

1 Answer 1


Just name the host properly. No system should ever have a hostname equal to the naked domain name. Among other things, it breaks email. Sendmail sees the local hostname, and if it matches the recipient domain of incoming mail, it thinks it is supposed to deliver it locally, and completely ignores the MX records.

  • so, just take the .com off? -- Or, a suggestion of a proper hostname ?
    – Zak
    Oct 30, 2018 at 15:45
  • No, you give it a proper FQDN, such as mail.example.com. Oct 30, 2018 at 15:46
  • So let me clarify a bit more if I may. This server runs MUCH more than just sendmail. Sendmail we are just using to send system notifications out. It would seem silly to set the hostname mail.mydomain.com -- if I were to change it to something like admin.mydomain.com would the emails need to be from admin.mydomain.com or just mydomain.com
    – Zak
    Oct 30, 2018 at 15:50
  • So name it something else. But the mail can still be "from" whatever domain you want. Oct 30, 2018 at 15:53
  • Tested and verified .. None of the materials I read over covered the "why" -- It's because in the hosts file your hostname points to -- Thanks for putting me on the right track!
    – Zak
    Oct 30, 2018 at 16:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .