[Mailman-Developers] Adding a message id to the vette log

C Nulk CNulk at scu.edu
Fri Jan 28 22:58:08 CET 2011


Hello all,

I am using Mailman v2.1.9 with some minor local mods on CentOS 5.5.  In
looking through the vette log, I noticed some of the log entries for
refused postings and discarded postings do not indicate what message
(via the message id) was acted upon.  I would like to the message id to
those entries.  I found where the entries are written to in
ListAdmin.py.   I made a few changes to the file.  Since I am barely
literate with python, I thought I would post my changes to the list and
ask you fine people if I did will work, or am I doomed.  There changes
are (in diff -u format):

--- /usr/lib/mailman/Mailman/ListAdmin.py    2008-05-24
13:44:12.000000000 -0700
+++ ListAdmin.py.SCU    2011-01-28 13:26:12.000000000 -0800
@@ -340,13 +340,21 @@
             fmsg.send(self)
         # Log the rejection
         if rejection:
+            try:
+                msg = readMessage(path)
+            except IOError, e:
+                if e.errno <> errno.ENOENT: raise
+                return LOST
+            msg = readMessage(path)
             note = '''%(listname)s: %(rejection)s posting:
 \tFrom: %(sender)s
-\tSubject: %(subject)s''' % {
+\tSubject: %(subject)s
+\tMessage-id: %(messageid)''' % {
                 'listname' : self.internal_name(),
                 'rejection': rejection,
                 'sender'   : str(sender).replace('%', '%%'),
                 'subject'  : str(subject).replace('%', '%%'),
+                'messageid': msg.get('message-id', 'n/a').replace('%',
'%%'),
                 }
             if comment:
                 note += '\n\tReason: ' + comment.replace('%', '%%')


Also, are there any other files I may need to change?

Thanks,
Chris


More information about the Mailman-Developers mailing list