On 09/26/12 01:07, Philip Guenther wrote:
On Tue, Sep 25, 2012 at 3:30 PM, Alexander Hall <[email protected]> wrote:
I had a problem with sendmail not honoring /etc/hosts.
What problem are you trying to solve that makes you want to use
/etc/hosts? e.g., "I need to ignore a bogus MX entry for a specific
host"?
The problem was that machine(s) on the same local network as our MX
would try to send the mail to the external address. I did not want the
MX lookup changed, but only the A lookup of the MX hosts. Maybe mixing
sources like that is a bit strange, but anyway, that was the idea.
I was able to handle internal hosts by the rdr+nat trick on the
gateways, but for mail originating from the gateways themselves I could
not make it happen, and at some point it seemed I caused checksum
issues. IIRC, henning has mentioned such issues to me previously.
and after some
googeling I found my way back to the Fine FAQ of ours, stating the
following:
...
Now I happily created that file and HUP'd sendmail, but did not notice any
change in behaviour. Looking further I noted this:
Quoting /usr/src/gnu/usr.sbin/sendmail/doc/op.me's description of the
service switch file:
-----
Notice: since sendmail must access MX records for
correct operation, it will use DNS if it is configured
in the ServiceSwitchFile file. Hence an entry like
hosts files dns
will not avoid DNS lookups even if a host can be found
in /etc/hosts.
-----
I.e., if the sendmail.cf direct the MTA to do MX lookups, they will
still happen via DNS. The service switch just controls
hostname->address lookups.
Yes, that is what I want. MX is fine, but I want to "override" its IP
address.
What about all those commented out "ServiceSwitchFile=..." entries in
/etc/mail/*.cf ? To me it looks like the default sendmail config's just
don't handle it but would require me to bake a new cf from the mc's.
Possibly that would make it work, but I'm just pointing out that the FAQ
is incorrect if so.
Depending on what you're really try to do, the right solution is
*probably* to use a mailertable entry with an IP or hostname in square
brackets.
Hmm. Maybe doable, but I don't want to have to do it for every domain or
host that our MX handles.
/Alexander
Philip Guenther