Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a tiny home server setup behind my cable modem (bresnan communications). I want to be able for this box to send out email (not receive) for notifications and whatnot.

What I have already done:

  • I have installed and configured sendmail.
  • I have added as my SMART_HOST directive.

What I belive the problem is

When I attempt to send an email I get the following in my mail log:

Dec 22 10:24:17 batcave sendmail[1530]: oBMHOHrs001530: from=aburns, 
  size=140, class=0, nrcpts=1, 
Dec 22 10:24:17 batcave sm-mta[1531]: oBMHOHWZ001531: from=<>, 
  size=397, class=0, nrcpts=1,
  proto=ESMTP, daemon=MTA-v4, relay=localhost []
Dec 22 10:24:17 batcave sendmail[1530]: oBMHOHrs001530:
  to=<>, ctladdr=aburns (1000/1000),
  delay=00:00:00, xdelay=00:00:00, mailer=relay,
  pri=30140, relay=[] [],
  dsn=2.0.0, stat=Sent (oBMHOHWZ001531 Message accepted for delivery)
Dec 22 10:24:18 batcave sm-mta[1517]: oBMH9mVv001357:
  to=<>, ctladdr=<>
  (1000/1000), delay=00:14:30, xdelay=00:00:42, mailer=relay,
  pri=300339, [],
  dsn=4.0.0, stat=Deferred: Connection timed out with

You can see where the message is accepted for delivery by my sendmail server, then where it attempts to hand off to bresnan's server and it timesout.

This is where my question is. Asstute readers will notice that is not what I have my SMART_HOST directive set as. This is the (outside?) MX server for the domain. Apparently bresnan has their network configured so that you can not access this server from within their own network and instead must use the server (which I can connect to). The problem is that I don't know how to tell sendmail to use this server and not the domain.

What I have tried

  • Setting a hosts entry so that the pmx0 server points to the mail IP address. This doesn't work, which makes sense as sendmail is obviously doing an MX query to find the server which returns the IP so there is never a need to do a 'normal' DNS resolve so the hosts file never gets involved.

The Fix (for all outgoing mail):

Again, props goes to webmin (see note below) for helping me learn this. If you enter your smarthost with square brackets that instructs sendmail to not do an MX lookup, so: define('SMART_HOST','[]') (Fix the quotes->backticks) actually works without a mailer table.

The Fix (for specific domains):

As pointed out below setting up a mailertable is required. However, as pointed out in the man page, this feature also needs to be enabled in your file.

Also note that the mailer route does not force sendmail to use the specified server for all operations, it is based on the recipient's address. This is actually OK for me as I only need to send to a few domains (gmail, google hosted, and my work).


  • Add FEATURE('mailertable') to your file. (note that the first quote should be a backtick.
  • Create your /etc/mail/mailertable file (See man page)
  • Create a mapfile: sudo makemap hash /etc/mail/mailertable.db < /etc/mail/mailertable
  • Rebuild your configs make -C /etc/mail
  • Restart sendmail: service sendmail restart

NOTE: I highly recommend using WebMin to edit/rebuild these files. Without it I would have gone crazy trying to figure out why my mailertable file was being ignored.

share|improve this question
Can we see your – larsks Dec 22 '10 at 17:47
As you made changes to the configuration file, did you restart sendmail after each change? – ewwhite Dec 22 '10 at 19:31
up vote 5 down vote accepted

You can get around the MX lookup by adding a short entry into your sendmail /etc/mail/mailertable file.

The contents of the file should probably have a single line like:       esmtp:[]

Save the file and restart sendmail (or rebuild your if it must be done manually).

share|improve this answer
Your answer was correct; however I had to take some additional steps. For others encountering this issue see my edit above. – ErebusBat Dec 22 '10 at 20:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.