SNI for ${readsocket }
[exim.git] / src / src / spool_in.c
index 940baa4197abd5a822e678a3a242a6cca4342e83..1291197de42a5cdf3eae0ca7b44c3fc8bcff1068 100644 (file)
@@ -2,9 +2,10 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
+/* Copyright (c) The Exim Maintainers 2020 - 2022 */
 /* Copyright (c) University of Cambridge 1995 - 2018 */
-/* Copyright (c) The Exim Maintainers 2020 - 2021 */
 /* See the file NOTICE for conditions of use and distribution. */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 
 /* Functions for reading spool files. When compiling for a utility (eximon),
 not all are needed, and some functionality can be cut out. */
@@ -63,13 +64,7 @@ for (int i = 0; i < 2; i++)
    * No -D file inside the spool area should be a symlink.
    */
   if ((fd = Uopen(fname,
-#ifdef O_CLOEXEC
-                     O_CLOEXEC |
-#endif
-#ifdef O_NOFOLLOW
-                     O_NOFOLLOW |
-#endif
-                     O_RDWR | O_APPEND, 0)) >= 0)
+                 EXIM_CLOEXEC | EXIM_NOFOLLOW | O_RDWR | O_APPEND, 0)) >= 0)
     break;
   save_errno = errno;
   if (errno == ENOENT)
@@ -300,6 +295,9 @@ message_smtputf8 = FALSE;
 message_utf8_downconvert = 0;
 #endif
 
+#ifndef COMPILE_UTILITY
+debuglog_name[0] = '\0';
+#endif
 dsn_ret = 0;
 dsn_envid = NULL;
 }
@@ -498,15 +496,18 @@ for (;;)
   if (*var == '(')                             /* marker for quoted value */
     {
     uschar * s;
-    int idx;
     for (s = ++var; *s != ')'; ) s++;
 #ifndef COMPILE_UTILITY
-    if ((idx = search_findtype(var, s - var)) < 0)
       {
-      DEBUG(D_any) debug_printf("Unrecognised quoter %.*s\n", (int)(s - var), var+1);
-      goto SPOOL_FORMAT_ERROR;
+      int idx;
+      if ((idx = search_findtype(var, s - var)) < 0)
+       {
+       DEBUG(D_any)
+         debug_printf("Unrecognised quoter %.*s\n", (int)(s - var), var+1);
+       goto SPOOL_FORMAT_ERROR;
+       }
+      proto_mem = store_get_quoted(1, GET_TAINTED, idx);
       }
-    proto_mem = store_get_quoted(1, GET_TAINTED, idx);
 #endif  /* COMPILE_UTILITY */
     var = s + 1;
     }
@@ -594,11 +595,16 @@ for (;;)
     case 'd':
     if (Ustrcmp(p, "eliver_firsttime") == 0)
       f.deliver_firsttime = TRUE;
-    /* Check if the dsn flags have been set in the header file */
     else if (Ustrncmp(p, "sn_ret", 6) == 0)
       dsn_ret= atoi(CS var + 7);
     else if (Ustrncmp(p, "sn_envid", 8) == 0)
       dsn_envid = string_copy_taint(var + 10, proto_mem);
+#ifndef COMPILE_UTILITY
+    else if (Ustrncmp(p, "ebug_selector ", 14) == 0)
+      debug_selector = strtol(CS var + 15, NULL, 0);
+    else if (Ustrncmp(p, "ebuglog_name ", 13) == 0)
+      debug_logging_from_spool(var + 14);
+#endif
     break;
 
     case 'f':