tidying
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 23 Apr 2023 21:24:30 +0000 (22:24 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 23 Apr 2023 21:24:30 +0000 (22:24 +0100)
src/src/daemon.c
src/src/filter.c
src/src/host.c
src/src/log.c
src/src/receive.c
src/src/routers/rf_self_action.c

index 8ceeac3a66a3325b03f685573fc2c3d9fc76b74e..ea7db0f252617d1cb0ad470f7c2ac9c210dc81cb 100644 (file)
@@ -564,7 +564,7 @@ if (pid == 0)
         smtp_log_no_mail();               /* Log no mail if configured */
         exim_underbar_exit(EXIT_SUCCESS);
         }
-      if (message_id[0] == 0) continue;   /* No message was accepted */
+      if (!message_id[0]) continue;    /* No message was accepted */
       }
     else                               /* bad smtp_setup_msg() */
       {
index d878acb8ff407b16988f1c95d9373833e4bfdbb1..fc6970f2300fb019ffb03485d6dce38979cbf29e 100644 (file)
@@ -1463,22 +1463,21 @@ switch (c->type)
     testing and verification. */
 
   case cond_errormsg:
-    yield = message_id[0] != 0 &&
-      (sender_address == NULL || sender_address[0] == 0);
+    yield = message_id[0] && (!sender_address || !*sender_address);
     break;
 
     /* Only FALSE if a message is actually being processed; TRUE for address
     and filter testing and verification. */
 
   case cond_firsttime:
-    yield = filter_test != FTEST_NONE || message_id[0] == 0 || f.deliver_firsttime;
+    yield = filter_test != FTEST_NONE || !message_id[0] || f.deliver_firsttime;
     break;
 
     /* Only TRUE if a message is actually being processed; FALSE for address
     testing and verification. */
 
   case cond_manualthaw:
-    yield = message_id[0] != 0 && f.deliver_manual_thaw;
+    yield = message_id[0] && f.deliver_manual_thaw;
     break;
 
     /* The foranyaddress condition loops through a list of addresses */
index 136ee89537801420c904b4ad963d563d37ef2f2c..9c66e9aacb71c562bfe003b3007c68fe437fc26f 100644 (file)
@@ -2078,11 +2078,11 @@ so we pass that back. */
 if (!host->address)
   {
   uschar *msg =
-    #ifndef STAND_ALONE
+#ifndef STAND_ALONE
     !message_id[0] && smtp_in
       ? string_sprintf("no IP address found for host %s (during %s)", host->name,
           smtp_get_connection_info()) :
-    #endif
+#endif
     string_sprintf("no IP address found for host %s", host->name);
 
   HDEBUG(D_host_lookup) debug_printf("%s\n", msg);
index 08ece6158eb41e02f087f65d01c3f3778ea3fbc5..54d2b8027418db56924b31915e172ebbf6979692 100644 (file)
@@ -996,7 +996,7 @@ if (LOGGING(pid))
   if (!syslog_pid) pid_position[1] = g->ptr;           /*  … and end+1 of the PID */
   }
 
-if (f.really_exim && message_id[0] != 0)
+if (f.really_exim && message_id[0])
   g = string_fmt_append(g, "%s ", message_id);
 
 if (flags & LOG_CONFIG)
index 94fa6d5deb129cd645adc184d2909a6d2677ae8a..19f8962c6bb8228626ca16f282aac95d70f9f2e8 100644 (file)
@@ -3143,9 +3143,8 @@ if (cutthrough.cctx.sock >= 0 && cutthrough.delivery)
       sender_address,
       sender_fullhost ? "H=" : "", sender_fullhost ? sender_fullhost : US"",
       sender_ident ? "U=" : "", sender_ident ? sender_ident : US"");
-    message_id[0] = 0;                       /* Indicate no message accepted */
     smtp_reply = US"550 Too many \"Received\" headers - suspected mail loop";
-    goto TIDYUP;                             /* Skip to end of function */
+    goto NOT_ACCEPTED;                         /* Skip to end of function */
     }
   received_header_gen();
   add_acl_headers(ACL_WHERE_RCPT, US"MAIL or RCPT");
@@ -3242,12 +3241,12 @@ if (!ferror(spool_data_file) && !(receive_feof)() && message_ended != END_DOT)
     case END_EOF:
       if (smtp_input)
        {
-       Uunlink(spool_name);                 /* Lose data file when closed */
+       Uunlink(spool_name);            /* Lose data file when closed */
        cancel_cutthrough_connection(TRUE, US"sender closed connection");
-       message_id[0] = 0;                   /* Indicate no message accepted */
+       message_id[0] = 0;              /* Indicate no message_accepted */
        smtp_reply = handle_lost_connection(US"");
        smtp_yield = FALSE;
-       goto TIDYUP;                         /* Skip to end of function */
+       goto TIDYUP;                            /* Skip to end of function */
        }
       break;
 
