Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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

LOCAL_RULE_1
R$* < @ example.com. > $*       $#esmtp $@ [MX.ser.ver] $: $1 < @ example.com. > $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 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

 
discard

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.