[Mailman-Users] Writing a Mailman Script

stephen at xemacs.org stephen at xemacs.org
Fri Sep 8 07:41:00 CEST 2006

Nerses Ohanyan writes:

 > I have set up everything, but it simply doesn't work.  How can I debug
 > my code?  How can I see what the code is doing (i.e. can I print to
 > terminal?)

You can run it under an interactive Python, I'm sure, but you'll need
to do a bunch of importing by hand and preparation of test input and
stuff like that.  It will depend on what your code does.  I've never
done it, though, so I can't really say.

As I wrote, you can write to a log, there are a couple of examples in
the standard handlers.  If you want to see that in real time, you can
tail the log.  It's as easy as

from Mailman.Logging.Syslog import syslog
def process(mlist, msg, msgdata):
    syslog('mylog', 'Got right HERE -->  <-- I mean, LEFT here!')

and you'll find the "got here ..." message in $MAILMAN_HOME/log/mylog.

If you want something more interactive than that, it's beyond my
experience.  I'd suggest that you ask on comp.lang.python, but of
course you'll have to provide most of the Mailman specifics yourself.



More information about the Mailman-Users mailing list