[Mailman-Users] Umbrella Lists & Subject Prefixes

Mark Sapiro msapiro at value.net
Fri Sep 21 16:40:43 CEST 2007


Mike Peachey wrote:

>Mark Sapiro wrote:
>> 
>> and add two lines after the comment so it becomes
>> 
>> def prefix_subject(mlist, msg, msgdata):
>>     # Add the subject prefix unless the message is a digest or is being
>> fast
>>     # tracked (e.g. internally crafted, delivered to a single user such
>> as the
>>     # list admin).
>>     if msg.get('x-no-archive', None) == None:
>>         return
>>     prefix = mlist.subject_prefix
>> 
>> If you decide to use a header other than X-No-Archive:, you'd replace
>> 'x-no-archive' above with the name of that header.
>> 
>
>That's just the solution I was looking for, but was being 
>put off-track by the 1999 solution ...


Ooops...


The code above contains a mistake. It will prefix the subject only for
messages that DO have the X-No-Archive: header. What you want in the
if test is 

     if msg.get('x-no-archive', None) <> None:
         return

to skip the prefix if the header is not None. Those double negatives
will get you every time. ;-)

-- 
Mark Sapiro <msapiro at value.net>       The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Users mailing list