Postfix SMTP Server fails to send messages to anyone outside the domain

skv asked:

Here is the result of a recent test on my SMTP server, I just want this server to send emails which used to work perfectly upto about a week ago

Resolving hostname...
Connecting...
SMTP -> FROM SERVER:
220 mail.testinstall.com ESMTP Postfix
SMTP -> FROM SERVER: 
250-mail.testinstall.com
250-PIPELINING
250-SIZE 10240000
250-ETRN
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL FROM: test@testinstall.com
SMTP -> FROM SERVER:
250 2.1.0 Ok
RCPT TO: skvignesh@gmail.com
SMTP -> FROM SERVER:
454 4.7.1 : Relay access denied
SMTP -> ERROR: RCPT not accepted from server: 454 4.7.1 : Relay access denied

Message sending failed.

Server Details

CentOS     : 6.4
PostFix mail_version = 2.6.6
zpanel is the control panel software used

The main.cf file of postfile has been reproduced at http://pastebin.com/jqJMv1TM

The mails from the server on any of the domains are not working so I am sure this isnt a domain specific issue and something to do with the server. I have also tried public tests, sending email with php and also using the webmail that comes with zpanel and all of them fail for any mails outside the domain.

I have tried to find multiple resolutions provided in threads like this (Postfix: Relay Access Denied when sending mail from outside the network) and most of them relate to other configurations in an external software. We only have apache, zpanel, php, mysql (mysql Ver 14.14 Distrib 5.1.69, for redhat-linux-gnu (x86_64) using readline 5.1) and postfix installed on this server no other software that in my knowledge affects the behaviour of this. We recently had a domain name change (the primary domain) and this issue seems to have been happening from then.

Maillog does not report anything that looks significant to this issue and reports the following, but keeps growing at a tremendous speed, which I believe is a separate issue

Sep 22 18:19:12 IS-21075 postfix/qmgr[23793]: 5F4943226F9: from=<>, size=3539, nrcpt=1 (queue active)
Sep 22 18:19:13 IS-21075 postfix/qmgr[23793]: 5F4943226F9: to=<lisa_roy@mydomainname.com>, relay=none, delay=263738, delays=263738/0.05/0/0, dsn=4.3.5, status=deferred (delivery temporarily suspended: mail for testinstall.com loops back to myself)
Sep 22 18:19:13 IS-21075 postfix/qmgr[23793]: 52B9733CC4F: from=<delia_ferrell@mydomainname.com>, size=843, nrcpt=1 (queue active)
Sep 22 18:19:13 IS-21075 postfix/qmgr[23793]: 52B9733CC4F: to=<dsforsythe1975@comcast.net>, relay=none, delay=397370, delays=397370/0.12/0/0, dsn=4.3.5, status=deferred (delivery temporarily suspended: mail for testinstall.com loops back to myself)
Sep 22 18:19:13 IS-21075 postfix/qmgr[23793]: 5C66E8B0FE0: from=<louella_schneider@mydomainname.com>, size=844, nrcpt=1 (queue active)
Sep 22 18:19:13 IS-21075 postfix/qmgr[23793]: 5C66E8B0FE0: to=<erdalivvv@hotmail.com>, relay=none, delay=57108, delays=57108/0.03/0/0, dsn=4.3.5, status=deferred (delivery temporarily suspended: mail for testinstall.com loops back to myself)
Sep 22 18:19:13 IS-21075 postfix/qmgr[23793]: 536E87C1B6E: from=<>, size=2903, nrcpt=1 (queue active)
Sep 22 18:19:13 IS-21075 postfix/qmgr[23793]: 536E87C1B6E: to=<sylvia_ortega@mydomainname.com>, relay=none, delay=63290, delays=63290/0.03/0/0, dsn=4.3.5, status=deferred (delivery temporarily suspended: mail for testinstall.com loops back to myself)
  • Note – While mydomainname.com has been changed, testinstall.com is an actual domain name that we use.

I have completely made main.cf empty and still the error persists but with a different error code

Resolving hostname...
Connecting...
SMTP -> FROM SERVER:
220 IS-21075.localdomain ESMTP Postfix
SMTP -> FROM SERVER: 
250-IS-21075.localdomain
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL FROM: test@testinstall.com
SMTP -> FROM SERVER:
250 2.1.0 Ok
RCPT TO: skvignesh@gmail.com
SMTP -> FROM SERVER:
554 5.7.1 : Relay access denied
SMTP -> ERROR: RCPT not accepted from server: 554 5.7.1 : Relay access denied

Message sending failed.

My answer:


Your mynetworks directive is not valid. This setting controls which IP address ranges Postfix will allow relaying from. It should consist only of your internal servers and networks.

It reads:

mynetworks = all,localhost

This is obviously not a list of IP addresses or CIDR ranges.

Change it to reflect the actual addresses of the servers/networks which should be allowed to relay through this Postfix. For example:

mynetworks = 127.0.0.1 [::1] 10.118.87.0/24

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.