On Wednesday 24 July 2002 09:43 am, Michael Moncur wrote:

> This would be an easy rule to add to SA but I'm wondering about speed -
> stripping HTML tags is a messy regexp and SA already does this. Is there a
> way for the same eval test to access the 'rawbody' and 'body' parts at the
> same time? It looked to me like my only choice right now would be to make
> it a rawbody test and strip the tags myself.

Bug 601 (http://bugzilla.spamassassin.org/show_bug.cgi?id=601) has a patch 
that caches the results of the get_XYZ_text_array() functions, so you can 
call them anywhere without any performance hit.  I haven't commited it to 
CVS, because my own testing indicates that, counter to expectations, such 
caching causes a slight slowdown in SA.

You'd probably also want avoid having to do a join() on the text array, since 
that can take some time and memory for a large message.  You could get a sum 
of the length of the text lines thusly:

   map($sum += length($_), @array);

Woo-hoo!  Ain't Perl keen? ;-)

-- 
Give a man a match, and he'll be warm for a minute, but set him on
fire, and he'll be warm for the rest of his life.

ICQ: 132152059 | Advanced SPAM filtering software: http://spamassasin.org


-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing 
real-time communications platform! Don't just IM. Build it in! 
http://www.jabber.com/osdn/xim
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to