1

I've defined SMART_HOST to be a specific server, lets call it foo.bar.com. However, when I send a test mail using 'sendmail -t', sendmail tries to use mx.bar.com, which subsequently rejects my mail. I've verified that foo.bar.com works and that mx.bar.com does not work (yay telnet). I've recompiled sendmail.mc vi make, make -C and m4. I've verified the DS entry in sendmail.cf. I've restarted sendmail correctly. I'm not sure how to proceed at this point. Any ideas?

Here is my SMART_HOST line:

define(SMART_HOST',foo.bar.com')dnl

...and here is the result of a test mail. It never tries to use foo.bar.com, instead it uses mx.bar.com.

$ echo subject: test; echo | sendmail -Am -v -flocaluser -- [email protected] subject: test
[email protected]... Connecting to mx.bar.com via relay...
220 mx.bar.com ESMTP
>>> EHLO myhost.bar.com
250-mx.bar.com
250-8BITMIME
250 SIZE 52428800
>>> MAIL From:<[email protected]> SIZE=1
250 sender <[email protected]> ok 
>>> RCPT To:<[email protected]>
550 #5.1.0 Address rejected.
>>> RSET
250 reset
localuser... Connecting to local...
localuser... Sent
Closing connection to mx.bar.com.
>>> QUIT
221 mx.bar.com

And last, here is a test mail sent using foo.bar.com:

$ hostname
myhost.bar.com
$ telnet foo.bar.com 25
Trying ***.***.***.***...
Connected to foo.bar.com (***.***.***.***).
Escape character is '^]'.
220 foo.bar.com ESMTP Sendmail 8.14.1/8.14.1/ITS-7.0/ldap2-1+tls; Tue, 21 Dec 2010 13:27:44 -0700 (MST)
helo foo
250 foo.bar.com Hello myhost.bar.com [***.***.***.***], pleased to meet you
mail from: [email protected]
250 2.1.0 [email protected]... Sender ok
rcpt to: [email protected]   
250 2.1.5 [email protected]... Recipient ok
data
354 Enter mail, end with "." on a line by itself
testing 
.
250 2.0.0 oBLKRikZ003758 Message accepted for delivery
quit
221 2.0.0 foo.bar.com closing connection
Connection closed by foreign host.

Any ideas?

Thanks

1 Answer 1

2

Sendmail may be performing an MX lookup on the domain, which is not necessarily what you want. Enclose the hostname in square brackets to prevent this.

define(`SMART_HOST',`[foo.bar.com]')dnl
2
  • that did it... at least for the test mail :) thanks
    – daniel
    Dec 21, 2010 at 21:43
  • This works when using -Am, but reverts back to mx.bar.com if I don't specify -Am. Is there a way to force sendmail to not perform an MX lookup system wide?
    – daniel
    Dec 21, 2010 at 21:55

You must log in to answer this question.

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