int rc = FAIL;
int msg_size = 0;
int process_info_len = Ustrlen(process_info);
-int error_rc = (error_handling == ERRORS_SENDER)?
- errors_sender_rc : EXIT_FAILURE;
+int error_rc = error_handling == ERRORS_SENDER
+ ? errors_sender_rc : EXIT_FAILURE;
int header_size = 256;
int start, end, domain;
int id_resolution;
because the group setting doesn't always get set automatically. */
if (fchown(data_fd, exim_uid, exim_gid))
- log_write(0, LOG_MAIN|LOG_PANIC_DIE,
- "Failed setting ownership on spool file %s: %s",
- spool_name, strerror(errno));
+{
+ int chown_errno = errno;
+ struct stat buf;
+
+ /* On NFSv4 with UID mapping the above fchown() might fail. If the
+ file is owned by the proper uid and gid, we won't report this failure. */
+ if (fstat(data_fd, &buf))
+ log_write(0, LOG_MAIN|LOG_PANIC_DIE,
+ "Failed to stat on spool file %s: %s",
+ spool_name, strerror(errno));
+
+ if (buf.st_uid != exim_uid || buf.st_gid != exim_gid)
+ log_write(0, LOG_MAIN|LOG_PANIC_DIE,
+ "Failed setting ownership on spool file %s: %s",
+ spool_name, strerror(chown_errno));
+}
(void)fchmod(data_fd, SPOOL_MODE);
/* We now have data file open. Build a stream for it and lock it. We lock only
case '4': /* Temp-reject. Keep spoolfiles and accept, unless defer-pass mode.
... for which, pass back the exact error */
if (cutthrough.defer_pass) smtp_reply = string_copy_malloc(msg);
- /*FALLTRHOUGH*/
+ cutthrough_done = TMP_REJ; /* Avoid the usual immediate delivery attempt */
+ break; /* message_id needed for SMTP accept below */
default: /* Unknown response, or error. Treat as temp-reject. */
+ if (cutthrough.defer_pass) smtp_reply = US"450 Onward transmission not accepted";
cutthrough_done = TMP_REJ; /* Avoid the usual immediate delivery attempt */
break; /* message_id needed for SMTP accept below */
if (deliver_freeze) log_write(0, LOG_MAIN, "frozen by %s", frozen_by);
if (queue_only_policy) log_write(L_delay_delivery, LOG_MAIN,
"no immediate delivery: queued%s%s by %s",
- *queue_name ? " in " : "", *queue_name ? CS queue_name : "",
+ *queue_name ? " in " : "", *queue_name ? CS queue_name : "",
queued_by);
}
receive_call_bombout = FALSE;