Sunday, September 30, 2012

Email troubles

Today I received an email from the guy that runs the server I use as a mail relay.  Apparently, my asterisk box has been sending constant email to his mail server (smart host forwarding).  I think what was happening is that I had set my .forward on the asterisk box to send to "user@host" where host is my own server at home.  That server uses exim4.  I really could never figure out how to make "user@host" stay local.  Via some trial and error I finally found that "user@mydomain" seems to work and the email isn't forwarded to the smart host but stays put on my server.  I just need to remember this in the future, hence my post here to remind me.

UPDATE:
I didn't have it quite right before.  A couple of issues.  First, the asterisk box wasn't delivering email to local users.  Instead it punted and sent it to the relay which didn't recognize it either.  This was fixed by setting mydestination to "localhost, <myhostname>" in the postfix config file.  After that, mail would get delivered locally when using unqualified user names for the email address, as well as user@<myhostname>.  The second issue was that my exim4 main mail server didn't recognize user@hostname (where hostname is the exim4 server name) as being local and would send it to the relay.  This is the same problem the asterisk server had, but this is fixed in update-exim4.conf.conf by setting dc_other_hostnames to include the exim4 server name.  It previously only had my domain name in it which is why user@<mydomain> was getting delivered locally.

No comments:

Post a Comment