[Mailman-Users] lack of sucjects, html and more

John W Baxter jwblist at olympus.net
Tue Apr 16 21:15:56 CEST 2002


At 12:53 -0400 4/16/2002, Seth H Holmes wrote:
>1) I want to either reject or hold for approval all messages submitted
>   without a subject. I know mailman replaces a blank subject with "(no
>   subject)" so there must be some hook in there somewhere. I have tried
>   regular expressions such as:
>
>	subject:$
>	subject *: *$

I haven't read the relevant part of the Mailman code, so I have to pose a
question:
Does the application of regular expressions to the headers of a message
happen before or after Mailman has filled in the subject with "(no
subject)"?

A quick grep of the source finds several matches to the string
   no subject
including repeated calls to
  something = msgsubject = msg.get('subject', '(no subject)')
(with various "something"s).

So it looks as if the message is unchanged, and blank subjects are "fixed"
on the fly.

I suspect you should try using a regular expression which looks for the
   (no subject)
string--alone as the subject, probably, so that you don't catch a message like
...
Subject: Catching messages with Subject: (no subject)
...

This is from a somewhat old Mailman...the instance in Hold.py looks
promising at first glance:

Handlers/CookHeaders.py:            msg['Subject'] = prefix + '(no subject)'
Handlers/Hold.py:         'subject'    : msg.get('subject', '(no subject)'),
Handlers/ToUsenet.py:        msg['Subject'] = subjpref + '(no subject)'
ListAdmin.py:        msgsubject = msg.get('subject', '(no subject)')
Message.py:            subject = '(no subject)'

-- 
John Baxter   jwblist at olympus.net      Port Ludlow, WA, USA





More information about the Mailman-Users mailing list