[Mailman-Users] periodic shunts might have been undetected bad bounce_matching_headers

Julian H. Stacey jhs at berklix.com
Wed Aug 30 11:36:47 EDT 2017


Mark Sapiro wrote:
> On 08/29/2017 03:59 PM, Julian H. Stacey wrote:
> 
> > Now I have:
> > 	# Note that leading whitespace is trimmed from the regexp.  This can be
> > 	# circumvented in a number of ways, e.g. by escaping or bracketing it.
> > 	bounce_matching_headers = """
> > 	# Lines that *start* with a '#' are comments.
> > 	to: friend at public.com
> > 	message-id: relay.comanche.denmark.eu
> > 	from: list at listme.com
> > 	from: .*@uplinkpro.com"""
> > 	
> > 	## Bounce options
> > before it was
> > 	# Note that leading whitespace is trimmed from the regexp.  This can be
> > 	# circumvented in a number of ways, e.g. by escaping or bracketing it.
> > 	bounce_matching_headers = """# Lines that *start* with a '#' are comments.
> > 	to: friend at public.com
> > 	message-id: relay.comanche.denmark.eu
> > 	from: list at listme.com
> > 	from: .*@uplinkpro.com"""
> 
> Actually, the only difference between the two is "Now" has a leading
> blank line which won't make any difference as blank lines are ignored.

OK,


> >> What is the traceback from the 'shunt' message in Mailman's error log?
> > 
> > /usr/local/mailman/logs/error
> >   (Aside: I also spotted a few other unassociated errors such as Hostile
> >   listname: & fixed pages that pointed to non existant local Mailman list names)
> > 
> > All my remaining errors now seem to be the same sort:
> > 
> > 	NameError: global name 'syslog' is not defined
> > 	
> > 	Aug 23 13:37:16 2017 (82399) SHUNTING: 1503488012.441064+20509f89ec545c49966a4f1d747c804ea1df5852
> > 	Aug 24 20:56:44 2017 (18093) Uncaught runner exception: global name 'syslog' is not defined
> > 	Aug 24 20:56:44 2017 (18093) Traceback (most recent call last):
> > 	  File "/usr/local/mailman/Mailman/Queue/Runner.py", line 119, in _oneloop
> > 	    self._onefile(msg, msgdata)
> > 	  File "/usr/local/mailman/Mailman/Queue/Runner.py", line 190, in _onefile
> > 	    keepqueued = self._dispose(mlist, msg, msgdata)
> > 	  File "/usr/local/mailman/Mailman/Queue/IncomingRunner.py", line 130, in _dispose
> > 	    more = self._dopipeline(mlist, msg, msgdata, pipeline)
> > 	  File "/usr/local/mailman/Mailman/Queue/IncomingRunner.py", line 153, in _dopipeline
> > 	    sys.modules[modname].process(mlist, msg, msgdata)
> > 	  File "/usr/local/mailman/Mailman/Handlers/SpamDetect.py", line 136, in process
> > 	    syslog('vette',
> > 	NameError: global name 'syslog' is not defined
> > 	
> > 	Aug 24 20:56:44 2017 (18093) SHUNTING: 1503601003.748515+0146d084002ddd93cacadc41656c7632efc83301
> > 
> > /usr/local/mailman/Mailman/Handlers/SpamDetect.py line 136
> > 	syslog('vette',
> >                     '%s: Automatically Moderated %s for verbose postings.',
> >                      mlist.real_name, sender)
> > 
> > 	Line 34:	from Mailman import mm_cfg
> 
> 
> That and the next few lines should be
> 
> from Mailman import mm_cfg
> from Mailman import Errors
> from Mailman import i18n
> from Mailman import Utils
> from Mailman.Handlers.Hold import hold_for_approval
> from Mailman.Logging.Syslog import syslog
> 
> 
> It appears the 'from Mailman.Logging.Syslog import syslog' line is missing.

Yes, it's missing.  Well analysed without seeing it, Thanks !  
So I patched just that line in.  
Mailman 2.1.22 source misses that line. 2.1.23 2.1.24 have it.

2.1.23/NEWS has "Bug Fixes and other patches" ... SpamDetect.py
I'd best upgrade from 2.1.22 to 2.1.24 when I can monitor traffic after.  

I checked in case anything else missing, but all seems OK :-)
  I compared 2.1.22 & 2.1.24, all Handlers/*.py , & SpamDetect.py is
  the only one varying between versions with Mailman.Logging.Syslog .
  Various other Handlers/*.py do not have Mailman.Logging.Syslog
  in 2.1.22 & 2.1.24, but this quick check passes:
  	cd /usr/local/mailman/Mailman/Handlers
  	grep -l syslog *.py > ~/tmp/1
  	grep -l Mailman.Logging.Syslog *.py > ~/tmp/2
  	cmp ~/tmp/1 ~/tmp/2
  (But I don't know Python, & not considered other directories, includes, libs).

Thanks Mark!

Cheers,
Julian
-- 
Julian H. Stacey, Computer Consultant, BSD Linux Unix Systems Engineer, Munich
 Reply below, Prefix '> '. Plain text, No .doc, base64, HTML, quoted-printable.
 http://berklix.eu/brexit/#3,500,000_stolen_votes_inc_700,000_in_EU


More information about the Mailman-Users mailing list