[Mailman-Users] Simple notification handler
yves.moisan at boreal-is.com
Thu Dec 22 21:11:58 CET 2011
Our emails crossed here. I just tried importing my handler on the
python prompt and the syntax error popped obvious. The minute the
pipeline for the list was set with /bin/config_list I could see the pyc
so I knew I was in business.
A final question : I see now that even restarting Mailman won't change
the list-specific handler application and one needs to explicitly delete
it if one wants to get rid of it. That's a good thing. But where are
list-specific pipeline defs stored ?
> 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
More information about the Mailman-Users