procmail
[Top] [All Lists]

Re: Dup check, no dumping of message?

1999-10-31 22:21:18
"David W. Tamkin" <dattier(_at_)Mcs(_dot_)Net> writes:
...
LOCKFILE=msgid.lock
:0hwf
* ? formail -D 8192 msgid.cache
| formail -A "X-Duplicate: yeah baby"
LOCKFILE # release the regional lock

Here's an equivalent:

:0Whc:msgid.lock
| formail -D 8192 msgid.cache
 :0afwh # in case of success (i.e., if it is a duplicate)
 | formail -A "X-Duplicate: like, fer sherr"

If there are any differences in results or operation between those two,
I hope one of the experts will let us know.

Those recipes differ in four user-visible ways that I can think of:

1) The first unneccesarily holds like the lockfile while the header is
   being added, while the second releases it as soon as the test is done.

2) The logfile entries generated when LOGABSTRACT=all will be different
   when a duplicate comes in.  If VERBOSE=on then the output will differ
   greatly depending on the recipe.

3) Recipes immeadiately following these will see different results if
   they use the 'A', 'e', or 'E' flags (interestingly, the 'a' flag will
   behave identically regardless of which of the above recipes is used.
   The exact differences seen between the three flags listed above is
   left as an excercise for the student.)

4) "yeah baby" is generally consider less sarcastic than "like, fer sherr"


(You may wonder, if I consider lockfile hold-times to be user-*visible*
what's *in*visible.  Well, the first recipe tries to feed the entire
message into the "formail -D..." command while the second only feeds the
header.  Since it'll take one write system call either way, and at most
one more read system call in formail (but only on message with headers
greater than BUFSIZ bytes long), I count this as not being user visible.)


Philip Guenther