How to configure relay in Postfix.
To configure relay, change the following parameters.
Let IP of this server be . yy.yy.yy.yy
[root@PP12 ~]# postconf -n | grep -i relayhost
relayhost = xx.xx.xx.xx ========> IP to be relayed.
[root@PP12 ~]#
Default will be :
[root@PP12 ~]# postconf -d | grep -w 'relayhost ='
relayhost =
[root@PP12 ~]#
Let the IP of relayed server be xx.xx.xx.xx
[root@PP12 ~]# postconf -n | grep -i mynetworks
mynetworks = 127.0.0.0/8, [::1]/128, hash:/var/spool/postfix/plesk-pop/poplock, yy.yy.yy.0/24 ========> IP from which relay to be accepted.
[root@PP12 ~]#
Default will be :
[root@PP12 ~]# postconf -d | grep -w 'mynetworks ='
mynetworks = 127.0.0.0/8 127.0.0.1/32 xx.xx.xx.0/22
[root@PP12 ~]#
if this(mynetworks) is not configured, relaying will be denied and will get the error as:
Aug 16 13:05:35 PP12 postfix/smtp[21125]: 8DDBA84CB1: to=<[email protected]>, relay=xx.xx.xx.xx[xx.xx.xx.xx]:25, delay=0.22, delays=0.11/0.01/0.03/0.07, dsn=5.7.1, status=bounced (host xx.xx.xx.xx[xx.xx.xx.xx] said: 554 5.7.1 <[email protected]>: Relay access denied (in reply to RCPT TO command))
To configure relay, change the following parameters.
Let IP of this server be . yy.yy.yy.yy
[root@PP12 ~]# postconf -n | grep -i relayhost
relayhost = xx.xx.xx.xx ========> IP to be relayed.
[root@PP12 ~]#
Default will be :
[root@PP12 ~]# postconf -d | grep -w 'relayhost ='
relayhost =
[root@PP12 ~]#
Let the IP of relayed server be xx.xx.xx.xx
[root@PP12 ~]# postconf -n | grep -i mynetworks
mynetworks = 127.0.0.0/8, [::1]/128, hash:/var/spool/postfix/plesk-pop/poplock, yy.yy.yy.0/24 ========> IP from which relay to be accepted.
[root@PP12 ~]#
Default will be :
[root@PP12 ~]# postconf -d | grep -w 'mynetworks ='
mynetworks = 127.0.0.0/8 127.0.0.1/32 xx.xx.xx.0/22
[root@PP12 ~]#
if this(mynetworks) is not configured, relaying will be denied and will get the error as:
Aug 16 13:05:35 PP12 postfix/smtp[21125]: 8DDBA84CB1: to=<[email protected]>, relay=xx.xx.xx.xx[xx.xx.xx.xx]:25, delay=0.22, delays=0.11/0.01/0.03/0.07, dsn=5.7.1, status=bounced (host xx.xx.xx.xx[xx.xx.xx.xx] said: 554 5.7.1 <[email protected]>: Relay access denied (in reply to RCPT TO command))