3

I'm having trouble getting my mailertable to work....

/etc/mail/sendmail.mc contains this line
FEATURE(`mailertable', `hash -o /etc/mail/mailertable.db')dnl

/etc/mail/mailertable contains this line
domain1.com        esmtp:[10.210.5.22]

I ran these to "recompile" the settings...

makemap hash /etc/mail/mailertable.db < /etc/mail/mailertable
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
service sendmail restart

Then tried to send a test

$ mail -s "test email" aaron@domain1.com


$ tail -f /var/log/maillog
May  9 10:03:14 npsetl005 sendmail[27779]: p49E3EG0027777: to=<aaron@www.domain1.com>, ctladdr=<root@npsetl005.domain.domain1.pri> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120350, relay=www.domain1.com. [172.16.1.47], dsn=4.0.0, stat=Deferred: Connection refused by www.domain1.com.

Contents of the mailertable.db file

root@npsetl005:/etc/mail$ strings mailertable.db
esmtp:[10.210.5.22]
domain1.com

We have this stupid problem on our internal network where DNS and MX records aren't really set up 100 percent correctly. Getting permission to change it, and test it are way beyond the scope of this question; So I just want sendmail to ignore what's in DNS and fire messages straight to our internal relay server (which works for dozens of other clients) - but it's not doing that. You can see that it's rewriting the addresses to user@www.domain1.com because the parent *.domain1.com is a cname to www.domain1.com (someone did this as a poor mans redirect. So if a user tries to go to a subdomain that doesn't exist, they go to the root website instead... I know. I know.)

What did I miss?

LVLAaron
  • 1,735

2 Answers2

1

You don't mention your sendmail version. Sendmail broke... I'm sorry, changed the way mailertable works, with version 8.14. I've had all my mail hubs break when upgrading to RHEL6 with sendmail-8.14. I'm still trying to understand exactly what they change is, and why they changed it. But I've picked up two tips so far:

1) If you want to use virtusertable, and also use mailertable on the RHS of the virtusertable entries, the LHS needs to be in the new VirtHost class. There are VIRTUSER_DOMAIN_FILE and VIRTUSER_DOMAIN macros to help with this.

2) If a LHS domain appears in local-hosts-names, mailertable will never be used.

I'm not sure how accurate these are, but there is so little info on this drastic and undocumented change, that maybe this will help someone in my position.

0

You have send to aaron@domain1.com but sendmail rewrites it to aaron@www.domain1.com. The mailertable entry does not cover subdomains.

Quick Fix:
Add mailertable entry for www.domain1.com.

Do you use CNAME record for domain1.com?
Sendmail rewrites CNAME (DNS alias) to its "true" name.

AnFi
  • 1,546