Error with postfix and sending emails

March 14, 2015 1.7k views
Email DNS

Hello everybody,

I have a domain where I set the DNS to point to the A record for the IP of my VPS and the record MX point to another server.
What happens is that I installed postfix to send mail through PHP, but when I send a message to an email from this domain it will not for the server that is configured in the DNS MX record.
If I place the domain in the settings of mydestination in the postfix config file, email is going to /var/mail, if I take away the domain of settings file it just does not do anything.

Someone can help me?

1 Answer

Try to use “relayhost” directive in
If the IP of the mail server configured in MX is, then then it should look like this

relayhost =

On the mail server you have to allow relay from the source server, this is done through “mynetworks” directive
Just find the configuration directive and add your source IP, so if the source IP is, then

mynetworks =

change to

mynetworks =

There might be more entries on that line already, so just add it at the end of line
Restart postfix on both servers and it should work

Have another answer? Share your knowledge.