Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Sendmail to local domain ignoring MX records


    I have set up my domain to use google apps for its mail server. I have set up the appropriate MX entries in DNS. All outside mail to that domain works fine - it goes to my gmail box. The problem is when I am sending mail from from my localhost using sendmail (e.g. using the php mail() function). Mail to "" will go to my local mailbox for user "me", instead of checking the MX record for and going to my gmail box.

    If I change my hostname from "" to "", the mail get's sent, but then mail to outside servers gets rejected because they think it's coming from which doesn't have the specified sender account.

    So I would prefer to keep the hostname correct (, but get sendmail working.

    I have had this working before, perhaps by fluke, but I cannot seem to get it to work anymore.

    I have been on this for about a week. I've googled my brains out and read the sendmail manual right through.. but can't seem to figure out what is going on.

    The solution that I'm looking for will still use sendmail to send out all email (i don't want to send through an external SMTP server), but will allow mail to domains hosted on my machine to follow the MX records defined in those domains.

    Any and all help is appreciated.


  2. #2
    I've had the exact same problem using sendmail on my webserver for and trying to use it to deliver mail to Google's SMTP servers which host the mail for

    I've tried many different things including:
    - setting this option in sendmail's config: define(`confDONT_PROBE_INTERFACES', `True') as per some suggestions i've read elsewhere

    I went back to our old webserver and figured out the main different which is that the server is running a local DNS which has an MX record for that points to Google. This seems totally unnecessary to me given that a "dig" or "nslookup" for's MX record on the new server returns google's smtp servers already.

  3. #3
    I eventually solved this problem by changing my hostname to and then set

    In the sendmail config file.

    That way mail sent to from the server is not picked up by localhost (because the server is actually, while at the same time, mail sent from the server correctly says it's from

    Not sure if there were other solutions, but I battled this for many sleepless nights and finally found this to work.

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts