sendmail not using mailertable...

Latest response


I'm having trouble getting my mailertable to work....
/etc/mail/ contains this line

    FEATURE(`mailertable', `hash -o /etc/mail/mailertable.db')dnl

    /etc/mail/mailertable contains this line        esmtp:[]
I ran these to "recompile" the settings...
makemap hash /etc/mail/mailertable.db < /etc/mail/mailertable

    m4 /etc/mail/ > /etc/mail/

    service sendmail restart
Then tried to send a test
$ mail -s "test email"
$ tail -f /var/log/maillog

    May  9 10:03:14 npsetl005 sendmail[27779]: p49E3EG0027777: to=<>, ctladdr=<root@npsetl005.domain.domain1.pri> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120350, [], dsn=4.0.0, stat=Deferred: Connection refused by

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 because the parent * is a cname to (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?


Contents of mailertable.db



root@npsetl005:/etc/mail$ strings mailertable.db

It's been ages since I've bothered with Sendmail. That said, I seem to remember that, for a number of the keyed tables, if you wanted to map domains (i.e., your "") as well as subdomains (i.e., your "") you'd need your mailertable to look like:     esmtp:[IPADDR]
*   esmtp:[IPADDR]

I may be remembering for another table-type, though.

We only have 1 domain. ( in this case) the is invalid. There aren't any subdomains being mapped here... I'll add it to the file and see what happens, or just go scream and yell at the DNS people and fix it properly. 

Same thing when I added * - it's still going to DNS and looking up mx records...



Mail addressed to gets this in the log file... 



May  9 12:53:29 npsetl005 sendmail[29437]: p49Df1Rj027416: to=<>, ctladdr=<root@npsetl005.kfbdom1.domain1.pri> (0/0), delay=03:12:28, xdelay=00:00:00, mailer=esmtp, pri=840351,, dsn=4.0.0, stat=Deferred: Connection refused by

Just checked the definitive guide ( Instead of "*" to catch the value, it would be just "". It might be interpreting the "*" literally.

You want to leave the asterisk off to glob everything underneath.     ESMTP:[]    ESMTP:[]


This behavior is controlled by two features in Sendmail FEATURE(`relay_hosts_only') or FEATURE(`relay_subdomains').


You can test your mailertable directives with "sendmail -bt", specifying a ruleset of "/map mailertable" and a destination domain.




> /map mailertable
map_lookup: mailertable ( returns ESMTP:[],[] (0)