procmail
[Top] [All Lists]

Re: Flood control?

2004-02-26 15:23:16
On Wed, 25 Feb 2004, Professional Software Engineering wrote:

PSE> but I was wondering if anyone here might have any insights on how to
PSE> implement a dynamic "flood control" mechanism.
PSE>

One defense in my autoresponder is to put the reply into sendmail's queue.
If a mailloop occured, there would be a 30 minute delay between the
responses.


PSE> I'm thinking something along the lines of taking the sender's address
PSE> and incrementing a counter associated with that address -- if the
PSE> counter exceeds some limit, that sender's messages get redirected
PSE> elsewhere (and as a result, don't get processed through the list
PSE> processor, so they don't get further messages).
PSE>

After a response, I put the address into a list and don't respond to
addresses already in the list.


PSE> There's the little matter of resetting the counter in a sensible
PSE> fashion (if you merely purged the counter file on a weekly basis,
PSE> then if there was a problem right around the purge time, it count go
PSE> for nearly twice the threshold before being detected).

I dump my list every morning with cron. For a subscription address, isn't
your problem the same in that you just have to break the mail loop so a
persistent list is not required?


PSE> There's also the possibility of a simple database, which I could
PSE> implement, but if this is to be a fairly portable solution, I think
PSE> that should be avoided -- having a dependancy upon a helper app and a
PSE> specific db implementation gets messy when you go to share code.
PSE>

I implemented a simple database as a text file for my long line detector.
I don't know how well such a thing would scale, but if it is limited to
mail coming to a subscription address, does it need to?  My database
format is

20040226 0032 AAABVAIPrj...

where the 'C' helper program updates the counter and emits it on stdout
for scoring in procmail and a gawk program does the ageing cleanup as a
cron job.

-- 
Alan


( Please do not email me AS WELL as replying to the list.  Please
  address personal email to alan+1@ as lists@ is not read. A
  password autoresponder may be invoked if this email is very old. )


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>