[Mailman-Users] Regexp matching failing for accept_these_nonmembers

Mark Sapiro mark at msapiro.net
Fri Nov 8 13:57:00 EST 2019


On 11/8/19 9:47 AM, Gretchen M Beck wrote:
> 
> I'm on mailman 2.1.18-1, and this week I've received several complaints about messages held for moderation. Specifically, users whose addresses are in the "accept_these_nonmembers" list, or whose addresses match a regexp that is on the list are getting held as "Post by non-member to a members-only list"
> 
> 
> While I have had one complaint about this happening for a non-umbrella list, most of the examples have the non-member posting to an umbrella list where they are also accept_these_nonmembers, having the message pass through without moderation, then have it held at the next lists down (where it also should be accepted).
> 
> 
> I thought "well, let's see what parseaddr is returning" and so slapped a syslog at the appropriate point in Moderate.py, but so far what that is showing me matches the regexp in accept_these_nonmembers.


The first thought that occurred to me was that this could be due to the
difference between msg.get_senders() and msg.get_sender(), but maybe not.

What exactly did you log in Moderate.py? I would do it like this

--- Mailman/Handlers/Moderate.py	2018-06-17 23:47:34 +0000
+++ Mailman/Handlers/Moderate.py	2019-11-08 18:33:16 +0000
@@ -102,6 +102,8 @@
                         at_list='accept_these_nonmembers'
                        ):
         return
+    syslog('debug', 'Nonmember message to %s from %s not accepted',
+           listname, sender)
     if mlist.GetPattern(sender,
                         mlist.hold_these_nonmembers,
                         at_list='hold_these_nonmembers'


That said, the address matched against accept_these_nonmembers is the
address returned by msg.get_sender() which is

>         This can return either the From: header, the Sender: header or the
>         envelope header (a.k.a. the unixfrom header).  The first non-empty
>         header value found is returned.  However the search order is
>         determined by the following:
> 
>         - If mm_cfg.USE_ENVELOPE_SENDER is true, then the search order is
>           Sender:, From:, unixfrom
> 
>         - Otherwise, the search order is From:, Sender:, unixfrom


i.e. if mm_cfg.USE_ENVELOPE_SENDER is true get_sender() on the message
to the sub-list will be the umbrella list's -bounces address, at least
if .include_sender_header is Yes.

-- 
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