sendmail not using mailertable...
/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]
makemap hash /etc/mail/mailertable.db < /etc/mail/mailertable m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf service sendmail restart
$ 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.
Responses
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 "domain1.com") as well as subdomains (i.e., your "www.domain1.com") you'd need your mailertable to look like:
domain1.com esmtp:[IPADDR] *.domain1.com esmtp:[IPADDR]
I may be remembering for another table-type, though.
Just checked the definitive guide (http://www.sendmail.org/m4/mailertables.html). Instead of "*.domain1.com" to catch the www.domain1.com value, it would be just ".domain1.com". It might be interpreting the "*" literally.
You want to leave the asterisk off to glob everything underneath.
mydomain.com ESMTP:[10.0.0.1]
.mydomain.com ESMTP:[10.0.0.1]
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.
Example: