I needed to configure a Postfix in a Debian 6 (Squeeze) this dawn and off course it didn’t went 100% fine…
After configuring a DNS server with Bind, I installed Postfix with MySQL authentication using the instructions (in portuguese) below:
Using Telnet, I managed to receive and send emails without problems… Great huh? But I went to other server, where this mail server would be used.
* PAM * (for those who used Windows 98 hehehe)
I was getting RELAY ACCESS DENIED error
After a lot of research and examples from my friend Google, I understood that, for default, Postfix doesn’t allow to send mails outside the server, because spammers would not be able to use the server for their evil stuff, putting the server on black lists and so on.
But how do we allow another server use Postfix for sending emails? The solution that I’ll write here can possibly not be the best one. I must remember you that I’m not a mail and name server specialist.
I opened the /etc/postfix/main.cf file and at the line mynetworks = 127.0.0.0/8 I added the valid IP that responds for the domain that was trying to use the mail server. Also added the valid IP of the domain’s HOST, turning the line into mynetworks = 127.0.0.0/8, 18.104.22.168, 22.214.171.124 (examples).
Then I restarted Postfix and everything was solved… sent emails using the other server.