Why does Postfix deliver mails locally instead of relaying them to Google Apps?
Here's the situation:
I have a domain, let's say domain.com. That domain has Google Apps for Business enabled, so all mail delivered to @domain.com will end up at Google (MX records point to Google).
I have a PHP script at domain.com that I use to send mail to myself. But when the PHP script tries to send mail to firstname.lastname@example.org, Postfix at that server decides that the recipient is a local user (because the address matches the domain Postfix itself is at), and tries to deliver the mail locally. But inevitably fails as the mailbox cannot be found.
How can I instruct Postfix to not try to handle locally any emails to @domain.com and just send them forward so Google can pick them up?
I have already removed
$myhostname from mydestination field in Postfix's main.cf file, and I have restarted Postfix but Postfix still tries to deliver the mail locally. Here's a snip from mail.log that show the problem (addresses replaced):
postfix/pickup: AF718422E5: uid=33 from=<server> postfix/cleanup: AF718422E5: message-id=<62e706bcca5a0de0bfec6baa576d88a5@server> postfix/qmgr: AF718422E5: from=<server>, size=517, nrcpt=1 (queue active) postfix/pipe: AF718422E5: to=<email@example.com>, relay=dovecot, delay=0.62, delays=0.47/0.03/0/0.13, dsn=5.1.1, status=bounced (user unknown) postfix/bounce: AF718422E5: sender non-delivery notification: 29598422E7 postfix/qmgr: AF718422E5: removed