Lookups: sub-path for dsearch
[exim.git] / src / src / exigrep.src
index 2c414fd31e6e223e68952fa4546e1353932cca08..a425ad03bdd982624b52c0989eb94d0288f314c7 100644 (file)
@@ -1,5 +1,10 @@
 #! PERL_COMMAND
 
+# Copyright (c) The Exim Maintainers 2020 - 2023
+# Copyright (c) 2007-2017 University of Cambridge.
+# See the file NOTICE for conditions of use and distribution.
+# SPDX-License-Identifier: GPL-2.0-or-later
+
 use warnings;
 use strict;
 BEGIN { pop @INC if $INC[-1] eq '.' };
@@ -8,10 +13,6 @@ use Pod::Usage;
 use Getopt::Long qw(:config no_ignore_case);
 use File::Basename;
 
-# Copyright (c) 2007-2017 University of Cambridge.
-# Copyright (c) The Exim Maintainers 2020 - 2021
-# See the file NOTICE for conditions of use and distribution.
-
 # Except when they appear in comments, the following placeholders in this
 # source are replaced when it is turned into a runnable script:
 #
@@ -87,7 +88,7 @@ sub do_line
   if (!/^\d{4}-/o) { $_ =~ s/^.*? exim\b.*?: //o; }
 
   return unless
-    my($date,$id) = /^(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d(?:\.\d+)? (?:[+-]\d{4} )?)(?:\[\d+\] )?(\w{6}\-\w{6}\-\w{2})?/o;
+    my($date,$id) = /^(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d(?:\.\d+)? (?:[+-]\d{4} )?)(?:\[\d+\] )?(\w{6}\-\w{6}\-\w{2}|\w{6}-\w{11}-\w{4})?/o;
 
   # Handle the case when the log line belongs to a specific message. We save
   # lines for specific messages until the message is complete. Then either print
@@ -128,7 +129,7 @@ sub do_line
     if (index($_, 'Completed') != -1 ||
        index($_, 'SMTP data timeout') != -1 ||
          (index($_, 'rejected') != -1 &&
-           /^(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d(?:\.\d+)? (?:[+-]\d{4} )?)(?:\[\d+\] )?\w{6}\-\w{6}\-\w{2} rejected/o))
+           /^(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d(?:\.\d+)? (?:[+-]\d{4} )?)(?:\[\d+\] )?(?:\w{6}\-\w{6}\-\w{2}|\w{6}-\w{11}-\w{4}) rejected/o))
       {
       if ($queue_time != -1 &&
          $saved{$id} =~ /^(\d{4}-\d\d-\d\d \d\d:\d\d:\d\d ([+-]\d{4} )?)/o)