Exinext: handle new-format message IDs
[exim.git] / src / src / exinext.src
index 7fe80c796312fe0ba0d51e9de077947a1a747f2d..882ad5f6076ed1d7ec7cd6a7268b13cc06fcbe7f 100644 (file)
@@ -1,7 +1,7 @@
 #! /bin/sh
-# $Cambridge: exim/src/src/exinext.src,v 1.3 2007/07/29 21:49:46 magnus Exp $
 
-# Copyright (c) 1996-2004 University of Cambridge.
+# Copyright (c) The Exim Maintainers 2023
+# Copyright (c) University of Cambridge, 1995 - 2007
 # See the file NOTICE for conditions of use and distribution.
 
 # Except when they appear in comments, the following placeholders in this
@@ -26,16 +26,23 @@ config=
 eximmacdef=
 exim_path=
 
-if expr $1 : '\-' >/dev/null ; then
-  while expr $1 : '\-' >/dev/null ; do
+if [ "x$1" = x--version -o "x$1" = x-v ]
+then
+    echo "`basename $0`: $0"
+    echo "build: EXIM_RELEASE_VERSIONEXIM_VARIANT_VERSION"
+    exit 0
+fi
+
+if expr -- $1 : '\-' >/dev/null ; then
+  while expr -- $1 : '\-' >/dev/null ; do
     if [ "$1" = "-C" ]; then
       config=$2
       shift
       shift
-    elif expr $1 : '\-D' >/dev/null ; then
+    elif expr -- $1 : '\-D' >/dev/null ; then
       eximmacdef="$eximmacdef $1"
-      if expr $1 : '\-DEXIM_PATH=' >/dev/null ; then
-        exim_path=`expr $1 : '\-DEXIM_PATH=\(.*\)'`
+      if expr -- $1 : '\-DEXIM_PATH=' >/dev/null ; then
+        exim_path=`expr -- $1 : '\-DEXIM_PATH=\(.*\)'`
       fi
       shift
     else
@@ -116,6 +123,9 @@ fi
 
 perl - $exim_path "$eximmacdef" $argone $spool_directory $qualify_domain $config <<'End'
 
+  # We don't import anything, but guard against future changes which do
+  BEGIN { pop @INC if $INC[-1] eq '.' };
+
   # Name the arguments
 
   $exim = $ARGV[0];
@@ -153,6 +163,7 @@ perl - $exim_path "$eximmacdef" $argone $spool_directory $qualify_domain $config
 
   if (scalar(@list) == 0)
     {
+    push(@list, $subject) if $subject =~ /^\w{6}-\w{11}-\w{4}$/;
     push(@list, $subject) if $subject =~ /^\w{6}-\w{6}-\w{2}$/;
 
     if ($subject !~ /\@/ && $subject !~ /\./)