Hi Mark,

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 ?

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 ?

Thanx,

Yves Moisan

=== BackupErrors.py ===

#!/usr/bin/python # I also treid without, like in the other handlers on my server
# BackupErrors.py
"""Add a list specific alert generator in case there was a problem in the backup, in which case the Subject of the email will contain the word 'ERROR'
"""

import re
from Mailman import Utils
from Mailman.Message import UserNotification
# from Mailman.Message import Message,UserNotification
NTEXT = """Texte du corps du
message
TESTS.
"""
NRECIP = '[email protected]'
NFROM = '[email protected]'
NSUBJ = 'Error in backup'

def process(mlist, msg, msgdata):
    subject = Utils.oneline(msg['subject'], 'us-ascii')
    if re.search('.*error.*', subject, re.IGNORECASE)
        nmsg = UserNotification(NRECIP, NFROM, NSUBJ, NTEXT)
        nmsg.send(mlist)

=== backupHandlerPipeline.txt ===

mlist.pipeline = [
    # These are the modules that do tasks common to all delivery paths.
    'SpamDetect',
    'Approve',
    'Replybot',
    'BackupErrors',
    'Moderate',
    'Hold',
    'MimeDel',
    'Scrubber',
    'Emergency',
    'Tagger',
    'CalcRecips',
    'AvoidDuplicates',
    'Cleanse',
    'CleanseDKIM',
    'CookHeaders',
# And now we send the message to the digest mbox file, and to the arch and
    # news queues.  Runners will provide further processing of the message,
    # specific to those delivery paths.
    'ToDigest',
    'ToArchive',
    'ToUsenet',
    # Now we'll do a few extra things specific to the member delivery
    # (outgoing) path, finally leaving the message in the outgoing queue.
    'AfterDelivery',
    'Acknowledge',
    'ToOutgoing',
    ]


------------------------------------------------------
Mailman-Users mailing list [email protected]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Reply via email to