Package: logwatch
Version: 7.4.1-2
Severity: normal
Tags: patch

Dear Maintainer,

logwatch's postfix script looks for error messages from the openspf filter - 
the postfix-policyd-spf-perl package in Debian. A pattern is used that includes 
the website www.openspf.org. However, the postfix-policyd-spf-perl generates 
log entries with a URI ending in .net, so the pattern match fails.

The attached patch changes the pattern matching to look for www.openspf.net 
instead.


-- System Information:
Debian Release: 8.0
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=da_DK.UTF-8, LC_CTYPE=da_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages logwatch depends on:
ii  perl                            5.20.2-3
ii  postfix [mail-transport-agent]  2.11.3-1

Versions of packages logwatch recommends:
ii  libdate-manip-perl  6.47-1
ii  libsys-cpu-perl     0.61-1+b1

Versions of packages logwatch suggests:
pn  fortune-mod  <none>

-- no debconf information
--- postfix	2014-10-06 19:44:55.000000000 +0200
+++ /usr/share/logwatch/scripts/services/postfix	2015-05-05 07:12:48.656079328 +0200
@@ -1831,7 +1831,7 @@
         $line =~ /^Attribute: / or
         # handler sender_policy_framework: is decisive. 
         $line =~ /^handler [^:]+/ or
-        # decided action=REJECT Please see http://www.openspf.org/why.html?sender=jrzjcez%40telecomitalia.it&ip=81.178.62.236&receiver=protegate1.zmi.at 
+        # decided action=REJECT Please see http://www.openspf.net/why.html?sender=jrzjcez%40telecomitalia.it&ip=81.178.62.236&receiver=protegate1.zmi.at 
         $line =~ /^decided action=/ or
 
         # pypolicyd-spf-0.7.1
@@ -1936,7 +1936,7 @@
    ($domain, $ip, $message, $mechanism) = ('*unknown', '*unknown', '', '*unavailable');
    #print "LINE: '$line'\n";
 
-   # postfix-policyd-spf-perl: http://www.openspf.org/Software
+   # postfix-policyd-spf-perl: http://www.openspf.net/Software
    if ($line =~ /^Policy action=(.*)$/) {
       $line = $1;
 
@@ -1957,10 +1957,10 @@
          return;
       }
 
-      if ($line =~ /^550 Please see http:\/\/www\.openspf\.org\/Why\?(.*)$/) {
-         # Policy action=550 Please see http://www.openspf.org/Why?s=mfrom&id=from%40example.com&ip=10.0.0.1&r=example.net
-         # Policy action=550 Please see http://www.openspf.org/Why?s=helo;id=mailout03.example.com;ip=192.168.0.1;r=mx1.example.net 
-         # Policy action=550 Please see http://www.openspf.org/Why?id=someone%40example.com&ip=10.0.0.1&receiver=vps.example.net
+      if ($line =~ /^550 Please see http:\/\/www\.openspf\.net\/Why\?(.*)$/) {
+         # Policy action=550 Please see http://www.openspf.net/Why?s=mfrom&id=from%40example.com&ip=10.0.0.1&r=example.net
+         # Policy action=550 Please see http://www.openspf.net/Why?s=helo;id=mailout03.example.com;ip=192.168.0.1;r=mx1.example.net 
+         # Policy action=550 Please see http://www.openspf.net/Why?id=someone%40example.com&ip=10.0.0.1&receiver=vps.example.net
 
          my %params;
          for (split /[&;]/, $1) {
@@ -1971,7 +1971,7 @@
          $params{'s'} = '*unknown' unless $params{'s'};
          #print "Please see...:\n\tMessage: $message\n\tIP: $ip\n\tDomain: $domain\n";
          $Totals{'policyspf'}++;
-         $Counts{'policyspf'}{'Policy Action'}{'550 reject'}{'See http://www.openspf.org/Why?...'}{$params{'s'}}{$params{'ip'}}{$params{'id'}}++   if ($Logreporters::TreeData::Collecting{'policyspf'});
+         $Counts{'policyspf'}{'Policy Action'}{'550 reject'}{'See http://www.openspf.net/Why?...'}{$params{'s'}}{$params{'ip'}}{$params{'id'}}++   if ($Logreporters::TreeData::Collecting{'policyspf'});
          return;
       }
 

Reply via email to