[Mailman-Users] Tip for finding in the source

Mark Sapiro msapiro at value.net
Sat Mar 18 17:24:43 CET 2006

Oliver Schulze L.wrote:
>- Does msg.get('x-spam-flag') reads the email header or does it
>  reads a status/property that is from mailman?

This is an email.Message.Message method. it returns the value of an


header in the message or None if there is no such header.

>- how do I create a new configuration option? Just tell what directory
>  to read ;) I'm planning adding this option:
>  send_bounced_email_to_owner = never | ifnotspam | always

See for example the patch attached to

The details are of course different, but the essential items are

- Provide a default value for the attribute in Defaults.py.

- Add the attribute and brief and detailed description to the
  appropriate Mailman/Gui/ module.

- Initialize the attribute for new lists in InitVars() in

- Initialize the attribute for existing lists when they are updated
  in Mailman/Versions.py.

- Increment the DATA_FILE_VERSION in Mailman/Version.py so existing
  lists will be updated when they are accessed.

- Add the actual code to use the attribute and implement the function
  (In the case of the above patch, those changes are also in
  Mailman/MailList.py, but they could be anywhere.)

Note also, that X-Spam-Flag: is a Spamassassin specific header. If you
are going to try to make this general, you should use

Also, before you do anything, look at Mailman 2.1.8 (a1 is currently
available, see
Look at the changes in Mailman/Handlers/SpamDetect.py having to do
with reject or hold of messages to the owner that match
header_filter_rules. If you just want to look at SpamDetect.py, see

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