OT: Perl Cramp

--[ UxBoD ]-- uxbod at splatnix.net
Mon Oct 24 11:37:44 IST 2011


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.
-- 
Thanks, Phil

----- Original Message -----
> 
> On 22 Oct 2011, at 9:00 PM, --[ UxBoD ]-- wrote:
> 
> > $text =~ s/(<html\S+)>(\S+)/$1$html$2/i;
> 
> $text =~ s/(<html\s+\S+>)(\S+)/$html$1$2/i;
> 
> --
> Baruwa - www.baruwa.org
> 
> --
> MailScanner mailing list
> mailscanner at lists.mailscanner.info
> http://lists.mailscanner.info/mailman/listinfo/mailscanner
> 
> Before posting, read http://wiki.mailscanner.info/posting
> 
> Support MailScanner development - buy the book off the website!
> 


More information about the MailScanner mailing list