How to fix 'Relay Access Denied'
I think the problem is here
#mynetworks = 168.100.189.0/28, 127.0.0.0/8
Try to add and network 192.168.178.0/24 and del #
mynetworks = 127.0.0.0/8, 192.168.178.0/24
Related videos on Youtube
maddo7
Updated on September 18, 2022Comments
-
maddo7 almost 2 years
I'm trying to setup postfix as MTA on a AWS EC2 instance. I want to use this as mailserver for my domains and want to use it along with Outlook/Thunderbird.
I've never setup postfix before, therefore I used this great guide here:
http://flurdy.com/docs/postfix/
Now I can connect to the server via STARTTLS to mail.mydomain.com and send emails to my own email account [email protected] via Thunderbird.
However when I try to send an email to an external domain [email protected] I get an error
Relay access denied.
The logs show:
May 31 14:55:58 ip-172-31-23-97 postfix/smtpd[13500]: NOQUEUE: reject: RCPT from myhostname[97.192.4.67]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<[192.168.178.64]>
My postfix config:
I know there are many pages out there that address this issue.
Mainly the issue can be fixed by
adjusting mynetworks
,smtpd_recipient_restrictions
orsmtpd_relay_restrictions
but none of the changes fixed my issue.What can I do to resolve this?
-
maddo7 about 8 yearsAre you sure? I don't have sasl installed on the machine and
smtp_sasl_auth_enable
is only used for the smtp connection for amazon's ses smtp server. -
maddo7 about 8 yearsUnfortunately after uncommenting the line and adding your suggestion I'm still getting the error
-
stambata about 8 yearsIs this your LAN 192.168.178.0/24?
-
maddo7 about 8 yearsEdit: Yes, that's the LAN IP of my windows PC from where I try to connect. How can the LAN IP be related to this?
-
maddo7 about 8 yearsWhen I insert the internet IP address of my connection to that value, it sends the email without problems:
mynetworks = 168.100.189.0/28, 127.0.0.0/8, 192.168.178.0/24, 172.31.23.0/24, xxx.193.4.67
but I don't want to manually insert the IP addresses of all clients I want to use to connect. -
stambata about 8 yearsThis is another issue :). and your solution is SASL postfix.org/SASL_README.html