Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, 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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2008
    Posts
    2

    Sendmail to local domain ignoring MX records


    Hi,

    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 "me@example.com" will go to my local mailbox for user "me", instead of checking the MX record for example.com and going to my gmail box.

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

    So I would prefer to keep the hostname correct (example.com), 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.

    -Steve

  2. #2
    Just Joined!
    Join Date
    Apr 2009
    Posts
    1
    I've had the exact same problem using sendmail on my webserver for mydomain.com and trying to use it to deliver mail to Google's SMTP servers which host the mail for mydomain.com.

    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 mydomain.com that points to Google. This seems totally unnecessary to me given that a "dig" or "nslookup" for mydomain.com's MX record on the new server returns google's smtp servers already.

  3. #3
    Just Joined!
    Join Date
    Dec 2008
    Posts
    2
    I eventually solved this problem by changing my hostname to www.mydomain.com and then set
    MASQUERADE_AS(`mydomain.com')
    FEATURE(masquerade_envelope)

    In the sendmail config file.

    That way mail sent to xyz@mydomain.com from the server is not picked up by localhost (because the server is actually www.mydomain.com), while at the same time, mail sent from the server correctly says it's from mydomain.com.

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

  4. $spacer_open
    $spacer_close

Posting Permissions

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