I got a server, which has a hostname example.com 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 example.com which I removed and then rebooted.

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

Any other server I can send email to info@example.com and works fine.


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.

  • 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 sendmail.mc:

R$* < @ example.com. > $*       $#esmtp $@ [MX.ser.ver] $: $1 < @ example.com. > $2
  • 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 sendmail.cf from sendmail.mc 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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