[Mailman-Users] Regexp matching failing for accept_these_nonmembers

Mark Sapiro mark at msapiro.net
Fri Nov 8 16:29:09 EST 2019


On 11/8/19 12:01 PM, Gretchen M Beck wrote:
> Hi Mark,
> 
> 
> In "def process"
> 
>     dn, addr = parseaddr(msg.get('from'))
> 
>     syslog('debug','parseaddr - from  is %s' % addr,)

FYI, the above could be

     syslog('debug','parseaddr - from  is %s', addr)

i.e. syslog will do the interpolation of the subsequent argument(s) into
the string so you don't have to.

> But I'd already capturing the nonmember message to %s from %s in the vette log, so don't think I need to add it. I'm not seeing anything different there either.
> 
> 
> USE_ENVELOPE_SENDER is false (no).

OK, I'd still like to see what this patch reports because I'm going to
tell you that if USE_ENVELOPE_SENDER is false and the messages From: is
an address that matches accept_these_nonmembers, the message should be
accepted. Since this is apparently not the case, I want to see what the
value of sender is at the point where it's being tested.

I also wonder about possible leading or trailing whitespace in the
address being tested, so I put quotes around the address in the patch below.


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


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