Solved

Global recipient blacklist in postfix

Posted on 2011-03-23
1
1,008 Views
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
0
Comment
Question by:verivox
1 Comment
 
LVL 8

Accepted Solution

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

check_recipient_access hash:$mapsdir/recipient_blacklist,

Example:
 
smtpd_recipient_restrictions =
        reject_unknown_recipient_domain,
        permit_mynetworks,
        permit_sasl_authenticated,
        check_recipient_access hash:$mapsdir/recipient_whitelist,
        check_recipient_access hash:$mapsdir/recipient_blacklist, 
        reject_unauth_destination,
        reject_non_fqdn_recipient,
        reject_non_fqdn_sender,
        reject_unlisted_recipient,
        reject_unverified_recipient,
        permit

Open in new window


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


2. Create file "recipient_blacklist"

Example:
 
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.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Utilizing an array to gracefully append to a list of EmailAddresses
This is my first article on Expert Exchange on the Manual Method of Exporting Office 365 Mailboxes to PST format by using the eDiscovery mechanism of Office. Hope you will enjoy the article.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

911 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now