ISPConfig - Mail() does not route to remote MX when to domain on local server

Discussion in 'Server Operation' started by horrorshow, Mar 28, 2013.

  1. horrorshow

    horrorshow New Member


    I hate to ask a question for my first post, but I have a route added to transport to google's IP. This is added under Advanced Email Routing. The domain uses google apps.

    When I try to send an email using PHP's mail() function to any other email address, it works fine. When sending to an email address of a site on the local server, it tries to route it to localhost:

    Mar 28 15:01:31 vds1 postfix/smtpd[582]: NOQUEUE: reject: RCPT from localhost[]: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in relay recipient table; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<>

    Mar 28 15:01:31 vds1 sendmail[652]: r2SC1UVX000652: [email protected], [email protected] (48/48), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30079, relay=[] [], dsn=5.1.1, stat=User unknown

    The domain is added as a site, but not a mail domain. Do I have this configured wrong, or is something else wrong? This is causing a form to not properly deliver emails.

  2. bpmee

    bpmee Member


    I don't have much experience with using Google to send and receive email with apps, but you might have to include Google's special SPF record inside your mailing domain's TXT record to send mail properly.

    Google's SPF record for Apps is here.

    From that page...

    To create an SPF record for a domain:

    Log in to the administrative console for your domain.

    Locate the page from which you can update the DNS records. You may need to enable advanced settings.

    Create a TXT record containing this text: v=spf1 ~all

    *(My note: this is NOT a separate TXT record if you already have one, just add the part to your existing domain an ~all if necessary)

    Publishing an SPF record that uses -all instead of ~all may result in delivery problems. See Google IP address ranges for details about the addresses for the Google Apps mail servers.

    If your registrar also requires a host setting (such as @), see the TXT records for specific domain providers list for precise instructions.

    Save your changes.

    Keep in mind that changes to DNS records may take up to 48 hours to propagate throughout the Internet.

Share This Page