I am trying to setup a mail relay running Postfix in the DMZ to forward all incoming mail to the internal LAN connected mail server.

I would like to be able to refuse incoming mail for non-existent users right at the gateway, which I assume is the best option.

The problem is, Postfix still accepts mail even for users not included in the users table.

My config:

append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
local_recipient_maps =
local_transport = error:local delivery disabled
mydomain = ***
myhostname = merlin.***
mynetworks =
myorigin = /etc/mailname
parent_domain_matches_subdomains = debug_peer_list smtpd_access_maps
relay_domains = $transport_maps
relay_recipient_maps = mysql:/etc/postfix/mysql-relay_recipient_maps.cf
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
transport_maps = hash:/etc/postfix/transport_maps

I have thorougly checked that the relay_recipient_maps work (using postmap -q). I am trying to send mail to noone@*** with swaks from:

  • The local machine (the mailserver itself)
  • A host in the 10.7.11.x network

Both attempts succeed (Postfix relays the mail).

What's wrong?


The log says (the "connection refused" error is irrelevant; the fact that Postfix relays for noone@*** is the problem):

Aug  3 13:20:44 merlin postfix/smtp[10166]: CE7E2C6E: to=<noone@***>, relay=none, delay=1642, delays=1642/0.01/0/0, dsn=4.4.1, status=deferred (connect to xaver.***[]:25: Connection refused)
Aug  3 13:20:44 merlin postfix/smtp[10171]: connect to xaver.***[]:25: Connection refused
  • Postfix accept the email because you 'have' permit_mynetworks in your configuration
    – masegaloeh
    Aug 3, 2015 at 12:24
  • Thanks for reply; but after realizing my error and posting the answer below, everything works.
    – David
    Aug 3, 2015 at 12:28

1 Answer 1


After hours and reading that the lookup result is discarded for a minimum of eight times, I finally realized, that the stored funciton I use to check the existence of a user returns 0 when no matching entry is found. And that means to Postfix, well, that the user was found.

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.