Copyright updates:
[exim.git] / src / src / exim.c
index 06863347d81b7069c63334d390a0b761fee9d81a..118fe5c7cede206c07ace57a57fe715e70b03ebb 100644 (file)
@@ -2,7 +2,7 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) The Exim Maintainers 2020 - 2022 */
+/* Copyright (c) The Exim Maintainers 2020 - 2023 */
 /* Copyright (c) University of Cambridge 1995 - 2018 */
 /* See the file NOTICE for conditions of use and distribution. */
 /* SPDX-License-Identifier: GPL-2.0-or-later */
@@ -1026,47 +1026,53 @@ gstring * g = NULL;
 DEBUG(D_any) {} else g = show_db_version(g);
 
 g = string_cat(g, US"Support for:");
+#ifdef WITH_CONTENT_SCAN
+  g = string_cat(g, US" Content_Scanning");
+#endif
 #ifdef SUPPORT_CRYPTEQ
   g = string_cat(g, US" crypteq");
 #endif
+#ifdef EXPAND_DLFUNC
+  g = string_cat(g, US" Expand_dlfunc");
+#endif
 #if HAVE_ICONV
   g = string_cat(g, US" iconv()");
 #endif
 #if HAVE_IPV6
   g = string_cat(g, US" IPv6");
 #endif
-#ifdef HAVE_SETCLASSRESOURCES
-  g = string_cat(g, US" use_setclassresources");
-#endif
 #ifdef SUPPORT_PAM
   g = string_cat(g, US" PAM");
 #endif
 #ifdef EXIM_PERL
   g = string_cat(g, US" Perl");
 #endif
-#ifdef EXPAND_DLFUNC
-  g = string_cat(g, US" Expand_dlfunc");
-#endif
-#ifdef USE_TCP_WRAPPERS
-  g = string_cat(g, US" TCPwrappers");
-#endif
 #ifdef USE_GNUTLS
   g = string_cat(g, US" GnuTLS");
 #endif
+#ifdef SUPPORT_MOVE_FROZEN_MESSAGES
+  g = string_cat(g, US" move_frozen_messages");
+#endif
 #ifdef USE_OPENSSL
   g = string_cat(g, US" OpenSSL");
 #endif
+#if defined(CYRUS_PWCHECK_SOCKET)
+  g = string_cat(g, US" pwcheck");
+#endif
+#if defined(RADIUS_CONFIG_FILE)
+  g = string_cat(g, US" radius");
+#endif
 #ifndef DISABLE_TLS_RESUME
   g = string_cat(g, US" TLS_resume");
 #endif
 #ifdef SUPPORT_TRANSLATE_IP_ADDRESS
   g = string_cat(g, US" translate_ip_address");
 #endif
-#ifdef SUPPORT_MOVE_FROZEN_MESSAGES
-  g = string_cat(g, US" move_frozen_messages");
+#ifdef USE_TCP_WRAPPERS
+  g = string_cat(g, US" TCPwrappers");
 #endif
-#ifdef WITH_CONTENT_SCAN
-  g = string_cat(g, US" Content_Scanning");
+#ifdef HAVE_SETCLASSRESOURCES
+  g = string_cat(g, US" use_setclassresources");
 #endif
 #ifdef SUPPORT_DANE
   g = string_cat(g, US" DANE");
@@ -2022,7 +2028,14 @@ this here, because the -M options check their arguments for syntactic validity
 using mac_ismsgid, which uses this. */
 
 regex_ismsgid =
-  regex_must_compile(US"^(?:[^\\W_]{6}-){2}[^\\W_]{2}$", MCS_NOFLAGS, TRUE);
+  regex_must_compile(US"^(?:"
+         "[^\\W_]{" str(MESSAGE_ID_TIME_LEN) "}"
+         "-[^\\W_]{" str(MESSAGE_ID_PID_LEN) "}"
+         "-[^\\W_]{" str(MESSAGE_ID_SUBTIME_LEN) "}"
+       "|"
+         "(?:[^\\W_]{6}-){2}[^\\W_]{2}"                /* old ID format */
+       ")$",
+    MCS_NOFLAGS, TRUE);
 
 /* Precompile the regular expression that is used for matching an SMTP error
 code, possibly extended, at the start of an error message. Note that the
@@ -4465,7 +4478,8 @@ if (!f.admin_user)
      || queue_name_dest && prod_requires_admin
      || debugset && !f.running_in_test_harness
      )
-    exim_fail("exim:%s permission denied\n", debugset ? " debugging" : "");
+    exim_fail("exim:%s permission denied; not admin\n",
+             debugset ? " debugging" : "");
   }
 
 /* If the real user is not root or the exim uid, the argument for passing
@@ -4481,7 +4495,7 @@ if (  real_uid != root_uid && real_uid != exim_uid
       )  )
    && !f.running_in_test_harness
    )
-  exim_fail("exim: Permission denied\n");
+  exim_fail("exim: Permission denied; not exim user or root\n");
 
 /* If the caller is not trusted, certain arguments are ignored when running for
 real, but are permitted when checking things (-be, -bv, -bt, -bh, -bf, -bF).
@@ -5411,6 +5425,7 @@ if (host_checking)
     "**** This is not for real!\n\n",
       sender_host_address);
 
+  connection_id = getpid();
   memset(sender_host_cache, 0, sizeof(sender_host_cache));
   if (verify_check_host(&hosts_connection_nolog) == OK)
     {
@@ -5599,6 +5614,7 @@ because a log line has already been written for all its failure exists
 (usually "connection refused: <reason>") and writing another one is
 unnecessary clutter. */
 
+connection_id = getpid();
 if (smtp_input)
   {
   smtp_in = stdin;
@@ -5770,7 +5786,7 @@ for (BOOL more = TRUE; more; )
       int start, end, domain;
       uschar * errmess;
       /* There can be multiple addresses, so EXIM_DISPLAYMAIL_MAX (tuned for 1) is too short.
-       * We'll still want to cap it to something, just in case. */
+      We'll still want to cap it to something, just in case. */
       uschar * s = string_copy_taint(
        exim_str_fail_toolong(list[i], BIG_BUFFER_SIZE, "address argument"),
        GET_TAINTED);
@@ -6105,6 +6121,7 @@ MORELOOP:
   deliver_localpart_data = deliver_domain_data =
   recipient_data = sender_data = NULL;
   acl_var_m = NULL;
+  lookup_value = NULL;                            /* Can be set by ACL */
 
   store_reset(reset_point);
   }