Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
If you want to send mail unconditionally to the relay, use SMART_HOST to ship it there. –  vonbrand Mar 4 at 17:46

2 Answers 2

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.