LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   sendmail not using mailertable, or I've done something incorrect. (http://www.linuxquestions.org/questions/linux-server-73/sendmail-not-using-mailertable-or-ive-done-something-incorrect-879653/)

aaron.anderson 05-09-2011 09:32 AM

sendmail not using mailertable, or I've done something incorrect.
 
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.


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?

aaron.anderson 05-09-2011 09:45 AM

Also, this is the output from my mailertable.db file


Code:

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



All times are GMT -5. The time now is 11:05 AM.