1

I have setup Postfix and Dovecot on my CentOS Server.

Now I am using unsecure SMTP and POP/IMAP (ports 25 and 110/143). I can send mail locally to and from myself, but when I want to send email TO my gmail account, eg. david@gmail.com, it responds:

Relay access denied

I tried the following, but it still gives me an access deny issue. Made the following changes to /etc/postfix/main.cf:

smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = cyrus
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions =    
permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
  • Is that main.cf snippet literal as shown? Because if so, you are setting smtpd_recipient_restrictions empty (not sure how Postfix feels about that) and then have a syntax error on the next line. Look at and possibly post the output of postconf -d | grep -E 'smtpd_[^_]+_restrictions'. – a CVn Jul 22 '13 at 11:29
  • You have to authenticate with user and password to send emails outside your domain. Or you could have your computer ip included in mynetworks in main.cf but this would be very unsecure. – Laurentiu Roescu Jul 22 '13 at 14:42
0

Follow this tutorial - It is very good and it helped me getting rid of the relay access error.

I am now able to send mail to any address:

http://centoshelp.org/servers/mail/postfix-mail-server-on-centos/

0

Have a look that sometimes in my case for example (Centos 8 + postfix-2:3.3.1-8.el8.x86_64) I have received this error message: postfix/smtpd .... NOQUEUE: reject: RCPT from ... [::1]: 554 5.7.1 ... Relay access denied;

The issue is [::1] (ipv6)

I have solved this problem with this specific configuration into the mail.cf: inet_protocols = all # In order to enable ipv4 and ipv6 support ... mynetworks_style = host ... mynetworks = 127.0.0.0/8, [::1]/128

In this manner all kind of issue was resolved. Hope that this is usefule also in your situation.

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.