ScamNailer info not updated [solved]

Mark Sapiro mark at msapiro.net
Tue May 14 04:31:34 IST 2013


On Wed May 8 19:45:47 IST 2013, Mark Sapiro wrote:
> On Mon Apr 29 16:07:20 IST 2013, Matt Hampton wrote:
> 
>> On it
>> 
>> DNS provider reset api keys
>> 
>> 
>> On 28 April 2013 17:09, Mark Sapiro <mark at msapiro.net> wrote:
>> 
>>> At this writing, it appears the latest Scamnailer data files are
>>> emails.2013-166 and emails.2013-166.15, but the DNS TXT record is still
>>>
>>> emails.msupdate.greylist.bastionmail.com. 3600 IN TXT "emails.2013-164.6"
>>>
>>> which points to data from 2 days ago.
> 
> 
> Any estimate on when this might be fixed?


Since this doesn't seem to be getting fixed, I have patched ScamNailer
with the attached patch which attempts to guess the current week and day
for the base and then retrieves daily updates until it gets a 404.

This is working for me.

Caveat: I'm a perl novice. There may be a better way.

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan
-------------- next part --------------
--- ScamNailer.orig	2013-05-13 20:14:05.000000000 -0700
+++ ScamNailer.new	2013-05-13 20:19:55.000000000 -0700
@@ -18,6 +18,7 @@
 use LWP::UserAgent;
 use FileHandle;
 use DirHandle;
+use Time::Local;
 
 # Output filename, goes into SpamAssassin. Can be over-ridden by just
 # adding the output filename on the command-line when you run this script.
@@ -216,6 +217,16 @@
 
   die "Failed to retrieve valid current details\n" if $currentbase eq "-1";
 
+  my $day = (gmtime)[6];
+  my $year = (gmtime)[5] + 1900;
+  my $janone = (gmtime(timegm(0,0,0,1,0,$year-1900)))[6];
+  my $week = sprintf ("%02d", int (((gmtime)[7] + $janone) / 7));
+  my $mybase = "$year-$week$day";
+  if ($currentbase lt $mybase) {
+    $currentbase = $mybase;
+    $currentupdate = 99;
+  }
+
   print "I am working with: Current: $currentbase - $currentupdate and Status: $status_base - $status_update\n" unless $quiet;
 
   my $generate=0;
@@ -273,8 +284,10 @@
         #print "Getting $urlbase . $currentbase.$i\n" unless $quiet;
         my $req = HTTP::Request->new(GET => $urlbase.$currentbase.".".$i);
         my $res = $ua->request($req);
-        warn "Failed to retrieve $urlbase$currentbase.$i"
-          unless $res->is_success;
+        unless ($res->is_success) {
+          warn "Failed to retrieve $urlbase$currentbase.$i";
+          $currentupdate = $i - 1;
+        }
         my $line;
         foreach $line (split("\n", $res->content)) {
           # Is it an addition?


More information about the MailScanner mailing list