procmail
[Top] [All Lists]

Re: Recovering Number of Lines or Size of Mail

1999-04-12 11:31:57
Hello Lars,

"LH" == Lars Hecking <lhecking(_at_)nmrc(_dot_)ucc(_dot_)ie> writes:

LH> Ralph SOBEK writes:

Procmail has the number of lines of a piece of mail internally
since there are the operators '<' and '>', right?  Is it possible to
recover this number of lines, or size, in a variable?  I would like to
recover this in a variable within procmail.

LH> This is the first, and so far last :), scoring recipe I wrote

LH> :0BH
LH> * 1^1 ^.*$
LH> { }
LH> LINES=$=

LH> The condition line adds 1 (one) to the score for every line in header and
LH> body. $= contains the score of the last recipe. man procmailsc for details.

Thanks a lot!  Looks okay.  But to the Procmail Guru's, how costly is
it to run this scoring recipe?  It looks expensive to me!!  Maybe less
expensive than piping the message to `wc -l', but still expensive.

What do you folks say?

Cheers from southern France,

        --Ralph

Dr. Ralph P. Sobek                Disclaimer: The above ruminations are my own.
Ralph(_dot_)Sobek(_at_)irit(_dot_)fr                       Addresses are 
ordered by importance.
sobek(_at_)irit(_dot_)fr                                                If all 
else fails, try:
newsmaster(_at_)irit(_dot_)fr, postmaster(_at_)irit(_dot_)fr             
sobek(_at_)diva(_dot_)eecs(_dot_)berkeley(_dot_)edu
Ph:(+33)[0]561558618  FAX:(+33)[0]561556258  http://www.irit.fr/~Ralph.Sobek/
===============================================================================
Urgent!! Greenhouse Effect: http://www.irit.fr/~Ralph.Sobek/greenhouse.html