How to configure sendmail to relay through a specific server

Posted by ErebusBat on Server Fault See other posts from Server Fault or by ErebusBat
Published on 2010-12-22T17:38:24Z Indexed on 2010/12/22 17:56 UTC
Read the original article Hit count: 218

Filed under:
|

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

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 pmx0.bresnan.net is not what I have my SMART_HOST directive set as. This is the (outside?) MX server for the bresnan.com/net 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 mail.bresnan.net 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.

© Server Fault or respective owner

Related posts about linux

Related posts about sendmail