How to fix 'Relay Access Denied'

6,013

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
Share:
6,013

Related videos on Youtube

maddo7
Author by

maddo7

Updated on September 18, 2022

Comments

  • maddo7
    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:

    http://pastebin.com/0jytH4Yi

    I know there are many pages out there that address this issue.

    Mainly the issue can be fixed by adjusting mynetworks, smtpd_recipient_restrictions or smtpd_relay_restrictions but none of the changes fixed my issue.

    What can I do to resolve this?

  • maddo7
    maddo7 about 8 years
    Are 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
    maddo7 about 8 years
    Unfortunately after uncommenting the line and adding your suggestion I'm still getting the error
  • stambata
    stambata about 8 years
    Is this your LAN 192.168.178.0/24?
  • maddo7
    maddo7 about 8 years
    Edit: 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
    maddo7 about 8 years
    When 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
    stambata about 8 years
    This is another issue :). and your solution is SASL postfix.org/SASL_README.html