procmail
[Top] [All Lists]

clue to my earlier problem

1997-11-09 17:02:01
I found a critical difference.  This, while theoretically sensible and effi-
cient, bombs part way through with a memory fault:

formail "${(_at_)}" -R 'From ' Old-From_: -a 'From ' -Yezs procmail .${0##*/}

If I break it up into two formail calls (well, actually n+1 where n is the
number of messages processed), this script is no better:

formail "${(_at_)}" -Yez -R 'From ' Old-From_: -a 'From ' -s \
   formail -s procmail .${0##*/}

but moving the -z option to the second formail prevents the memory faults and
makes a solid, reliable script:

formail "${(_at_)}" -Ye -R 'From ' Old-From_: -a 'From ' -s \
   formail -zs procmail .${0##*/}

Why does the inefficient way use less memory?  And why does moving -z make a
difference?

Results are the same whether "$@" is unset or has some parameters and whether
there is a program invoked by [the last] formail -s or just a default write
to stdout.  It seems mainly to be a factor of how much text formail -s has
to go through, even if a +n option tells it to skip messages instead of
processing them.

Now, this command rarely hits a memory fault (it used to but it hasn't
for months, and the one above does all the time lately), no matter how
large the folder, and it includes -z:

formail -R Subject: Subject: -R Reply-To: Reply-To: -R From: From: \
-R Date: Date: -XFrom -XDate: -XReply-To: -XSubject: -X---ition: \
-cezks < $tmp/digin.$$ > $tmp/digraw.$$

(The -R options are to canonalize the capitalizations of those header lines.)

Again, here is `uname -a`:

SunOS anago.wwa.com 5.6 Generic sun4u sparc SUNW,Ultra-2

and of course, formail's version is 3.11pre7.

<Prev in Thread] Current Thread [Next in Thread>
  • clue to my earlier problem, David W. Tamkin <=