Global recipient blacklist in postfix

Posted on 2011-03-23
Last Modified: 2012-05-11
We are using postfix as an outbound-only mail relay, primarily to send newsletters and registration confirmations to our customers.

We would like to implement a company-wide recipient blacklist, not just at the application level, but also at the postfix level, as a final catch for legacy applications that might be sending mails that we don't know about.

Is there some way of giving postfix a global list of external recipients, to whom no emails should ever be sent?

Many thanks
Jon Little
Verivox GmbH
Question by:verivox
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment

Accepted Solution

pilson66 earned 125 total points
ID: 35197385
1. In postfix config, in section "smtpd_recipient_restrictions", add:

check_recipient_access hash:$mapsdir/recipient_blacklist,

smtpd_recipient_restrictions =
        check_recipient_access hash:$mapsdir/recipient_whitelist,
        check_recipient_access hash:$mapsdir/recipient_blacklist, 

Open in new window

NOTE: in my example, $mapsdir = /etc/postfix/maps/

2. Create file "recipient_blacklist"

toall@                  REJECT
developers@             REJECT
devs@                   REJECT
testers@                REJECT

Open in new window

3. in root console, enter:
cd /etc/postfix/maps/
postmap recipient_blacklist

Open in new window

4. Done.

Featured Post

How To Install Bash on Windows 10

Windows’ budding partnership with Canonical has certainly led to some great improvements. One of them being the ability to use Bash on your Windows machine without third party applications! This might be one of the greatest things a cloud engineer in a Windows environment can do!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pop culture is prime bait for hackers seeking to infect user’s computers and mobile devices with malicious malware. Hackers know exactly what the latest trends are online and know how to use them to their advantage.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
This Micro Tutorial demonstrates  how Internet marketers work with competitive analysis data, and a common task in data preparation is creating separate column for domains. You will then extract from a list of URLs.
Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question