]> git.proxmox.com Git - pmg-api.git/commitdiff
pmg-smtp-filter: use safebrowsing hit detection
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 1 Dec 2017 12:13:10 +0000 (13:13 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 1 Dec 2017 12:13:10 +0000 (13:13 +0100)
bin/pmg-smtp-filter

index 7f1212c0e32bc8cb5729491b0990c96919d26a37..8ede309bc3f7e74ce7e935c1d2528975dc739097 100755 (executable)
@@ -624,7 +624,8 @@ sub handle_smtp {
 
     $queue = $smtp->{queue};
     $queue->{sa} = $self->{sa};
-    $queue->{safe_browsing_score} = $pmg_cfg->get('spam', 'safe_browsing_score');
+    $queue->{safe_browsing_score} =
+       $opt_testmode ? 100 : $pmg_cfg->get('spam', 'safe_browsing_score');
 
     $queue->{lic_valid} = 1;
 
@@ -673,7 +674,7 @@ sub handle_smtp {
        my $vinfo = PMG::Utils::analyze_virus(
            $queue, $queue->{dataname}, $pmg_cfg, $opt_testmode);
 
-       if ($vinfo && $vinfo =~ m/^Safebrowsing\.(.+)$/) {
+       if ($vinfo && $vinfo =~ m/^Heuristics\.Safebrowsing\.(.+)$/) {
            my $hit = $1;
            $self->log(3, "$queue->{logid}: Google Safe Browsing database hit '%s'", $hit);
            $queue->{safe_browsing} = $hit;