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 __________________________________________________ ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@python.org http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: http://mail.python.org/mailman/options/mailman-users/archive%40jab.org Security Policy: http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp