Fix 2-phase, in-order queue run delivery order
[exim.git] / src / src / transports / autoreply.c
index 690ec4a92a83756f8be0a6f615f44ec562d6c635..5ffc072152c314449ac94b3863caa58ea4fed492 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 - 2024 */
 /* 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 */
@@ -235,13 +235,12 @@ that needs to be removed */
 
 s = newlist + Ustrlen(newlist);
 while (s > newlist && (isspace(s[-1]) || s[-1] == ',')) s--;
-*s = 0;
+*s = '\0';
 
 /* Check to see if there any addresses left; if not, return NULL */
 
 s = newlist;
-while (s && isspace(*s)) s++;
-if (*s)
+if (Uskip_whitespace(&s))
   return newlist;
 
 store_reset(reset_point);
@@ -476,10 +475,9 @@ if (oncelog && *oncelog && to)
   else
     {
     EXIM_DATUM key_datum, result_datum;
-    uschar * dirname, * s;
+    uschar * s = Ustrrchr(oncelog, '/');
+    uschar * dirname = s ? string_copyn(oncelog, s - oncelog) : NULL;
 
-    dirname = (s = Ustrrchr(oncelog, '/'))
-      ? string_copyn(oncelog, s - oncelog) : NULL;
     if (!(dbm_file = exim_dbopen(oncelog, dirname, O_RDWR|O_CREAT, ob->mode)))
       {
       addr->transport_return = DEFER;
@@ -592,7 +590,7 @@ for (h = header_list; h; h = h->next)
 if (h)
   {
   message_id = Ustrchr(h->text, ':') + 1;
-  while (isspace(*message_id)) message_id++;
+  Uskip_whitespace(&message_id);
   fprintf(fp, "In-Reply-To: %s", message_id);
   }
 
@@ -812,3 +810,5 @@ return FALSE;
 #endif /*!MACRO_PREDEF*/
 #endif /*TRANSPORT_AUTOREPOL*/
 /* End of transport/autoreply.c */
+/* vi: aw ai sw=2
+*/