Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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'm configuring a SMTP server based on Postfix with PostgreSQL. When I try to send a mail to another domain I got a Recipient address rejected: Access denied error.

Here is my configuration :

# postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
local_recipient_maps = 
mailbox_size_limit = 0
mydestination =, localhost, localhost.localdomain, localhost
myhostname =
mynetworks = [::ffff:]/104 [::1]/128
readme_directory = no
recipient_delimiter = +
relayhost =
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, reject
virtual_alias_maps = pgsql:/etc/postfix/pgsql.d/
virtual_gid_maps = static:108
virtual_mailbox_base = /var/spool/postfix/incoming
virtual_mailbox_domains = pgsql:/etc/postfix/pgsql.d/
virtual_mailbox_limit = 51200000
virtual_mailbox_maps = pgsql:/etc/postfix/pgsql.d/
virtual_transport = virtual
virtual_uid_maps = static:105

Here, is the domain name of the server, and is the domain name of the relay host.

Here is the complete error :

Oct 15 10:22:08 authentification postfix/smtpd[9930]: connect from unknown[]
Oct 15 10:22:08 authentification postfix/smtpd[9930]: NOQUEUE: reject: RCPT from unknown[]: 554 5.7.1 <>: Recipient address rejected: Access denied; from=<> to=<> proto=ESMTP helo=<localhost>
Oct 15 10:22:08 authentification postfix/smtpd[9930]: lost connection after RSET from unknown[]
Oct 15 10:22:08 authentification postfix/smtpd[9930]: disconnect from unknown[]
share|improve this question
up vote 1 down vote accepted

If I'm not misunderstanding your question, you want to send mail through If is the same box, relayhost = should not be set (as this is already the relay host).

From the postfix documentation

By default, the Postfix SMTP server accepts:

  Mail from clients whose IP address matches $mynetworks, or
  Mail to remote destinations that match $relay_domains, except for addresses
   that contain sender-specified routing (user@elsewhere@domain), or
  Mail to local destinations that match $inet_interfaces or $proxy_interfaces,
    $mydestination, $virtual_alias_domains, or $virtual_mailbox_domains.

You should specify the network (or whatever bit mask) to be part of $mynetworks, or, specifically put it into smtpd_relay_restrictions:

smtpd_relay_restrictions = $mynetworks,
share|improve this answer
Thanks, the problem was solved by adding to $mynetworks – linkdd Oct 15 '12 at 12:38
smtpd_relay_restrictions is new to postfix 2.10, which is still under development. Apart from that, this setting does not accept lists of hosts or IP ranges - it accepts only restrictions. You may be thinking of relay_domains, or something else. – adaptr Oct 15 '12 at 15:15
@adaptr: you are mistaken. If you do not specify smtpd_relay_restrictions it defaults to $mynetworks, reject. You just have to try it to be sure ;). relay_domains only suits you for relaying mail for specific domains. – Torian Oct 15 '12 at 19:37
$mynetworks is not a valid restriction. – adaptr Oct 16 '12 at 10:44

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.