Postfix submitting email not in Recipients List

  • I'm running v2 Postfix on 2.1.5 i386 and I've noticed that email for users not in the Recipients List on the PF Recipients tab are still being forwarded to the iRedMail server and are being refused by it. This puts info into the 550 5.1.1 rejection that I'd like to keep hidden. Is this expected behaviour or did I miss a setting?


  • A bit of an update. PF is not actually sending the email as previously stated. What it is doing is verifying the creds against the email server instead of rejecting them outright when the user is not in the Recipients list. I have another pfSense/Postfix box that is doing it correctly so I'll compare the settings between the two to see what's different.

    Helpful pointers still appreciated.


  • Probably "basic" versus "strong" selected in Header verification under the Anti-spam tab.

    Strong inserts reject_unverified_recipient under smtp_recipient_restrictions

  • Thanx for reply. I checked and Strong is selected. Below is a sanitized telnet 25 session with the PF server showing the response to a nonexistant user is coming from the internal mail server. This may be correct but I seem to remember that the internal email server was not contacted until after all of the checks were made. Is my memory incorrect?

    garthk@myws:~$ telnet 25
    Connected to
    Escape character is '^]'.
    220 ESMTP Postfix
    mail from: garthk@abc.com250 2.1.0 Ok
    rcpt to: joe@abc.net550 5.1.1 Recipient address rejected: undeliverable address: host[] said: 550 5.1.1 Recipient address rejected: User unknown in virtual mailbox table (in reply to RCPT TO command)
    221 2.0.0 Bye
    Connection closed by foreign host.

    Below is a section from a backup showing the settings for PF:

    <package><name>Postfix Forwarder</name>
    <descr>It can do first and second line antispam combat before sending incoming mail to local mail servers.<br />
    Postfix can also detect zombies, check RBLS, SPF, seach ldap for valid recipients and use third part antispam engines like policyd and mailscanner for better antispam solution.]]></descr>
    <version>2.10.2 pkg v.2.3.9</version>

    <dhcrelay><dhcrelay6>Let me know if I missed something.


  • Your files would be more interesting to compare.

    Reading this:

    . . . recipient address verification is useful to block mail for undeliverable recipients on a mail relay host that does not have a list of all valid recipient addresses

    I don't understand why your mail server is being queried at all.

  • Here is the I've searched on the suspicious entries but have found nothing that looks wrong.


    #Part of the Postfix package for pfSense
    #Copyright (C) 2010 Erik Fonnesbeck
    #Copyright (C) 2011-2013 Marcello Coutinho
    #All rights reserved.

    mynetworks = /usr/pbi/postfix-i386/etc/postfix/mynetwork_table
    mynetworks_style = host
    access_map_reject_code= 554
    access_map_defer_code = 451
    unverified_recipient_reject_code = 550
    unknown_client_reject_code = 550
    unknown_hostname_reject_code = 550

    relay_domains =
    transport_maps = hash:/usr/pbi/postfix-i386/etc/postfix/transport
    local_recipient_maps =
    relay_recipient_maps = hash:/usr/pbi/postfix-i386/etc/postfix/relay_recipients
    mydestination =
    mynetworks_style = host
    message_size_limit = 10240000
    default_process_limit = 100
    disable_vrfy_command = yes
    strict_rfc821_envelopes = yes

    #Just reject after helo,sender,client,recipient tests
    smtpd_delay_reject = yes

    Don't talk to mail systems that don't know their own hostname.

    smtpd_helo_required = yes
    smtpd_helo_restrictions = check_helo_access pcre:/usr/pbi/postfix-i386/etc/postfix/helo_check,

    smtpd_sender_restrictions = reject_non_fqdn_sender,

    Allow connections from specified local clients and strong check everybody else.

    smtpd_client_restrictions = permit_mynetworks,
    check_client_access pcre:/usr/pbi/postfix-i386/etc/postfix/cal_pcre,
    check_client_access cidr:/usr/pbi/postfix-i386/etc/postfix/cal_cidr,

    smtpd_recipient_restrictions = permit_mynetworks,
    check_client_access pcre:/usr/pbi/postfix-i386/etc/postfix/cal_pcre,
    check_client_access cidr:/usr/pbi/postfix-i386/etc/postfix/cal_cidr,
    check_sender_access hash:/usr/pbi/postfix-i386/etc/postfix/sender_access,

    inet_protocols = ipv4
    inet_interfaces =,
    postscreen_greet_wait = ${stress?2}${stress:6}s
    postscreen_disable_vrfy_command = yes
    postscreen_non_smtp_command_enable = yes
    postscreen_non_smtp_command_action = enforce
    postscreen_pipelining_enable = yes
    postscreen_pipelining_action = enforce
    postscreen_bare_newline_enable = yes
    postscreen_bare_newline_action = enforce
    postscreen_greet_action = enforce
    postscreen_access_list = permit_mynetworks,
    postscreen_dnsbl_action= enforce
    postscreen_blacklist_action= enforce

  • That looks pretty much the same as mine.  I don't use a valid recipients list, though, so postfix always queries the mail server if it hasn't got a cached positive or negative response from there before.  Those cached entries do expire after a time.

    Is this the config for the one that's querying your mail server?  Maybe your other server is just not receiving many emails for address responses that aren't cached.

    Unfortunately, from what I've read, I don't think there is any way to stop the queries completely but they should be relatively rare, unless you are seeing lots of spammers who get past the usual postscreen checks.

    I suspect that reject_unverified_recipient should be reject_unlisted_recipient in

  • I did a little experiment:

    Built a table of valid recipients from my mail server.

    Replaced reject_unverified_recipient with reject_unlisted_recipient in and reloaded postfix

    I get the error (which is to be expected because I didn't rebuild relay_recipients.db):

    warning: database /usr/pbi/postfix-amd64/etc/postfix/relay_recipients.db is older than source file /usr/pbi/postfix-amd64/etc/postfix/relay_recipients

    However, I don't get the double-bounce query to the mail server with this configuration.

    So it looks as though, when you have a valid recipients list, reject_unlisted_recipient should be in, rather than reject_unverified_recipient.

  • Good work and I agree. I changed from unverified to unlisted in and the unknown user is rejected immediately by pfSense/Postfix rather than asking the email server to verify. Much better.

    Now, how long will the change remain in place before the gets regenerated? There is a cap warning about not editing near the top of the file. Should this be reported as a bug?


  • I'm hoping marcelloc will notice this thread.

    Not that I think it's a really a bug.  There are so many config options in postfix that I'm not surprised he would have had to make some tough choices about how to manage certain things through the GUI.

    I suspect any save through the GUI or reinstall of the package would wipe out the change.

Log in to reply