is it 100,000,000 10,000,000 or 1,000,000,000?

Mariano Absatz mailscanner at LISTS.COM.AR
Fri Apr 11 23:32:18 IST 2003


(Sorry for the duplicate... the attachment will be easier to take from _this_
message)

Hi,

I just modified MailScanner::Config.pm so you can write large numbers in
MailScanner.conf with the perlish "_" as a thousand separator... well, in
fact it is used as a transparent character, you can group it as you like.

I use it to write:
Max Unscanned Bytes Per Scan = 100_000_000
Max Unsafe Bytes Per Scan = 50_000_000

instead of:
Max Unscanned Bytes Per Scan = 100000000
Max Unsafe Bytes Per Scan = 50000000

but nobody prevents you from writing:
Max Unscanned Bytes Per Scan = 100_00_0_00__0
Max Unsafe Bytes Per Scan = 50_000000___

although it doesn't seem useful to me :-)

I didn't test it inside a ruleset, but it should also work.

I'm enclosing a patch for MailScanner-4.14-9




--
Mariano Absatz
El Baby
----------------------------------------------------------
I started out with nothing & still have most of it left.



-------------- next part --------------
diff -Naur MailScanner-4.14-9/lib/MailScanner/Config.pm MailScanner-4.14-9.underscore/lib/MailScanner/Config.pm
--- MailScanner-4.14-9/lib/MailScanner/Config.pm        Sun Mar 30 14:20:45 2003
+++ MailScanner-4.14-9.underscore/lib/MailScanner/Config.pm     Fri Apr 11 19:18:24 2003
@@ -1230,8 +1230,9 @@
       $internal .= $word;
     } elsif ($rulesettype =~ /number/i) {
       # Number rules can only contain digits and dots
-      return undef unless $word =~ /^[\d.]+$/;
+      return undef unless $word =~ /^[\d._]+$/;
       $internal .= ' ' if $internal ne "";
+      $word =~ s/_//g;
       $internal .= $word;
     } elsif ($rulesettype =~ /command/i) {
       # Command rules must contain executable as first
@@ -1552,7 +1553,7 @@

   my($first, $isrules);
   $first = $File{$keyword};
-  $isrules = 1 if $first !~ /^[\d.]*$/; # Rules aren't all digits or .
+  $isrules = 1 if $first !~ /^[\d._]*$/; # Rules aren't all digits or . or _

   # It might be a function name
   if ($first =~ /^&/) {


More information about the MailScanner mailing list