Sendmail delivering locally instead of to MTA in MX record

mx-recordsendmail

Ok, so I've got a box named websrv1.mydomain.com. It's a web server running ubuntu, apache2, sendmail, etc.

My email is outsourced to a third party. So in my DNS I've got MX set to mx.thirdparty.net.
I've no reason to accept incoming mail on my web server, every email should be sent to the third party. This works correctly accept with sending mail from the webserver (aka via cron or console).

So from my web server, if I send an email to me@mydomain.com, it just disappears. No errors, nothing in dead.letter, nothing. I can send to any other address with no issues. If I send to me@websrv1.mydomain.com it's delivered locally which is fine.

1) Doing an nslookup shows the mx
record is correct.
2) Running /mx mydomain.com from
sendmail -bt
returns the correct result.
3) Running sendmail -bv me@mydomain.com
returns:

 sudo sendmail -bv me@mydomain.com
 me@mydomain.com... deliverable: mailer esmtp, host mydomain.com., user me@mydomain.com

4) Running 3,0 me@mydomain.com, returns:

    3,0 me@mydomain.com
    canonify           input: me @ mydomain . com
    Canonify2          input: me 
    Canonify2        returns: me 
    canonify         returns: me 
    parse              input: me 
    Parse0             input: me 
    Parse0           returns: me 
    Parse1             input: me 
    MailerToTriple     input:  me 
    MailerToTriple   returns: me 
    Parse1           returns: $# esmtp $@ mydomain . com . $: me 
    parse            returns: $# esmtp $@ mydomain . com . $: me 

So I'm at a loss. Sendmail seems to see the mx record, but it's not using it.

Best Answer

Check to ensure that sendmail is not configured to handle the local domain. Strange vanishing acts can occur if it tries to handle the email locally, but it bounces, but the bounce also bounces.

Must you use sendmail? I've replaced everything with Postfix. It's much easier to handle, IMHO.