+ (void)fread(data_buffer, 1, 18, data_file);
+
+ What's happening is that spool_mbox used to use an fread to jump over the
+ file header. That fails under Cygwin because the header is locked, but
+ doing an fseek succeeds. We have to output the leading newline
+ explicitly, because the one in the file is parted of the locked area. */
+
+ if (!source_file_override)
+ (void)fseek(data_file, SPOOL_DATA_START_OFFSET, SEEK_SET);
+
+ do
+ {
+ j = fread(buffer, 1, sizeof(buffer), data_file);
+
+ if (j > 0)
+ {
+ i = fwrite(buffer, j, 1, mbox_file);
+ if (i != 1)
+ {
+ log_write(0, LOG_MAIN|LOG_PANIC, "Error/short write while writing \
+ message body to %s", mbox_path);
+ goto OUT;
+ }
+ }
+ } while (j > 0);
+
+ (void)fclose(mbox_file);
+ mbox_file = NULL;
+
+ Ustrncpy(spooled_message_id, message_id, sizeof(spooled_message_id));
+ spooled_message_id[sizeof(spooled_message_id)-1] = '\0';
+ spool_mbox_ok = 1;
+ }
+
+/* get the size of the mbox message and open [message_id].eml file for reading*/
+
+if ( !(yield = Ufopen(mbox_path,"rb"))
+ || fstat(fileno(yield), &statbuf) != 0
+ )
+ log_write(0, LOG_MAIN|LOG_PANIC, "%s", string_open_failed(errno,
+ "scan file %s", mbox_path));
+else