exim-exigrey.pl
changeset 57 9db6f9fdba12
parent 55 ab282b335eb5
--- a/exim-exigrey.pl	Tue May 24 16:33:08 2016 +0200
+++ b/exim-exigrey.pl	Tue May 24 17:24:04 2016 +0200
@@ -43,7 +43,7 @@
 # defer  condition = ${perl{unseen}{<$sender_address>:<$local_part@$domain>/$sender_host_address}}
 #
 # record structure: key:   item\0
-#                   value: timestamp(creation) timestamp(usage)\0
+#                   value: timestamp(creation) timestamp(usage)[ auto]\0
 # (This way we're compatible with ${lookup{...}dbm{...}})
 #
 # dbm file is relativ to $spool_directory/grey, EXCEPT its name
@@ -103,7 +103,7 @@
 sub whitelist {
     my ($item, $h) = @_;
     my $now = time;
-    $h->{"$item\0"} = "$now $now 1\0";
+    $h->{"$item\0"} = "$now $now 1 auto\0";
 }
 
 sub is_whitelisted {
@@ -112,8 +112,8 @@
 
     return 0 if not exists $h->{$key};
     
-    my ($t0, undef, $cnt) = split ' ', $h->{$key};
-    $h->{$key} = join(' ' => $t0, time, ++$cnt) . "\0";
+    my ($t0, undef, $cnt, $flag) = split ' ', $h->{$key};
+    $h->{$key} = join(' ' => $t0, time, ++$cnt, $flag ? $flag : ()) . "\0";
 
     return 1;
 }