Skip to Content.
Sympa Menu

en - Re: [sympa-users] limit number of user posts

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: "Ed C." <address@concealed>
  • To: Steve Shipway <address@concealed>
  • Cc: "address@concealed" <address@concealed>
  • Subject: Re: [sympa-users] limit number of user posts
  • Date: Fri, 11 Jan 2013 11:52:41 -0600

Thanks, Steve. It looks like you put a lot of thought into my question.
Unfortunately, your sketch of a solution is mostly over my head and
surely much more complicated than it was with LISTSERV (probably due to
Sympa's sql infrastructure). Does anyone here know if this type of
setting (and others like delinking the list review command [members] and
list archive downloading) is easier to accomplish with mailman? From my
limited experience it seems that Sympa is better suited to very large
lists (> 50000 members) and maybe even to those that are more like
broadcast media rather than few-to-few and few-to-one semi-public
communications. Our 16 year-old list has never had more than 600 members
and so could probably use the free LISTSERV version but we would rather
stick with something free in the Richard Stallman sense of the word
(Sympa, mailman, others??). I don't know much about mailman other than
it doesn't do w32 installations but does support w32 users. Since the
list in question doesn't have any moderators (only 2 owners who are
constantly tempted to assume the role of moderators, inappropriately)
who must protect absolute freedom of speech, it will also be essential
that users can filter out other members' postings at a very fine grain
(by posters' email addresses, by all postings in threads started by
certain posters, etc.) this would push all moderating functions onto
each user.

Sorry if my questions are more political than technical but we need to
decide what the answers should be to some very complicated questions
that are impinged on by purely technical features of the program. Would
mailman be a better fit for us based on the above observations?

Thanks,

Ed



> Here's a first hack attempt at a CustomConditions plugin for Sympa to
> allow rate limiting. Not anywhere near properly tested. I doubt
> I'll have enough opportunity to take this through to the end but
> anyone is welcome to pick it up from here and run with it.
>
> This needs you to create a table `postlimit` in the Sympa database in
> advance - robot VARCHAR(64) listname VARCHAR(128) sender
> VARCHAR(128) lastdate VARCHAR(8) pcount INT(8) Primary key:
> robot/listname/sender
>
> Note that this does not yet handle multiple robots - you could pass
> the robot name via the parameters, or grab it from somewhere else?
> Also, it's a bit naughty to use `count` as a column name, probably
> should be something else.
>
> Place it in custom_conditions/postlimit.pm or in
> <robotname>/custom_conditions/postlimit.pm and restart Sympa.
>
> Use it like this:
> CustomCondition::postlimit([listname],[sender],8,60) smtp,smime,md5
> -> do_it true()
> smtp,smime,md5 -> reject(reason="Too many posts today")
>
> If this were to be implemented properly, it should probably store
> per-list limits in the list custom parameters; then create a plugin
> page for wwsympa to maintain these, and a include.send.header file to
> add the limit to all send scenari. If no custom parameter is set
> then disable the limit. As well as a per-sender limit, there should
> be a per-list limit and maybe even a per-robot limit (could implement
> these by summing the various pcount fields of all records).
>
> Feedback welcome.
>
> Steve
>
> Steve Shipway ITS Unix Services Design Lead University of Auckland,
> New Zealand Floor 1, 58 Symonds Street, Auckland Phone: +64 (0)9
> 3737599 ext 86487 DDI: +64 (0)9 924 6487 Mobile: +64 (0)21 753 189
> Email: address@concealed  Please consider the environment
> before printing this e-mail : 打印本邮件,将减少一棵树存活的机会
>
> ---- cut here #!/usr/bin/perl #vim:ts=4
>
> package CustomCondition::postlimit; use strict; use Log; use POSIX
> qw(strftime); use List; sub verify {
> my($listname,$sender,$limit)=@_; my($lastdate,$count,$today);
> my($robot); my($rv,$sth); my( $dbh ) = &List::db_get_handler();
> unless ($dbh and $dbh->ping) { unless( &List::db_connect() ) { #
> default to allow do_log('err',"Unable to connect to database to check
> post limit" ); return 1; } $dbh = &List::db_get_handler(); } # get
> todays date $today = strftime('%y%m%d',localtime()); # retrieve
> record from table or create new $sth = $dbh->prepare("SELECT
> `lastdate`,`pcount` from `postlimit` where `sender` = '$sender' and
> `listname` = '$listname' and `robot` = '$robot'"); unless($sth) { #
> default to pass do_log('err',"Unable to prepare statement to check
> post limit" ); return 1; } $rv = $sth->execute(); $rv =
> $sth->fetchrow_array(); if($rv) { ($lastdate, $count) = @$rv; } else
> { ($lastdate, $count) = ('',0); } # reset count if lastdate!=today
> if( $lastdate != $today ) { $lastdate = $today, $count = 0; } #
> increment count $count += 1; # update table if($rv) {
> $dbh->do("UPDATE `postlimit` set `lastdate` = '$lastdate', `pcount` =
> $count WHERE `sender` = '$sender' and `listname` = '$listname' and
> `robot` = '$robot'"); } else { $dbh->do("INSERT into `postlimit` (
> `robot`,`listname`,`sender`,`lastdate`,`pcount` ) VALUES (
> '$robot','$listname','$sender','$lastdate',$count )"); } # test
> value return 1 if($count <= $limit); do_log('warning',"Too many posts
> for $sender to $listname\@$robot ( $count > $limit )" ); return 0; }
> 1;
>



Archive powered by MHonArc 2.6.19+.

Top of Page