LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-30-2016, 02:31 PM   #1
scoobybri
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/main.cf 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 (blah@spam.com 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 idiot@live.com REJECT to my sender_access file based on the "from" info in the header)

Return-Path: <idiot@live.com>
Delivered-To: me@myemail.com
Received: from BAY004-OMC4S6.hotmail.com (bay004-omc4s6.hotmail.com [65.54.190.208])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits))
(Client CN "*.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK))
by mail.myemail.com (Postfix) with ESMTPS id A009A2D0063C
for <mailbox@sallerson.com>; Tue, 29 Mar 2016 09:15:08 -0400 (EDT)
Received: from NAM02-SN1-obe.outbound.protection.outlook.com ([65.54.190.200]) by BAY004-OMC4S6.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008);
Tue, 29 Mar 2016 06:15:01 -0700
Received: from BL2NAM02FT016.eop-nam02.prod.protection.outlook.com
(10.152.76.59) by BL2NAM02HT149.eop-nam02.prod.protection.outlook.com
(10.152.77.241) with Microsoft SMTP Server (TLS) id 15.1.453.6; Tue, 29 Mar
2016 13:15:00 +0000
Received: from CY1PR18MB0662.namprd18.prod.outlook.com (10.152.76.53) by
BL2NAM02FT016.mail.protection.outlook.com (10.152.77.171) with Microsoft SMTP
Server (TLS) id 15.1.453.6 via Frontend Transport; Tue, 29 Mar 2016 13:13:30
+0000
Received: from CY1PR18MB0662.namprd18.prod.outlook.com ([10.164.217.152]) by
CY1PR18MB0662.namprd18.prod.outlook.com ([10.164.217.152]) with mapi id
15.01.0447.023; Tue, 29 Mar 2016 13:13:26 +0000
From: joe blow <idiot@live.com>
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: <B8B29230F390870@CY1PR18MB0662.namprd18.prod.outlook.com>
References: <153c27ddbab-47c-5ca@webprd-m49.mail.aol.com>
In-Reply-To: <153c27ddbab-47c-5ca@webprd-m49.mail.aol.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:

X-OriginatorOrg: live.com

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.

Thanks,
Brian
 
Old 03-31-2016, 07:17 AM   #2
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,634

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
Is it being accepted prior to hitting your sender_access check?
 
Old 03-31-2016, 12:23 PM   #3
scoobybri
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 main.cf 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,
Brian
 
  


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 07:41 AM
How To Blacklist a Spammer in Postfix carlosinfl Linux - Server 4 01-22-2010 02:00 PM
Postfix blacklist crxssi Linux - Server 7 09-23-2009 02:34 PM
Blacklist Postfix andybrr Linux - Server 1 04-24-2009 06:39 AM
how to Blacklist specific email in postfix nhansense Linux - Server 19 08-22-2008 03:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:17 PM.

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