OT: How to configure sendmail to use a specific IP address instead of MX record value

Patrick Doyle wpdster at gmail.com
Tue Nov 14 18:15:48 UTC 2006

> Since you didn't quote the solution you used, I'll point out that
> the syntax to avoid MX lookups is to enclose a hostname or IP
> address in []'s.
I'm not sure that would have solved my specific problem (which I may
not have described too well).  I just tried it, and it doesn't look
like it would work for me.  In order for it to work, I would have had
to be able to:

echo "some message" | mail wpd@[mycompany.com] -s "test"

and add the internal IP address of our SMTP server to my /etc/hosts file.

In that manner, sendmail would not look for the MX record for
mycompany.com (because it was in brackets) and would, instead, find
the internal IP address from my /etc/hosts.

That is precisely the sort of solution for which I was looking,
assuming that it worked.

I just tried this and, my sendmail didn't like the @[mycompany.com]
syntax in my email address.

Instead, putting in the internal IP address of our SMTP server as the
SMART_HOST, solved the problem, though not in the manner I was
originally envisioning.

Anyway, thank you again to the folks who responded.


More information about the users mailing list