[Mailman-Users] Umbrella Lists & Subject Prefixes

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

Mike Peachey wrote:
>I'm using this anyway :-)
>if msg.has_key('x-no-subject-prefix') and msg.get('x-no-subject-prefix', 
>'').lower() == 'yes':

You don't need to test separately for the presence of the header.
That's what the second argument to msg.get() is for. It is returned
when the header named in the first argument isn't present, so the
above can be simplified to

if msg.get('x-no-subject-prefix', '').lower() == 'yes':

which is true if and only if there is an 'x-no-subject-prefix' header
with value 'yes'

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