[Mailman-Users] Simple notification handler

Mark Sapiro mark at msapiro.net
Thu Dec 22 20:59:52 CET 2011


Yves Moisan wrote:
>
>It seems the handler stops the list from working.  When I delete the new 
>pipeline the list works fine so it's the Python file (or the way I 
>included it in the pipeline ?) that has a problem.
>
>I've tried including a she-bang line or not (see below for both the 
>handler and the text file used to shove it in the list pipeline), 
>importing Message in addition to UserNotification and a few other things 
>to no avail.  One thing I find odd is that the handler doesn't get a 
>.pyc file upon restart.  Should I expect that or does it get created the 
>first time it is invoked ?


The .pyc file will not get created until the handler is imported which
does not happen until IncomingRunner handles a post for a list which
has the handler in its pipeline.

Also, IncomingRunner is a python process which imports the handler, so
no shebang line is required.


>I've copied the file over from a windows machine and I took care of 
>chowning it so it has the same permissions as the other Handlers.  The 
>file looks ok in vi.  What other options do I have before pdb ?


Check Mailman's error log.

Also, see below.


>
>=== BackupErrors.py ===
>
[...]
>
>def process(mlist, msg, msgdata):
>     subject = Utils.oneline(msg['subject'], 'us-ascii')
>     if re.search('.*error.*', subject, re.IGNORECASE)


I misled you here. The above line needs to be

     if re.search('.*error.*', subject, re.IGNORECASE):

The missing colon results in a syntax error which causes all list posts
to be shunted. There will be an error message and traceback in
Mailman's error log. If the messages that were shunted are wanted, you
can process them with Mailman's bin/unshunt. If not, remove them from
qfiles/shunt.

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