- /* copy body file */
- if (!source_file_override)
- {
- message_subdir[1] = '\0';
- for (i = 0; i < 2; i++)
+ /* Copy body file. If the main receive still has it open then it is holding
+ a lock, and we must not close it (which releases the lock), so just use the
+ global file handle. */
+
+ if (source_file_override)
+ l_data_file = Ufopen(source_file_override, "rb");
+ else if (spool_data_file)
+ l_data_file = spool_data_file;
+ else
+ for (int i = 0; i < 2; i++)