[Mailman-Users] Umbrella Lists & Subject Prefixes
Mike Peachey
mike.peachey at jennic.com
Fri Sep 21 16:43:18 CEST 2007
Mark Sapiro wrote:
> 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. ;-)
>
I'm using this anyway :-)
if msg.has_key('x-no-subject-prefix') and msg.get('x-no-subject-prefix',
'').lower() == 'yes':
--
Kind Regards,
__________________________________________________
Mike Peachey, IT
Tel: +44 114 281 2655
Fax: +44 114 281 2951
Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK
Comp Reg No: 3191371 - Registered In England
http://www.jennic.com
__________________________________________________
More information about the Mailman-Users
mailing list