]> gitweb.michael.orlitzky.com - postfix-logwatch.git/commitdiff
Support respectful logging.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 1 Aug 2021 12:18:36 +0000 (08:18 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 1 Aug 2021 12:29:38 +0000 (08:29 -0400)
In postfix-3.6, setting respectful_logging=yes changes "whitelist" and
"blacklist" to "allowlist" and "denylist". We add support for the new
log entries that can be generated as a result.

postfix-logwatch

index 1b89ad6382b35928eccb9bb9e82bce5673c12b41..be28795b543c8f5288be27c1c488253e0333761d 100644 (file)
@@ -1278,8 +1278,8 @@ sub print_unmatched_report() {
 
        1978   SpamAssassin bypassed 
          18   Released from quarantine 
 
        1978   SpamAssassin bypassed 
          18   Released from quarantine 
-       1982   Whitelisted           
-          3   Blacklisted           
+       1982   Allowlisted           
+          3   Denylisted            
          12   MIME error            
          51   Bad header (debug supplemental) 
          28   Extra code modules loaded at runtime 
          12   MIME error            
          51   Bad header (debug supplemental) 
          28   Extra code modules loaded at runtime 
@@ -4370,7 +4370,12 @@ sub postfix_postscreen {
        ($line =~ /^(HANGUP) (?:after \S+)? from \[([^]]+)\](?::\d+)?/)) {
       $Counts{'postscreen'}{lc $1}{$2}{$END_KEY}++  if $Collecting{'postscreen'};
    }
        ($line =~ /^(HANGUP) (?:after \S+)? from \[([^]]+)\](?::\d+)?/)) {
       $Counts{'postscreen'}{lc $1}{$2}{$END_KEY}++  if $Collecting{'postscreen'};
    }
-   elsif ($line =~ /^(WHITELISTED|BLACKLISTED|PASS \S+) \[([^]]+)\](?::\d+)?$/) {
+   elsif ($line =~ /^((ALLOW|WHITE|BLACK|DENY)LISTED|PASS \S+) \[([^]]+)\](?::\d+)?$/) {
+      # This will display two separate counts for e.g. "allowlisted"
+      # and "whitelisted" if you change your configuration in the
+      # middle of the day, but I don't see that as a huge problem.
+      #
+      # ALLOWLISTED [40.92.75.48]:17085
       # PASS NEW [192.168.0.2]:12345
       # PASS OLD [192.168.0.3]:12345
       $Counts{'postscreen'}{lc $1}{$2}{$END_KEY}++  if $Collecting{'postscreen'};
       # PASS NEW [192.168.0.2]:12345
       # PASS OLD [192.168.0.3]:12345
       $Counts{'postscreen'}{lc $1}{$2}{$END_KEY}++  if $Collecting{'postscreen'};
@@ -4407,9 +4412,9 @@ sub postfix_postscreen {
       $Counts{'postscreen'}{'reject'}{"\u$4"}{$3}{$END_KEY}++      if $Collecting{'postscreen'};
    }
 
       $Counts{'postscreen'}{'reject'}{"\u$4"}{$3}{$END_KEY}++      if $Collecting{'postscreen'};
    }
 
-   elsif ($line =~ /^(?:WHITELIST VETO) \[([^]]+)\](?::\d+)?$/) {
+   elsif ($line =~ /^(?:(WHITE|ALLOW)LIST VETO) \[([^]]+)\](?::\d+)?$/) {
       # WHITELIST VETO [192.168.0.8]:43579
       # WHITELIST VETO [192.168.0.8]:43579
-      $Counts{'postscreen'}{'whitelist veto'}{$1}{$END_KEY}++  if $Collecting{'postscreen'};
+      $Counts{'postscreen'}{'allowlist veto'}{$1}{$END_KEY}++  if $Collecting{'postscreen'};
    }
 
    elsif ($line =~ /^(entering|leaving) STRESS mode with (\d+) connections$/) {
    }
 
    elsif ($line =~ /^(entering|leaving) STRESS mode with (\d+) connections$/) {