procmail
[Top] [All Lists]

Re: formail msgid cache question

1998-10-08 16:04:46
Tim Walberg <walberg(_at_)cig(_dot_)mot(_dot_)com> writes:
A question regarding formail's Message-Id cache:

I have a procmail recipe utilizing 'formail -D <n> <f>'
to detect and process duplicate messages. Being somewhat
curious about what happens when the cache file hits it's
maximum size, I did a quick perusal of the appropriate
source code. It appears that once the file has hit it's
max size, further Message-Id keys will all be written
at offset 0 in the cache file, which rather limits the
usefulness of the cache for this type of use. It seems

Bzzt.  The format of the cache is initially as follows:

entry\0entry\0entry\0\0

When the file size grows to equal-to or greater-than the size specified
on the command line, formail starts over at the beginning, using a
double-null to mark where it stopped.  However, entries after the
double-null, except for the partially overwritten one, are still valid
and checked, so that the file is then in the format:

entry\0entry\0entry\0\0partial-entry\0entry\0entry\0\0

New entries will be written after the first double-null, so that
it implements a circular cache.  Check out lines 319-322 of formail.c

Testing confirms this.


Regardless, I'm wondering what kind of effort would be
required to make this work the way I'm trying to make it work.

That would be none.


Philip Guenther

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