[Mailman-Users] per-list email at munging?

Mark Sapiro mark at msapiro.net
Thu May 26 02:09:29 EDT 2016


On 05/24/2016 02:47 PM, Karl Berry wrote:
> 
> Looking at HyperArch.py (and Defaults.py), it seems
> ARCHIVER_OBSCURES_EMAILADDRS is server-wide.  Any viable way to make it
> per-list?  I couldn't find anything in web searches or at
> http://fog.ccsf.cc.ca.us/~msapiro/scripts/ but always easy to miss stuff.


That depends what you mean by viable. There is no existing list
configuration that will do it directly.

Of course it can be done. Doing it right is not difficult, but is
somewhat involved because there are a lot of pieces involved. The
complete job includes:

modifying Mailman/versions.py to add the attribute with a default value
for lists whose data_version is < mm_cfg.DATA_FILE_VERSION.

modifying Mailman/Version.py to increase DATA_FILE_VERSION ideally by
0.1 because a new release will always increment when necessary by a
whole number.

modifying Mailman/MailList.py to add the attribute with a default value
to new lists.

modifying Mailman/Defaults.py.in and maybe Mailman/Defaults.py to
provide a setting for the default value.

modifying Mailman/Cgi/admin.py to display and update the attribute in
the admin GUI, and of course

modifying Mailman/Archiver/HyperArch.py to test the list attribute
rather than mm_cfg.ARCHIVER_OBSCURES_EMAILADDRS.

Pieces of that can be skipped such as hard coding a default instead of
making it a Defaults.py/mm_cfg.py setting.

There are other ways that are less involved. For example, one could just
modify Mailman/Archiver/HyperArch.py, and everywhere it has

    if mm_cfg.ARCHIVER_OBSCURES_EMAILADDRS:

replace that with something like

    if (mm_cfg.ARCHIVER_OBSCURES_EMAILADDRS and
        not hasattr(xxxx, 'skip_obscure')):

where xxxx is self._mlist for the 4 occurrences in the Article class and
self.maillist for the 2 occurrences in the HyperArchive class.

Then lists that don't have a skip_obscure attribute will be processed
according to ARCHIVER_OBSCURES_EMAILADDRS and those that have it will
not have addresses obscured. Then for those lists that you want to skip
obfuscation, create a lists/LISTNAME/extend.py file with content

def extend(mlist):
    mlist.skip_obscure = True

to set the attribute for those lists.


> P.S. It seems the original author (Richard Barrett) offered to make it
> per-list back in 2003 but no one asked for it :).
> https://sourceforge.net/p/mailman/patches/273/


Actually, that patch, also in the current tracker at
<https://bugs.launchpad.net/mailman/+bug/558097>, is not the
implementation of ARCHIVER_OBSCURES_EMAILADDRS but rather a modification
of same to do a more aggressive obfuscation of email addresses in the
archive than the '@' -> ' at ' that is currently done.

-- 
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