@@ -3272,8 +3271,7 @@ if (!ferror(spool_data_file) && !(receive_feof)() && message_ended != END_DOT)
       if (smtp_input)
        {
        smtp_reply = US"552 Message size exceeds maximum permitted";
-       message_id[0] = 0;               /* Indicate no message accepted */
-       goto TIDYUP;                     /* Skip to end of function */
+       goto NOT_ACCEPTED;                      /* Skip to end of function */
        }
       else
        {
@@ -3291,8 +3289,7 @@ if (!ferror(spool_data_file) && !(receive_feof)() && message_ended != END_DOT)
       Uunlink(spool_name);             /* Lose the data file when closed */
       cancel_cutthrough_connection(TRUE, US"sender protocol error");
       smtp_reply = US"";               /* Response already sent */
-      message_id[0] = 0;               /* Indicate no message accepted */
-      goto TIDYUP;                     /* Skip to end of function */
+      goto NOT_ACCEPTED;                       /* Skip to end of function */
     }
   }
 
@@ -3333,8 +3330,7 @@ if (fflush(spool_data_file) == EOF || ferror(spool_data_file) ||
       smtp_reply = US"451 Error while writing spool file";
       receive_swallow_smtp();
       }
-    message_id[0] = 0;               /* Indicate no message accepted */
-    goto TIDYUP;                     /* Skip to end of function */
+    goto NOT_ACCEPTED;                 /* Skip to end of function */
     }
 
   else
@@ -3567,8 +3563,7 @@ else
          if (smtp_handle_acl_fail(ACL_WHERE_DKIM, rc, user_msg, log_msg) != 0)
            smtp_yield = FALSE;    /* No more messages after dropped connection */
          smtp_reply = US"";       /* Indicate reply already sent */
-         message_id[0] = 0;       /* Indicate no message accepted */
-         goto TIDYUP;             /* Skip to end of function */
+         goto NOT_ACCEPTED;                    /* Skip to end of function */
          }
         }
       else
@@ -3649,10 +3644,7 @@ else
                           ? US"accepted"
                           : US"accepted for some recipients");
       if (recipients_count == 0)
-        {
-        message_id[0] = 0;       /* Indicate no message accepted */
-       goto TIDYUP;
-       }
+       goto NOT_ACCEPTED;
       }
     else
       prdr_requested = FALSE;
@@ -3686,8 +3678,7 @@ else
         if (smtp_handle_acl_fail(ACL_WHERE_DATA, rc, user_msg, log_msg) != 0)
           smtp_yield = FALSE;    /* No more messages after dropped connection */
         smtp_reply = US"";       /* Indicate reply already sent */
-        message_id[0] = 0;       /* Indicate no message accepted */
-        goto TIDYUP;             /* Skip to end of function */
+        goto NOT_ACCEPTED;                     /* Skip to end of function */
         }
       }
     }
@@ -3925,9 +3916,8 @@ else
     if (!smtp_batched_input)
       {
       smtp_respond(smtp_code, 3, TRUE, errmsg);
-      message_id[0] = 0;            /* Indicate no message accepted */
       smtp_reply = US"";            /* Indicate reply already sent */
-      goto TIDYUP;                  /* Skip to end of function */
+      goto NOT_ACCEPTED;                       /* Skip to end of function */
       }
     else
       moan_smtp_batch(NULL, "%s %s", smtp_code, errmsg);
@@ -4004,8 +3994,7 @@ else
     if (smtp_input)
       {
       smtp_reply = US"451 Error in writing spool file";
-      message_id[0] = 0;          /* Indicate no message accepted */
-      goto TIDYUP;
+      goto NOT_ACCEPTED;
       }
     else
       {
@@ -4035,8 +4024,7 @@ if (fflush(spool_data_file))
   if (smtp_input)
     {
     smtp_reply = US"451 Error in writing spool file";
-    message_id[0] = 0;          /* Indicate no message accepted */
-    goto TIDYUP;
+    goto NOT_ACCEPTED;
     }
   else
     {
@@ -4386,6 +4374,11 @@ if this happens?  We can at least log it; if it is observed on some platform
 then we can think about properly declaring the message not-received. */
 
 
+goto TIDYUP;
+
+NOT_ACCEPTED:
+message_id[0] = 0;                             /* Indicate no message accepted */
+
 TIDYUP:
 process_info[process_info_len] = 0;                    /* Remove message id */
 if (spool_data_file && cutthrough_done == NOT_TRIED)
index 73d07db404f3ecdb553ec4de92e5fe757c265a82..e5da4cb91bba9e3b531c10c1aad5dafecb92ea72 100644 (file)
@@ -74,7 +74,7 @@ switch (code)
     and where it has come from. Otherwise, during message delivery, the normal
     logging for the address will be sufficient. */
 
-    if (message_id[0] == 0)
+    if (!message_id[0])
       if (sender_fullhost)
        log_write(0, LOG_MAIN, "%s: %s (while verifying <%s> from host %s)",
          msg, addr->domain, addr->address, sender_fullhost);