[Mailman-Users] Custom header

David Cake dave at difference.com.au
Mon Sep 13 15:24:20 CEST 2004


At 3:03 PM +0900 2/9/04, Jim Tittsler wrote:
>On Aug 31, 2004, at 13:42, David Cake wrote:
>
>>	I guess my questions really is 'do the existing per-list 
>>customisation options include any way of changes to the mail 
>>headers beyond what is already accessible from the GUI?'
>>	And, as a followup, if it requires source code level changes, 
>>is there a sane and sensible way of doing these on a per list basis 
>>so my installation remains upgradable? I know python, but I'm in no 
>>hurry to make by installation unmaintainable.
>
>I think the best way to do this sort of thing is add a handler to 
>that list's pipeline that does the processing you want.  If you 
>created a DavidsHeader.py in your Mailman/Handlers directory that 
>contained simply:
>
>#
># DavidsHeader.py
>"""Add a list specific header
>"""
>
>def process(mlist, msg, msgdata):
>     msg['X-Davids-Header'] = 'my header text'
>
>And then add that handler to the pipeline for the list in question 
>(say after the CookHeaders handler) using withlist:
>$ bin/withlist -l mylist
>  >>>m.pipeline.insert(m.pipeline.index('CookHeaders')+1, 'DavidsHeader')
>>>>m.Save()
>>>>{Ctrl-D}
>
>Your list will be processed with the additional handler that does 
>nothing but add a header.

	Apparently, lists do not have a pipeline attribute by 
default? At least, the above code does not work, and I got the 
impression from comments in Default.py that a pipeline attribute was 
something a list could have but usually did not.
	Thanks In Advance

		David



More information about the Mailman-Users mailing list