1

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 admin@mydomain.com via Thunderbird.

However when I try to send an email to an external domain myemail@gmail.com 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 <myemail@gmail.com>: Relay access denied; from=<admin@mydomain.com> to=<myemail@gmail.com> 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?

3

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
5
  • Unfortunately after uncommenting the line and adding your suggestion I'm still getting the error – maddo7 May 31 '16 at 17:37
  • Is this your LAN 192.168.178.0/24? – stambata May 31 '16 at 17:45
  • 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 May 31 '16 at 18:25
  • 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. – maddo7 May 31 '16 at 18:29
  • This is another issue :). and your solution is SASL postfix.org/SASL_README.html – stambata May 31 '16 at 20:08
0

smtpd_sasl_auth_enable = yes is required. (not smtp_sasl_auth_enable)

Perhaps, it may be necessary to change the order of smtpd_recipient_restrictions.

smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, (other reject rules)

1
  • 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 May 31 '16 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.