Solved

Global recipient blacklist in postfix

Posted on 2011-03-23
1
1,035 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
[X]
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
 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Fine Tune your automatic Updates for Ubuntu / Debian
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
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.

738 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