Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I got a server, which has a hostname I installed sendmail to take care of mail delivery but it's delivering mail to it's self instead of the MX record IP

in my /etc/sendmail/local-host-names it had which I removed and then rebooted.

Sending mail from to other emails works fine, but on this machine when I send email to it tries to developer it locally

Any other server I can send email to and works fine.

share|improve this question
up vote 1 down vote accepted

This happens with most MTAs if email for that domain is setup on the server. The answer is, simply, to disable email for that domain on the server.

Are you using a control panel? CPanel has an option to lookup DNS for outgoing email (I cannot remember offhand where it is), Plesk has an option to deactivate mail service for a domain, although I don't think Plesk support sendmail so that's probably not applicable.

share|improve this answer
Yes I think that sounds like what is happening. Not using any control panel of any sorts. So picking up on the hostname, or some config somewhere? – Wizzard Nov 9 '10 at 20:13

Either use FEATURE(nullclient) and forward email to the MX server, or use this trick. Keep in mind though that both these tricks forward all outgoing email to the MX server and then let it decide whether or not to route them. This may not be what you want. That being the case you can add the following to your

R$* < @ > $*       $#esmtp $@ [MX.ser.ver] $: $1 < @ > $2
share|improve this answer
Do I need to run a command after doing that, reboot or anything? – Wizzard Nov 9 '10 at 20:13
You need to produce a new from and restart sendmail. In Debian I run sendmailconfig. In FreeBSD I execute make restart while inside /etc/mail – adamo Nov 9 '10 at 22:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.