Apr 22, 2010

understanding sendmail better

One and a half day I've beed fighting with sendmail.
The issue is like the following:
I've have mail server on google (google app) for my domain (lets call it domain.ru) and I've have a dedicated server for that domain, that runs site/forum. Let the server name be domain.ru. Forum sends messages to it's users (notifications and like). Most of users have mails on external mail servers (mail.ru, gmail.com and like) and a few users have mails on my domain.ru server.
MX records point to google.
Sendmail that runs on domain.ru server thinks mails for user_name@domain.ru as local and do not send them to google (!), other mails are sent OK.
Playing with MAIL_HUB/LOCAL_RELAY/stickyhost gave no luck. All the mails sent to user_name@domain.ru were put into /var/spool/mail instead of sending to google :(
/etc/hosts of the server has the record pointing that its external IP XX.XXX.XXX.XXX is domain.ru what is a real true :)
That's why when sendmail got mail like user_name@domain.ru it treat it like local.
Changing name of XX.XXX.XXX.XXX in /etc/hosts from "domain.ru" to "domain" brought no luck: mails sent to user_name@domain.ru started to be sent to google, but it appeared that some other mail servers like pochta.ru check the name of the sender and reject the mail if sender name cant be resolved ("domain" points to nowhere).
What's the next? Googling doesnt help: some advices are not acceptable, some other do not work at all :(

The solution appeared to be straight and simple.
I've changed the name where points XX.XXX.XXX.XXX in /etc/hosts to "www.domain.ru". Now when sendmail gets mail like user_name@domain.ru it doesnt think it to be local (for sendmail local mail should be user_name@www.domain.ru now!) and sends mails to google. External mail servers (like pochta.ru) can now resolve "www.domain.ru" host!
I've won!

mood: thinking
music: Depeche Mode