Hi,
is there some information/docs/draft on the structure in the Mailman source code? Since the moderate function is an important feature in the mailinglist we're running, i have a lot of ideas for things that could make the moderate page more powerfull and easy to work with... i can make my own little hacks in the source but i could also offer my patches in here... so i can share my code plus i wont have to put it back everytime i upgrade mailman to a new version ;)
one thing i really wanted to fix fast was stripping a lot of the headers you see on the moderated posts page... this is what i made for it (this it my first piece of python ever so it can be probably made much more efficient ;) ) It's just a function a call in admindb.py before it outputs the message on the screen with Preformatted() ideally this could be a config option and one should be able to choose which headers to show in the output.
==== def stripheaders(msg):
found = 0
emsg = ''
# define which headers to keep
headers = ['From:', 'To:', 'Date:', 'Subject:']
for i in string.split(msg, "\012"):
if not found:
for j in headers:
if i[:len(j)] == j:
emsg = emsg + i + "\012"
# the first empty line means we're done with the headers part
if i == "":
found = 1
emsg = emsg + "\012"
else:
# we've had the header part so every line can be added back
emsg = emsg + i + "\012"
return(emsg)
====
Ricardo.
--
Hi,
I hate to reply to my own posts (as usual ;) ) but is anybody else interested in this feature or agrees this can be an usfull addition to mailman? if i get some positive responses, i'm going to have a better look at the mailman source and i'll try to fit it in and make it and configurable option... if anybody this my python code sucks... let me know! :)
Thanks, Ricardo.
On 05-Aug-99 Ricardo Kustner wrote:
one thing i really wanted to fix fast was stripping a lot of the headers you see on the moderated posts page... this is what i made for it (this it my first piece of python ever so it can be probably made much more efficient ;) ) It's just a function a call in admindb.py before it outputs the message on the screen with Preformatted() ideally this could be a config option and one should be able to choose which headers to show in the output.
==== def stripheaders(msg):
found = 0 emsg = '' # define which headers to keep headers = ['From:', 'To:', 'Date:', 'Subject:'] for i in string.split(msg, "\012"): if not found: for j in headers: if i[:len(j)] == j: emsg = emsg + i + "\012" # the first empty line means we're done with the headers part if i == "": found = 1 emsg = emsg + "\012" else: # we've had the header part so every line can be added back emsg = emsg + i + "\012" return(emsg)
====
participants (1)
-
Ricardo Kustner