[Mailman-Developers] Duplicate Prevention

Mark Sapiro mark at msapiro.net
Sat Dec 6 22:10:24 CET 2008


Dan Mahoney, System Admin wrote:
>
>We've recently taken on mailman to handle many large, popular lists at my 
>day job, and one strangely-missing feature is the inability to avoid 
>duplicates when someone cc's a list's old alias and new alias (we also 
>moved the lists to a subdomain, out from under our primary).


This was reposted to mailman-users and answered there. Thread at
<http://mail.python.org/pipermail/mailman-users/2008-December/064279.html>.


>Another great feature would be to have mailman "strip" multiple cc 
>recipients.  I.e. if a message is sent:
>
>to: list
>cc: list-alias(*), another-list-alias(*)
>
>-or-
>
>to: person
>cc: list, list-alias(*)
>
>To have these (*) stripped (and prevent the need for this).  But that's 
>more work, and right now the duplicates are a major regression from what 
>we had before.


I assume by list-alias you mean something in the list's
acceptable_aliases. If so, it's tricky since the contents of
acceptable aliases are really regexp patterns, not simple strings.
However, if in your case, all the strings in acceptable_aliases are
full addresses all you need is to insert

    for r in mlist.acceptable_aliases.splitlines():
        if ccaddrs.has_key(r.lower()):
            del ccaddrs[r.lower()]

in Mailman.Handlers.AvoidDuplicates.py just ahead of

    # RFC 2822 specifies zero or one CC header
    del msg['cc']
    if ccaddrs:
        msg['Cc'] = COMMASPACE.join([formataddr(i) for i in
ccaddrs.values()])

at the end of the module. I wouldn't suggest doing this in general,
even with a regexp match, because there are bound to be unintended
consequences in cases where there is not an explicit reply to list
and/or acceptable_aliases has one or more actual regexps.

-- 
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-Developers mailing list