OT: Perl Cramp

Andrew Colin Kissa andrew at topdog.za.net
Mon Oct 24 11:50:19 IST 2011


On 24 Oct 2011, at 12:37 PM, --[ UxBoD ]-- wrote:

> Thanks Andrew.
> 
> Actually this has turned out to be a real pain the neck due to the way HTML email is constructing and presented within a queue file! When examining to see where to inject the ZendTo claim information the <body> section looks like:
> 
> </o:shapelayout></xml><![endif]--></head><body lang=3DEN-US link=3Dblue vli=
> nk=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>This is a 25MB f=
> ile for testing.<o></o></p></div></body></html>=
> 
> So instead of using a simple regex, or even lookahead/lookbehind, I have had to check each individual line for the open and close tags! Hopefully this will make it more error free as-well.

You probably need to use an xml / html parser, i would use lxml on python, am not sure which perl module provides similar functionality.

--
Baruwa - www.baruwa.org



More information about the MailScanner mailing list