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. [email protected], 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 =    
  • 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'.
    – user
    Commented Jul 22, 2013 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. Commented Jul 22, 2013 at 14:42

2 Answers 2


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:


  • Would you please incorporate the relevant commands so that this Answer is self-contained, in case the link ever rots? I realize this answer is nearly 10 years old, but it's been flagged as "not an answer" because it's essentially link-only. Thank you!
    – Jeff Schaller
    Commented Mar 30, 2022 at 20:12

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 =, [::1]/128

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .