Merge lp://staging/~jimpop/mailman/mailman-auto-mod-verbose-members into lp://staging/mailman/2.1

Proposed by Jim Popovitch
Status: Merged
Merged at revision: 1595
Proposed branch: lp://staging/~jimpop/mailman/mailman-auto-mod-verbose-members
Merge into: lp://staging/mailman/2.1
Diff against target: 120 lines (+50/-1)
6 files modified
Mailman/Defaults.py.in (+6/-0)
Mailman/Gui/Privacy.py (+12/-0)
Mailman/Handlers/SpamDetect.py (+8/-0)
Mailman/Utils.py (+19/-0)
Mailman/Version.py (+1/-1)
Mailman/versions.py (+4/-0)
To merge this branch: bzr merge lp://staging/~jimpop/mailman/mailman-auto-mod-verbose-members
Reviewer Review Type Date Requested Status
Mark Sapiro Approve
Mark Shapiro Pending
Review via email: mp+276706@code.staging.launchpad.net

Commit message

Auto-Moderate verbose members

Description of the change

This is a simple patch to enable the following two Privacy/Sender features:

  member_verbosity_threshold
     Ceiling on acceptable number of member posts, per interval, before automatic moderation.

  member_verbosity_interval
     Number of seconds to use in determining whether or not to automatically moderate a member.

The code tracks member posts in a simple python dictionary, and then checks the dictionary each time a post is processed via Mailman/Handlers/SpamDetect.py. If a member exceeds X posts in Y time, then the member is automatically moderated.

To post a comment you must log in.
1587. By <email address hidden>

Removed 2 development debugging lines

Revision history for this message
Mark Sapiro (msapiro) wrote :

It is not clear why you have

 add_only_if_missing('member_verbosity_threshold', 0)

in versions.py instead of

 add_only_if_missing('member_verbosity_threshold',
                     mm_cfg.DEFAULT_MEMBER_VERBOSITY_THRESHOLD)

Oversight perhaps. Also I think Defaults.py.in should probably have

DEFAULT_MEMBER_VERBOSITY_THRESHOLD = 0

Also, the first few lines of Utils.IsVerboseMember() seem unnecessary, and I'm not completely comfortable with recentMemberPostings being a global in Utils.py rather than a list attribute.

And, do you really see 5 posts from the same member in 5 minutes?

Finally, I'm curious if you ever saw <https://www.msapiro.net/scripts/PostLimit.py>. I guess it is very different in detail, but the goal may be similar.

I've been reluctant to actually implement that on my production server, although it has been suggested as a way to control one member (I'd rather have a conversation than hit him with a hammer, although hammers have their place.)

review: Needs Information
Revision history for this message
Jim Popovitch (jimpop) wrote :

Hi Mark, thank you. I have made the following improvements based on your feedback:

Mailman/versions.py:
    set mm_cfg.DEFAULT_MEMBER_VERBOSITY_THRESHOLD rather than hardcoded "0".

Mailman/Defaults.py.in:
    DEFAULT_MEMBER_VERBOSITY_THRESHOLD now defaults to 0

Mailman/Utils.py:
    Removed unnecessary value checks from the top of Utils.IsVerboseMember()

Mailman/Handlers/SpamDetect.py
    Added "mlist.member_verbosity_threshold > 0" test before call to Utils.IsVerboseMember()

I set recentMemberPostings as a global because I felt it was important to measure a members posting pattern across all lists, not a single list. Although I currently only moderated the user on the single impacted list, ideally I'd like to find a way to moderate the user on all subscribed lists.

NANOG recently had a problem of hundreds of spam posts in a matter of minutes. Search for "Fw: new messsage" on http://mailman.nanog.org/pipermail/nanog/2015-October/thread.html (DO NOT CLICK ON ANY OF THE EMAILED LINKS IN THOSE NANOG POSTS). There were so many posts it clogged their outbound queues for at least 1 day.

I have not seen PostLimit before, thanks. I honestly don't care which version makes it into Mailman, but there is clear evidence that spamvertised postings, using a known member address, is going to be a huge problem going forward.

1588. By <email address hidden>

Improvements based on feedback from Mark Sapiro
   https://code.launchpad.net/~jimpop/mailman/mailman-auto-mod-verbose-members/+merge/276706/comments/699744

Revision history for this message
Mark Sapiro (msapiro) wrote :

Thanks for your replies and changes. I now have a much clearer understanding of the issue that prompts this. I will probably do a little tweaking, but it looks good and I will get it in the next release.

It really has different goals from PostLimit which I did as a response to some request on Mailman-users.

Actually, we could have used something like this for a flood of bogus subscription requests a while back, but the addresses were predictable enough that I was able to handle it with a regexp in the new GLOBAL_BAN_LIST (and variable enough that matching on the address wouldn't work).

Anyway, You've done good work here. Thank you. I will get the feature in the next release (and probably aim for a release soon, but not before December as I a traveling the next 3 weeks)

review: Approve
Revision history for this message
Mark Sapiro (msapiro) wrote :

I have merged this branch and made some changes. The most significant is your code to drop old times from the recentMemberPostings dictionary is wrong. Deleting items from a list while processing 'for item in list' results in skipping items.

I also allow for different lists to have different member_verbosity_interval settings and process that I hope reasonably.

Finally, I don't attempt to moderate a non-member, and I look at more than the From: of the message to find a member address.

Revision history for this message
Jim Popovitch (jimpop) wrote :

Sounds good Mark, Thanks

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.