procmail
[Top] [All Lists]

Re: empty body

2004-02-09 16:52:26
Ruud H.G. van Tol replied to my addition:

<> > Hmmm -- may I suggest adding a test on message size before feeding a
<> > (possibly huge) msg body to the regex?
<> > 
<> >   :0: # I chose 500 bytes to allow for maillists with many relay-hops
<> >   * < 500
<> >   * $ B ?? ^^([$WS]|$)*^^
<> >   empty-body.mbox
<> 
<> Would that really be better? The regexp is false at the first 
<> non-whitespace in the body. And what if the body contained 
<> just over 500 bytes of whitespace? 
<> 
<> To calculate the size of the body, it needs to read the whole 
<> body anyway...
<> 
<> Is B limited by LINEBUF?
<> 
<> Q5: Isn't that '< 500' just limiting the headersize?

According to procmailrc, the "<" test looks at the total message
length, so header and body.  In the case of a zero length body, it
would end up being the header only, of course.

Procmail must know the total size of the message (Well, it does have
to malloc() space for it <g>) without having to explicitly count
(recount?) the number of bytes.

My idea was to use that to skip passing a regex over the content of $B
if the bodycannot reasonably be empty.  In most cases I agree it
wouldn't make any difference, but when you consider the email an old
friend just sent -- a 3.2MB mpeg file (+sigh+) -- i CAN SEE MERIT IN
not checking it at all ...

LINEBUF refers only to the lenght of things from the rc file, not the
email itself, so that concern is moot here.

Reto
-- 
Reto L.  rali(_at_)tifosi(_dot_)com

"... I've seen Sun monitors on fire off the side of the multimedia lab.
 I've seen NTU lights glitter in the dark near the Mail Gate.
 All these things will be lost in time, like the root partition last
 week.  Time to die...". - Peter Gutmann in alt.sysadmin.recovery

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