This is a very basic question but I got to get this solved in order to go further. I have configured my MX reccords with Google Apps dns, so all my domain's incoming email go to Apps. I have also Postfix installed on my Linux server and I am able to send email from PHP pages using PHPMailler class. I don't understand. Isn't email beeing processed by Google as a email hosting? I haven't made all configurations described in: mailserver for google apps email

Thank you.

  • What do you want to happen? Your question isn't very clear. – Mikel Feb 6 '11 at 9:02
  • The problem is that my question is so basic that it's hard even to people understand it :-) I didn't know that a MTA (in my case Postfix) works like a telephone to make calls despite the fact that Google Apps is beeing used to receive the calls to my number and also make calls. – Roger Feb 6 '11 at 10:21
  • Could you at least try to reword it now to make sense? – random Mar 17 '11 at 14:05

This is normal behaviour. Mail traditionally worked like this:

  • If you want to send a mail to any address, your computer looks up the MX entry for the recipient's domain and send it to this server directly via SMTP. This is regardless of the sender's domain, so you could send mail for any sender address.
  • The receiving server handles it and makes it available to the recipient in some way (via file system, POP, IMAP etc.).

So, as you see, it's perfectly normal that your server can send mail directly. However, doing this is not a very good idea today. Because of the massive amounts of spam etc. this once open system got restricted quite a bit.

  • Today, servers check from where a mail comes. If you are on a dialup address, many mail servers won't talk to you at all, or classify your mail as spam and throw it away. This is the reason you have to configure your providers SMTP server in your mail client: This one identifies you with username and password and accepts your mails and handles them normally.
  • If you are on a server IP address, receiving MX servers will try to decide if you are supposed to send mail for the FROM address you try to drop off. For this they do all kind of checks like including checking the MX, SPF and DKIM records for the domain if available.

Depending on how your domain is configured, many receiving mail servers might decide that your server is not allowed to send mails for your domain and disregard it. To prevent this you have to do one of the following:

  • Send mail with the Google Apps mail server as relay. For this you have to configure your local mail system (Postfix?) to use this relay.
  • Configure your DNS domains with at least SPF records that includes either all servers or Googles and your own and configure your local postfix as good as possible (you will find many questions about how to do this on SF).

You can send email from any server with an MTA, no matter what server is receiving mail for you. Think of it like being able to call people from any phone, even if people calling you will only reach the number you gave them.

What's the unexpected behavior you're seeing? Or maybe more useful, what behavior do you expect that you're not seeing?

  • I didn't know that a MTA (in my case Postfix) works like a telephone to make calls despite the fact that Google Apps is beeing used to receive the calls to my number and also make calls. My real problem is that I need to process some emails forwarded from Google in Postfix to pipe them to a PHP script. I read that to accomplish this I need to set up a subdomain in Postfix. But the fact is that I don't know how to do this :-) – Roger Feb 6 '11 at 10:19
  • If your Linux machine is reachable on the Internet, you can have Google forward the mail to it. If it's behind a NAT somewhere, or even if not, you could use fetchmail or getmail to pull down mail from a given account with IMAP or POP3. – Robert Novak Feb 7 '11 at 3:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.