custom function

Julian Field mailscanner at ecs.soton.ac.uk
Tue Jul 13 18:59:59 IST 2004


At 17:23 13/07/2004, you wrote:
>sub InternalForward {
>   my($fromac, $fromdomain, $final);
>   my($message) = @_;
>   $fromac = lc(@{$message->{to}});  // <--- that messed up line

$fromac = lc($message->{from});

>   $fromdomain = $fromac;

$fromdomain = lc($message->{fromdomain});

>   $fromac =~ s/\@.*$//;   # Leave everything before @
>   $fromdomain =~ s/^.*\@//; # Leave everything after  @

Delete that line.


>   $final = 'forward ' . $fromac . '-spam@' . $fromdomain;
>   MailScanner::Log::InfoLog('$final');

Change that to
         MailScanner::Log::InfoLog("%s", $final);
so that you don't get attacked by format string vulnerabilities.

>   return $final;
>}

--
Julian Field
www.MailScanner.info
Professional Support Services at www.MailScanner.biz
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



More information about the MailScanner mailing list