Friday, September 18, 2009

sendmail redirecting mail to outside

There are times when you host your mail on another server like google mail ..
To do so, you may set it in the configuration to set sendmail to redirect mails to outside instead of identifying it as local recipient.

in /etc/mail/sendmail.mc
MASQUERADE_AS(`domain.com')dnl
define(`LUSER_RELAY', `domain.com.')dnl

Note: do not miss the 'dot' behind the domain.

then compile with m4 in /etc/mail
m4 sendmail.mc > sendmail.cf

restart sendmail service:
/etc/init.d/sendmail restart

testing it:
sendmail -v yourname@domain.com < /dev/null

check your email, and makesure to check your spam folder as this is going to be an empty email, and spam filtering doesn't like that ;)

1 comment:

kelvinchaw said...

Thanks for fixing the problem James ;) Good job