Solved

Global recipient blacklist in postfix

Posted on 2011-03-23
1
1,014 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
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 …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

776 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