[Mailman-Users] Auto-discard emails

Mark Sapiro mark at msapiro.net
Tue Apr 30 23:41:59 EDT 2019


On 4/30/19 7:55 PM, Steven D'Aprano wrote:
> I'm not sure if this is the right place to ask my second question, if 
> not apologies in advance.
> 
> I run an announcement-only mailing list which has become the target of a 
> lot of spam, so I've set unsubscribed emails to be immediately 
> discarded. 99% of the discarded emails are spam, but unfortunately there 
> is a very small number of ham emails that get sent to the list by 
> non-members, which I need to be made aware of so I can contact them 
> off-list.
> 
> So I have turned on the option for discard messages to go to the 
> list-admin (me), and I get sent the "Auto-discard notification" messages 
> which includes enough information for me to tell at a glance whether I 
> need to contect the sender. Great!
> 
> This is the question which is definitely on-topic: am I doing it right, 
> or is there a better way I haven't thought of?


I think that's good. I can't think of a better way as long as you need
to actually review the messages to find the few potentially good ones.


> Now, the second part which may be off-topic... 


It is but...


> My mail server uses spamassassin, and nearly all of the auto-discard 
> messages are flagged as spam and filtered into junk mailboxes which I 
> consistently forget to check. Out of sight, out of mind. I've found a 
> few ham messages from mailman in my spam folders, months after they were 
> received.
> 
> I tried to whitelist emails from the mailing list by editing 
> 
> /etc/mail/spamassassin/local.cf
> 
> and I added the line:
> 
> whitelist_from_rcvd mailman-bounces at mydomain server.mydomain


I don't think you can use whitelist_from_rcvd this way. According to
<https://spamassassin.apache.org/full/3.1.x/doc/Mail_SpamAssassin_Conf.html#whitelist_and_blacklist_options>,
the string (your server.mydomain) "is matched against the reverse DNS
lookup used during the handover from the internet to your internal
network's mail exchangers." I.e. it is the sending server in the last
Received: header from outside your domain. It will never match because
any Received: header with sending server server.mydomain  is already in
your internal network.

I think you have to use

whitelist_from mailman-bounces at mydomain

Or you could do something more complex like

header _MM_BOUNCE_1 Return-Path =~ /<mailman-bounces at mydomain>/
header _MM_BOUNCE_2 Received =~ /from server.mydomain/
meta MM_BOUNCE _MM_BOUNCE_1 && _MM_BOUNCE_2
score MM_BOUNCE -20

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan


More information about the Mailman-Users mailing list