procmail
[Top] [All Lists]

Re: kook blocker (message-id chain filter)

2002-12-05 04:20:28

On Wed, Dec 04, 2002 at 04:32:27PM -0500, Bennett Todd wrote:

Sounds like the ideal solution would use a couple of helper
programs.

Yep -- grep and test at this point.

Keep this as a plain text file, one line per message; use fgrep
from procmail to check messages to see if they are in kook chains,
and if so feed 'em to the kook-msg filter as well. Likewise, let
procmail fgrep against the known-kooks list to catch new threads.

All this sounds good, but when did procmail get an fgrep?  Procmail has
internal regexp matching that's almost compatible with egrep, but I
don't see any reference to an fgrep.  I've been using the grep that came
with FreeBSD.

If you're really worried about size, rig a monthly cronjob that
checks, and if they've exceeded 10MB or something chops 'em back
down to say 8MB or whatever, perhaps by counting the lines (with "wc
-l"), taking 20% (*2/10 will do the deed with awk), then using tail
to skip forward that far. Dump to tmp file, mv over original file.

Ya, that's about all I could come up with as well.  I'd prefer to keep
this as a self-contained unit, but procmail just doesn't have the tools
for that.  It's not a programming language, after all.

If I do a separate helper application that incorporates an fgrep and
perhaps stores each Message-ID as the key to a hash that holds the epoch
second when it was recorded, then the lookups will remain fast, and I
can cause an "old" epoch second to trigger a "cleanup" that will delete
from the hash anything whose epoch second is older than a week ago,
while holding a lock open, possibly from the procmail recipe.

Or, I could concentrate on work that actually brings in money....

-- 
  Paul Chvostek                                             
<paul(_at_)it(_dot_)ca>
  Operations / Abuse / Whatever                          +1 416 598-0000
  it.canada - hosting and development                  http://www.it.ca/


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