[Mailman-Users] Removing arbitrary headers

Mark Sapiro mark at msapiro.net
Fri Feb 6 21:09:11 CET 2015

On 02/06/2015 09:32 AM, Lindsay Haisley wrote:
> We recently set up an announcement mailing list (MM 2.1.18) for a local
> music non-profit organization for which my wife is the treasurer, and at
> this point the sole authorized (un-moderated) poster to the list.

She should also moderate herself and post with an Approved: <password>
header or pseudo header using the list's 'poster' password.

> Is there, and if not, shouldn't there be a way to _completely_ anonymize
> a post to a list?  There should be some way to have MM remove the
> Organization header and replace it with an arbitrary one, in this case
> the name of the organization on behalf of which the announcement was
> sent.

>From the NEWS for Mailman 2.1.17:

There is a new mm_cfg.py setting ANONYMOUS_LIST_KEEP_HEADERS.  Since it
is not possible to know which non-standard headers in a message might
reveal sender information, we now remove all headers from incoming posts
to anonymous lists except those which match regular expressions in this
list. The default setting keeps non X- headers except those known to
reveal sender information, Mailman added X- headers and x-Spam- headers.
See the description in Defaults.py for more information.  (LP: #1246039)

Some obvious headers are always removed, but Organization: isn't one of

The default setting is
ANONYMOUS_LIST_KEEP_HEADERS = ['^(?!x-)', '^x-mailman-',
                               '^x-content-filtered-by:', '^x-topics:',
                               '^x-ack:', '^x-beenthere:',
                               '^x-list-administrivia:', '^x-spam-',

If you were to put

ANONYMOUS_LIST_KEEP_HEADERS = ['^(?!(x-|organization))', '^x-mailman-',
                               '^x-content-filtered-by:', '^x-topics:',
                               '^x-ack:', '^x-beenthere:',
                               '^x-list-administrivia:', '^x-spam-',

in mm_cfg.py, that would remove the Organization: header, but I consider
that a workaround and will add Organization: to the always removed
headers for 2.1.19.

Note, in testing the above I found another bug in that the headers in
the above list that end with ':' aren't kept because the colon isn't
part of the name we're matching against. I'm fixing that in Cleanse.py
to replace a trailing ':' with '$'. See

Mark Sapiro <mark at msapiro.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