Support timeout option on malware=
[exim.git] / src / src / spool_mbox.c
index bdeb2b1a66fea44eb5626cadf42b84796b00611d..edc28034c89d5b687fa95161f01a3adc81e8e12f 100644 (file)
@@ -26,7 +26,9 @@ uschar spooled_message_id[17];
 /* returns a pointer to the FILE, and puts the size in bytes into mbox_file_size
  * normally, source_file_override is NULL */
 
-FILE *spool_mbox(unsigned long *mbox_file_size, uschar *source_file_override) {
+FILE *
+spool_mbox(unsigned long *mbox_file_size, const uschar *source_file_override)
+{
   uschar message_subdir[2];
   uschar buffer[16384];
   uschar *temp_string;
@@ -96,7 +98,11 @@ FILE *spool_mbox(unsigned long *mbox_file_size, uschar *source_file_override) {
     };
 
     /* End headers */
-    (void)fwrite("\n", 1, 1, mbox_file);
+    if (fwrite("\n", 1, 1, mbox_file) != 1) {
+      log_write(0, LOG_MAIN|LOG_PANIC, "Error/short write while writing \
+        message headers to %s", mbox_path);
+      goto OUT;
+    }
 
     /* copy body file */
     if (source_file_override == NULL) {