Allow postfix (PHP send email) to work with extenal MX Record.

Today I will show you how to configure Postfix (PHP mail) to work with domain having extenal MX records. E.g. Suppose you are working on website, Now you have configured Google MX records on domain.
Now if you will use PHP mail function to send any email to [email protected], Will not work. To allow PHP mail function to work with domain having extenal MX records, we will have to configure postfix.

Postifx disable local delivery or Configure Postfix to use external MX servers for delivery of local mail if user is unknown

To achive this, We will need to edit postfix configuration file. i.e. In most of the servers it exists in /etc/postfix/

Open this file in vim or nano editor. e.g.

nano /etc/postfix/

Now find the line contain “my_destination”. You will have to remove domain name from “my_destination” values like below i have “”.


Now restart the postfix using following command.

/etc/init.d/postfix restart


service postfix restart

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Skip to toolbar