Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 03-30-2016, 03:31 PM   #1
LQ Newbie
Registered: Mar 2016
Posts: 2

Rep: Reputation: Disabled
Postfix Blacklist Not Working...Sort Of.

I'm running a standard Postfix/Dovecot setup for email. I've got a few email addresses that I get junk from that I want to block (mailing-lists that refuse to remove me from their lists.) So I added check_sender_access hash:/etc/postfix/sender_access to my smtpd_sender_restrictions line in my /etc/postfix/ file. It is the first rule check in that line. I created a sender_access file in the postfix directory, added the email addresses I wanted to block ( REJECT), and created the sender_access.db file by using postmap sender_access. Restarted postfix.

Emails from these addresses are getting through. So I decided to check it using an email address that I use for graduate school. I added this email and REJECT to the sender_access file, postmap'd it, and restarted postfix. Sent an email from the school account and it gets blocked properly. Huh? Postfix is blocking my school account but not the other email addresses that I put in to the sender_access file. So I figure it must be some sort of issue with the "from" or "reply-to" addresses. Here is a partial header from an email from an address I want to block (with info changed to protect the "innocent"):

(I have added the line REJECT to my sender_access file based on the "from" info in the header)

Return-Path: <>
Received: from ( [])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits))
(Client CN "*", Issuer "MSIT Machine Auth CA 2" (verified OK))
by (Postfix) with ESMTPS id A009A2D0063C
for <>; Tue, 29 Mar 2016 09:15:08 -0400 (EDT)
Received: from ([]) by over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008);
Tue, 29 Mar 2016 06:15:01 -0700
Received: from
( by
( with Microsoft SMTP Server (TLS) id 15.1.453.6; Tue, 29 Mar
2016 13:15:00 +0000
Received: from ( by ( with Microsoft SMTP
Server (TLS) id 15.1.453.6 via Frontend Transport; Tue, 29 Mar 2016 13:13:30
Received: from ([]) by ([]) with mapi id
15.01.0447.023; Tue, 29 Mar 2016 13:13:26 +0000
From: joe blow <>
Subject: I'm Going To Keep Emailing You Forever
Thread-Topic: I'm Going To Keep Emailing You Forever
Thread-Index: AQHRibwsrq6KCOGy9kGIeGxl0HQDhZ9wZRLe
Date: Tue, 29 Mar 2016 13:13:26 +0000
Message-ID: <>
References: <>
In-Reply-To: <>
Accept-Language: en-US
Content-Language: en-US


Email is still accepted from the address. Why it blocks properly when coming from my school address while still accepting email from the bad addresses is anyone's guess.

Anyone have any ideas? I thought it may have to do with the From or Reply-To fields in the header, but they seem to match what is in the check_sender file.

Old 03-31-2016, 08:17 AM   #2
Senior Member
Registered: Mar 2012
Posts: 1,641

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Is it being accepted prior to hitting your sender_access check?
Old 03-31-2016, 01:23 PM   #3
LQ Newbie
Registered: Mar 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
The sender_access directive is first in the smtpd_sender_restrictions list. Here is the line in my file.

smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/sender_access, reject_unknown_sender_domain, reject_sender_login_mismatch

Remember, it does block my own address when I add it to the sender_access file but none of the other addresses in the list. So I know that the sender_access check is working but am stumped as to why it does not work for the other addresses in the list.

Thanks for the reply,


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix outgoing email blacklist Yaniv-Fer Linux - Server 7 05-22-2012 08:41 AM
How To Blacklist a Spammer in Postfix carlosinfl Linux - Server 4 01-22-2010 03:00 PM
Postfix blacklist crxssi Linux - Server 7 09-23-2009 03:34 PM
Blacklist Postfix andybrr Linux - Server 1 04-24-2009 07:39 AM
how to Blacklist specific email in postfix nhansense Linux - Server 19 08-22-2008 04:00 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:26 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration