ZMailer.pm bug
Julian Field
mailscanner at ecs.soton.ac.uk
Thu Aug 5 16:24:03 IST 2004
<x-flowed>
These will be in the next release.
At 15:22 05/08/2004, you wrote:
>Hi, I've just detected a bug in two of my regexes in
>ZMailer.pm code.
>
>I'm sending the patch.
>Hope this is the last one (I've touched 2 o 3 times that code already)
>
>
>Here is the patch.
>
>------------------------------------------------------------------------------
>diff -Naur MailScanner-4.32.5.ORIG/lib/MailScanner/ZMailer.pm
>MailScanner-4.32.5/lib/MailScanner/ZMailer.pm
>--- MailScanner-4.32.5.ORIG/lib/MailScanner/ZMailer.pm Tue Jul 27
>13:31:05 2004
>+++ MailScanner-4.32.5/lib/MailScanner/ZMailer.pm Thu Aug 5
>11:06:41 2004
>@@ -567,13 +567,14 @@
> my $this = shift;
> my($message, $user) = @_;
>
>+ $user= quotemeta($user) if( $user );
> #my $userre=$user ? qr/.*\b$user\b/ : qr //;
>- my $userre=$user ? qr/(:?.*RCPT=rfc822;|\s*<?)$user(:?\s+.*|>?\s*)/i :
>qr /.*/;
>+ my $userre=$user
>? qr/(?:.*RCPT=rfc822;$user\s|\s*<?$user(?:[>\s]|$))/i : qr //;
> my($linenum);
> for ($linenum=0; $linenum<@{$message->{metadata}}; $linenum++) {
> # Looking for "recipient" lines
> #next unless $message->{metadata}[$linenum] =~ /^to(:?dsn)?\s$userre/;
>- next unless $message->{metadata}[$linenum] =~ /^to(:?dsn)?\s$userre/i;
>+ next unless $message->{metadata}[$linenum] =~ /^to(?:dsn)?\s$userre/i;
> # Have found the right line
> splice(@{$message->{metadata}}, $linenum, 1);
> $linenum--; # Study the same line again
>------------------------------------------------------------------------------
>
>
>Saludos
>
>--
>Leonardo Helman
>Pert Consultores
>Argentina
--
Julian Field
www.MailScanner.info
MailScanner thanks transtec Computers for their support
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
-------------------------- MailScanner list ----------------------
To leave, send leave mailscanner to jiscmail at jiscmail.ac.uk
Before posting, please see the Most Asked Questions at
http://www.mailscanner.biz/maq/ and the archives at
http://www.jiscmail.ac.uk/lists/mailscanner.html
</x-flowed>
More information about the MailScanner
mailing list