Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 =    
share|improve this question
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'. – Michael Kjörling 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
up vote 0 down vote accepted

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:


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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