get local sendmail to use MX records

Gerard Meijer gmeijer at
Wed Feb 23 17:50:17 GMT 2005

No, that is not the solution. It could be, but it's not what I want.

An example:

domain: is hosted on server B. The MX record for says that 
server A handles the mail of So anyname at should be 
handled by server A.

This works, but now on server B there runs a script that sends an e-mail to 
gerard at . What SHOULD happen is that sendmail on server B looks up 
the MX record for, sees that server A handles the mail for and sends the mail to server A. What happens is that sendmail 
recognizes the domain as hosted on that machine and uses localhost to 
deliver the mail. It looks for user gerard (in this example), which doesn't 

I agree with you, a solution would be to set in the alias file of server B 
something like gerard: root at . If this was about just one 
e-mailaddress, it wouldn't be a problem, but I'm actually talking about a 
little more then one address.

So that's not a good solution for me.

----- Original Message ----- 
From: "Hexren" <me at>
To: "Gerard Meijer" <gmeijer at>
Cc: <freebsd-questions at>
Sent: Wednesday, February 23, 2005 6:30 PM
Subject: Re: get local sendmail to use MX records

> GM> Hi,
> GM> I have the following situation:
> GM> I have moved my mail services from my dedicated server to another 
> server.  The MX records were updated at the DNS host to point to the other 
> server.  Email from the outside is being routed
> GM> correctly to the new server, but now the local scripts on the 
> dedicated server are still being routed to the local accounts and not 
> actually sent to the other server.
> GM> So sendmail on the first server tries to use localhost as a relay, 
> instead of looking up the MX records for the domain.
> GM> Anybody knows how to solve this?
> GM> Thanks!
> GM> Gerard
> GM> _______________________________________________
> GM> freebsd-questions at mailing list
> GM>
> GM> To unsubscribe, send any mail to 
> "freebsd-questions-unsubscribe at"
> ---------------------------------------------
> Quick and dirty: /etc/mail/aliases
> putting in something like "root: root at" should do the
> trick. Or am I missing something ?
> Hexren
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to 
> "freebsd-questions-unsubscribe at"

More information about the freebsd-questions mailing list