summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/src/deliver.c2
-rw-r--r--src/src/dkim_transport.c18
-rw-r--r--src/src/globals.c2
-rw-r--r--src/src/globals.h2
-rw-r--r--src/src/pdkim/pdkim.c6
-rw-r--r--src/src/readconf.c1
-rw-r--r--src/src/receive.c49
-rw-r--r--src/src/spam.c4
-rw-r--r--src/src/spool_in.c7
-rw-r--r--src/src/spool_mbox.c60
-rw-r--r--src/src/spool_out.c5
-rw-r--r--src/src/transport.c111
-rw-r--r--src/src/transports/smtp.c3
-rw-r--r--src/src/verify.c1
14 files changed, 207 insertions, 64 deletions
diff --git a/src/src/deliver.c b/src/src/deliver.c
index 2787d0040..262ae454f 100644
--- a/src/src/deliver.c
+++ b/src/src/deliver.c
@@ -3890,14 +3890,12 @@ for (;;) /* Normally we do not repeat this loop */
maxpipe = 0;
FD_ZERO(&select_pipes);
for (poffset = 0; poffset < remote_max_parallel; poffset++)
- {
if (parlist[poffset].pid != 0)
{
int fd = parlist[poffset].fd;
FD_SET(fd, &select_pipes);
if (fd > maxpipe) maxpipe = fd;
}
- }
/* Stick in a 60-second timeout, just in case. */
diff --git a/src/src/dkim_transport.c b/src/src/dkim_transport.c
index 2aba56054..4538b36e3 100644
--- a/src/src/dkim_transport.c
+++ b/src/src/dkim_transport.c
@@ -45,9 +45,6 @@ DEBUG(D_transport) debug_printf("send file fd=%d size=%d\n", out_fd, size - off)
/*XXX should implement timeout, like transport_write_block_fd() ? */
-/* Rewind file */
-lseek(in_fd, off, SEEK_SET);
-
#ifdef HAVE_LINUX_SENDFILE
/* We can use sendfile() to shove the file contents
to the socket. However only if we don't use TLS,
@@ -69,6 +66,9 @@ else
{
int sread, wwritten;
+ /* Rewind file */
+ lseek(in_fd, off, SEEK_SET);
+
/* Send file down the original fd */
while((sread = read(in_fd, deliver_out_buffer, DELIVER_OUT_BUFFER_SIZE)) >0)
{
@@ -118,6 +118,7 @@ dkt_direct(transport_ctx * tctx, struct ob_dkim * dkim,
{
int save_fd = tctx->u.fd;
int save_options = tctx->options;
+BOOL save_wireformat = spool_file_wireformat;
uschar * hdrs, * dkim_signature;
int siglen, hsize;
const uschar * errstr;
@@ -125,7 +126,8 @@ BOOL rc;
DEBUG(D_transport) debug_printf("dkim signing direct-mode\n");
-/* Get headers in string for signing and transmission */
+/* Get headers in string for signing and transmission. Do CRLF
+and dotstuffing (but no body nor dot-termination) */
tctx->u.msg = NULL;
tctx->options = tctx->options & ~(topt_end_dot | topt_use_bdat)
@@ -155,14 +157,18 @@ else if (!(rc = dkt_sign_fail(dkim, &errno)))
/* Write the signature and headers into the deliver-out-buffer. This should
mean they go out in the same packet as the MAIL, RCPT and (first) BDAT commands
(transport_write_message() sizes the BDAT for the buffered amount) - for short
-messages, the BDAT LAST command. We want no CRLF or dotstuffing expansion */
+messages, the BDAT LAST command. We want no dotstuffing expansion here, it
+having already been done - but we have to say we want CRLF output format, and
+temporarily set the marker for possible already-CRLF input. */
-tctx->options &= ~(topt_use_crlf | topt_escape_headers);
+tctx->options &= ~topt_escape_headers;
+spool_file_wireformat = TRUE;
transport_write_reset(0);
if ( !write_chunk(tctx, dkim_signature, siglen)
|| !write_chunk(tctx, hdrs, hsize))
return FALSE;
+spool_file_wireformat = save_wireformat;
tctx->options = save_options | topt_no_headers | topt_continuation;
if (!(transport_write_message(tctx, 0)))
diff --git a/src/src/globals.c b/src/src/globals.c
index d61e894f3..f722fab12 100644
--- a/src/src/globals.c
+++ b/src/src/globals.c
@@ -1363,6 +1363,8 @@ uschar *spf_smtp_comment = NULL;
BOOL split_spool_directory = FALSE;
uschar *spool_directory = US SPOOL_DIRECTORY
"\0<--------------Space to patch spool_directory->";
+BOOL spool_file_wireformat = FALSE;
+BOOL spool_wireformat = FALSE;
#ifdef EXPERIMENTAL_SRS
uschar *srs_config = NULL;
uschar *srs_db_address = NULL;
diff --git a/src/src/globals.h b/src/src/globals.h
index 1c58a936b..e31517bf4 100644
--- a/src/src/globals.h
+++ b/src/src/globals.h
@@ -872,6 +872,8 @@ extern uschar *spf_smtp_comment; /* spf comment to include in SMTP reply *
#endif
extern BOOL split_spool_directory; /* TRUE to use multiple subdirs */
extern uschar *spool_directory; /* Name of spool directory */
+extern BOOL spool_file_wireformat; /* current -D file has CRLF rather than NL */
+extern BOOL spool_wireformat; /* can write wireformat -D files */
#ifdef EXPERIMENTAL_SRS
extern uschar *srs_config; /* SRS config secret:max age:hash length:use timestamp:use hash */
extern uschar *srs_db_address; /* SRS db address */
diff --git a/src/src/pdkim/pdkim.c b/src/src/pdkim/pdkim.c
index e4384d7f7..61e3161d4 100644
--- a/src/src/pdkim/pdkim.c
+++ b/src/src/pdkim/pdkim.c
@@ -1419,7 +1419,7 @@ while (sig)
}
DEBUG(D_acl) debug_printf(
- "PDKIM >> Header data for hash, canonicalized, in sequence >>>>>>>>>>>>>>\n");
+ "PDKIM >> Header data for hash, canonicalized, in sequence >>>>>>>>>>>>\n");
/* SIGNING ---------------------------------------------------------------- */
/* When signing, walk through our header list and add them to the hash. As we
@@ -1732,10 +1732,10 @@ DEBUG(D_acl)
pdkim_signature s = *sig;
ev_ctx vctx;
- debug_printf("PDKIM (checking verify key)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
+ debug_printf("PDKIM (checking verify key)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
if (!pdkim_key_from_dns(ctx, &s, &vctx, errstr))
debug_printf("WARNING: bad dkim key in dns\n");
- debug_printf("PDKIM (finished checking verify key)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
+ debug_printf("PDKIM (finished checking verify key)<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
}
return ctx;
}
diff --git a/src/src/readconf.c b/src/src/readconf.c
index 340a0c0eb..f43a3d163 100644
--- a/src/src/readconf.c
+++ b/src/src/readconf.c
@@ -432,6 +432,7 @@ static optionlist optionlist_config[] = {
#endif
{ "split_spool_directory", opt_bool, &split_spool_directory },
{ "spool_directory", opt_stringptr, &spool_directory },
+ { "spool_wireformat", opt_bool, &spool_wireformat },
#ifdef LOOKUP_SQLITE
{ "sqlite_lock_timeout", opt_int, &sqlite_lock_timeout },
#endif
diff --git a/src/src/receive.c b/src/src/receive.c
index 731c76d77..3d92a8479 100644
--- a/src/src/receive.c
+++ b/src/src/receive.c
@@ -1016,6 +1016,46 @@ for(;;)
/*NOTREACHED*/
}
+static int
+read_message_bdat_smtp_wire(FILE *fout)
+{
+int ch;
+
+/* Remember that this message uses wireformat. */
+
+DEBUG(D_receive) debug_printf("CHUNKING: writing spoolfile in wire format\n");
+spool_file_wireformat = TRUE;
+
+/* Unfortunately cannot use sendfile() even if not TLS
+as that requires (on linux) mmap-like operations on the input fd.
+
+XXX but worthwhile doing a block interface to the bdat_getc buffer
+in the future */
+
+for (;;) switch (ch = bdat_getc(GETC_BUFFER_UNLIMITED))
+ {
+ case EOF: return END_EOF;
+ case EOD: return END_DOT;
+ case ERR: return END_PROTOCOL;
+
+ default:
+ message_size++;
+/*XXX not done:
+linelength
+max_received_linelength
+body_linecount
+body_zerocount
+*/
+ if (fout)
+ {
+ if (fputc(ch, fout) == EOF) return END_WERROR;
+ if (message_size > thismessage_size_limit) return END_SIZE;
+ }
+ break;
+ }
+/*NOTREACHED*/
+}
+
@@ -3078,9 +3118,11 @@ if (!ferror(data_file) && !(receive_feof)() && message_ended != END_DOT)
{
if (smtp_input)
{
- message_ended = chunking_state > CHUNKING_OFFERED
- ? read_message_bdat_smtp(data_file)
- : read_message_data_smtp(data_file);
+ message_ended = chunking_state <= CHUNKING_OFFERED
+ ? read_message_data_smtp(data_file)
+ : spool_wireformat
+ ? read_message_bdat_smtp_wire(data_file)
+ : read_message_bdat_smtp(data_file);
receive_linecount++; /* The terminating "." line */
}
else message_ended = read_message_data(data_file);
@@ -4258,6 +4300,7 @@ if (smtp_input)
else if (chunking_state > CHUNKING_OFFERED)
{
+/*XXX rethink for spool_wireformat */
smtp_printf("250- %u byte chunk, total %d\r\n250 OK id=%s\r\n",
chunking_datasize, message_size+message_linecount, message_id);
chunking_state = CHUNKING_OFFERED;
diff --git a/src/src/spam.c b/src/src/spam.c
index 477ab62b4..49776a30d 100644
--- a/src/src/spam.c
+++ b/src/src/spam.c
@@ -265,9 +265,9 @@ if (spam_ok && Ustrcmp(prev_user_name, user_name) == 0)
return override ? OK : spam_rc;
/* make sure the eml mbox file is spooled up */
+
if (!(mbox_file = spool_mbox(&mbox_size, NULL, NULL)))
- {
- /* error while spooling */
+ { /* error while spooling */
log_write(0, LOG_MAIN|LOG_PANIC,
"%s error while creating mbox spool file", loglabel);
return DEFER;
diff --git a/src/src/spool_in.c b/src/src/spool_in.c
index 6ed566411..0bdf92e3b 100644
--- a/src/src/spool_in.c
+++ b/src/src/spool_in.c
@@ -284,6 +284,9 @@ sender_ident = NULL;
sender_local = FALSE;
sender_set_untrusted = FALSE;
smtp_active_hostname = primary_hostname;
+#ifndef COMPILE_UTILITY
+spool_file_wireformat = FALSE;
+#endif
tree_nonrecipients = NULL;
#ifdef EXPERIMENTAL_BRIGHTMAIL
@@ -603,6 +606,10 @@ for (;;)
else if (Ustrncmp(p, "pam_score_int ", 14) == 0)
spam_score_int = string_copy(big_buffer + 16);
#endif
+#ifndef COMPILE_UTILITY
+ else if (Ustrncmp(p, "pool_file_wireformat", 20) == 0)
+ spool_file_wireformat = TRUE;
+#endif
#if defined(SUPPORT_I18N) && !defined(COMPILE_UTILITY)
else if (Ustrncmp(p, "mtputf8", 7) == 0)
message_smtputf8 = TRUE;
diff --git a/src/src/spool_mbox.c b/src/src/spool_mbox.c
index 89bdb7ddc..8ca468a85 100644
--- a/src/src/spool_mbox.c
+++ b/src/src/spool_mbox.c
@@ -62,8 +62,8 @@ if (!spool_mbox_ok)
}
/* open [message_id].eml file for writing */
- mbox_file = modefopen(mbox_path, "wb", SPOOL_MODE);
- if (mbox_file == NULL)
+
+ if (!(mbox_file = modefopen(mbox_path, "wb", SPOOL_MODE)))
{
log_write(0, LOG_MAIN|LOG_PANIC, "%s", string_open_failed(errno,
"scan file %s", mbox_path));
@@ -80,33 +80,25 @@ if (!spool_mbox_ok)
"${if def:sender_address{X-Envelope-From: <${sender_address}>\n}}"
"${if def:recipients{X-Envelope-To: ${recipients}\n}}");
- if (temp_string != NULL)
- {
- i = fwrite(temp_string, Ustrlen(temp_string), 1, mbox_file);
- if (i != 1)
+ if (temp_string)
+ if (fwrite(temp_string, Ustrlen(temp_string), 1, mbox_file) != 1)
{
log_write(0, LOG_MAIN|LOG_PANIC, "Error/short write while writing \
mailbox headers to %s", mbox_path);
goto OUT;
}
- }
- /* write all header lines to mbox file */
- my_headerlist = header_list;
- for (my_headerlist = header_list; my_headerlist != NULL;
- my_headerlist = my_headerlist->next)
- {
- /* skip deleted headers */
- if (my_headerlist->type == '*') continue;
+ /* write all non-deleted header lines to mbox file */
- i = fwrite(my_headerlist->text, my_headerlist->slen, 1, mbox_file);
- if (i != 1)
- {
- log_write(0, LOG_MAIN|LOG_PANIC, "Error/short write while writing \
- message headers to %s", mbox_path);
- goto OUT;
- }
- }
+ for (my_headerlist = header_list; my_headerlist;
+ my_headerlist = my_headerlist->next)
+ if (my_headerlist->type != '*')
+ if (fwrite(my_headerlist->text, my_headerlist->slen, 1, mbox_file) != 1)
+ {
+ log_write(0, LOG_MAIN|LOG_PANIC, "Error/short write while writing \
+ message headers to %s", mbox_path);
+ goto OUT;
+ }
/* End headers */
if (fwrite("\n", 1, 1, mbox_file) != 1)
@@ -151,18 +143,32 @@ if (!spool_mbox_ok)
do
{
- j = fread(buffer, 1, sizeof(buffer), data_file);
+ uschar * s;
+
+ if (!spool_file_wireformat || source_file_override)
+ j = fread(buffer, 1, sizeof(buffer), data_file);
+ else /* needs CRLF -> NL */
+ if ((s = fgets(buffer, sizeof(buffer), data_file)))
+ {
+ uschar * p = s + Ustrlen(s) - 1;
+
+ if (*p == '\n' && p[-1] == '\r')
+ *--p = '\n';
+ else if (*p == '\r')
+ ungetc(*p--, data_file);
+
+ j = p - buffer;
+ }
+ else
+ j = 0;
if (j > 0)
- {
- i = fwrite(buffer, j, 1, mbox_file);
- if (i != 1)
+ if (fwrite(buffer, j, 1, mbox_file) != 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);
diff --git a/src/src/spool_out.c b/src/src/spool_out.c
index 652506fb3..ebe089d4f 100644
--- a/src/src/spool_out.c
+++ b/src/src/spool_out.c
@@ -197,7 +197,10 @@ tree_walk(acl_var_m, &acl_var_write, f);
/* Now any other data that needs to be remembered. */
-fprintf(f, "-body_linecount %d\n", body_linecount);
+if (spool_file_wireformat)
+ fprintf(f, "-spool_file_wireformat\n");
+else
+ fprintf(f, "-body_linecount %d\n", body_linecount);
fprintf(f, "-max_received_linelength %d\n", max_received_linelength);
if (body_zerocount > 0) fprintf(f, "-body_zerocount %d\n", body_zerocount);
diff --git a/src/src/transport.c b/src/src/transport.c
index 0f20efe1b..7806e3957 100644
--- a/src/src/transport.c
+++ b/src/src/transport.c
@@ -11,6 +11,10 @@ transports. */
#include "exim.h"
+#ifdef HAVE_LINUX_SENDFILE
+# include <sys/sendfile.h>
+#endif
+
/* Structure for keeping list of addresses that have been added to
Envelope-To:, in order to avoid duplication. */
@@ -483,13 +487,22 @@ for (ptr = start; ptr < end; ptr++)
chunk_ptr = deliver_out_buffer;
}
+ /* Remove CR before NL if required */
+
+ if ( *ptr == '\r' && ptr[1] == '\n'
+ && (!tctx || !(tctx->options & topt_use_crlf))
+ && spool_file_wireformat
+ )
+ ptr++;
+
if ((ch = *ptr) == '\n')
{
int left = end - ptr - 1; /* count of chars left after NL */
/* Insert CR before NL if required */
- if (tctx && tctx->options & topt_use_crlf) *chunk_ptr++ = '\r';
+ if (tctx && tctx->options & topt_use_crlf && !spool_file_wireformat)
+ *chunk_ptr++ = '\r';
*chunk_ptr++ = '\n';
transport_newlines++;
@@ -749,9 +762,7 @@ for (h = header_list; h; h = h->next) if (h->type != htype_old)
/* Header removed */
else
- {
DEBUG(D_transport) debug_printf("removed header line:\n%s---\n", h->text);
- }
}
/* Add on any address-specific headers. If there are multiple addresses,
@@ -890,7 +901,7 @@ Returns: TRUE on success; FALSE (with errno) on failure.
BOOL
internal_transport_write_message(transport_ctx * tctx, int size_limit)
{
-int len;
+int len, size = 0;
/* Initialize pointer in output buffer. */
@@ -906,17 +917,21 @@ if (tctx->check_string && tctx->escape_string)
nl_escape_length = Ustrlen(nl_escape);
}
+/* Whether the escaping mechanism is applied to headers or not is controlled by
+an option (set for SMTP, not otherwise). Negate the length if not wanted till
+after the headers. */
+
+if (!(tctx->options & topt_escape_headers))
+ nl_check_length = -nl_check_length;
+
/* Write the headers if required, including any that have to be added. If there
-are header rewriting rules, apply them. */
+are header rewriting rules, apply them. The datasource is not the -D spoolfile
+so temporarily hide the global that adjusts for its format. */
if (!(tctx->options & topt_no_headers))
{
- /* Whether the escaping mechanism is applied to headers or not is controlled by
- an option (set for SMTP, not otherwise). Negate the length if not wanted till
- after the headers. */
-
- if (!(tctx->options & topt_escape_headers))
- nl_check_length = -nl_check_length;
+ BOOL save_wireformat = spool_file_wireformat;
+ spool_file_wireformat = FALSE;
/* Add return-path: if requested. */
@@ -925,7 +940,7 @@ if (!(tctx->options & topt_no_headers))
uschar buffer[ADDRESS_MAXLENGTH + 20];
int n = sprintf(CS buffer, "Return-path: <%.*s>\n", ADDRESS_MAXLENGTH,
return_path);
- if (!write_chunk(tctx, buffer, n)) return FALSE;
+ if (!write_chunk(tctx, buffer, n)) goto bad;
}
/* Add envelope-to: if requested */
@@ -938,19 +953,18 @@ if (!(tctx->options & topt_no_headers))
struct aci *dlist = NULL;
void *reset_point = store_get(0);
- if (!write_chunk(tctx, US"Envelope-to: ", 13)) return FALSE;
+ if (!write_chunk(tctx, US"Envelope-to: ", 13)) goto bad;
/* Pick up from all the addresses. The plist and dlist variables are
anchors for lists of addresses already handled; they have to be defined at
this level because write_env_to() calls itself recursively. */
for (p = tctx->addr; p; p = p->next)
- if (!write_env_to(p, &plist, &dlist, &first, tctx))
- return FALSE;
+ if (!write_env_to(p, &plist, &dlist, &first, tctx)) goto bad;
/* Add a final newline and reset the store used for tracking duplicates */
- if (!write_chunk(tctx, US"\n", 1)) return FALSE;
+ if (!write_chunk(tctx, US"\n", 1)) goto bad;
store_reset(reset_point);
}
@@ -960,7 +974,7 @@ if (!(tctx->options & topt_no_headers))
{
uschar buffer[100];
int n = sprintf(CS buffer, "Delivery-date: %s\n", tod_stamp(tod_full));
- if (!write_chunk(tctx, buffer, n)) return FALSE;
+ if (!write_chunk(tctx, buffer, n)) goto bad;
}
/* Then the message's headers. Don't write any that are flagged as "old";
@@ -970,7 +984,13 @@ if (!(tctx->options & topt_no_headers))
addr is not NULL. */
if (!transport_headers_send(tctx, &write_chunk))
+ {
+bad:
+ spool_file_wireformat = save_wireformat;
return FALSE;
+ }
+
+ spool_file_wireformat = save_wireformat;
}
/* When doing RFC3030 CHUNKING output, work out how much data would be in a
@@ -988,7 +1008,7 @@ suboptimal. */
if (tctx->options & topt_use_bdat)
{
off_t fsize;
- int hsize, size = 0;
+ int hsize;
if ((hsize = chunk_ptr - deliver_out_buffer) < 0)
hsize = 0;
@@ -999,7 +1019,7 @@ if (tctx->options & topt_use_bdat)
if (size_limit > 0 && fsize > size_limit)
fsize = size_limit;
size = hsize + fsize;
- if (tctx->options & topt_use_crlf)
+ if (tctx->options & topt_use_crlf && !spool_file_wireformat)
size += body_linecount; /* account for CRLF-expansion */
/* With topt_use_bdat we never do dot-stuffing; no need to
@@ -1039,6 +1059,52 @@ negative in cases where it isn't to apply to the headers). Then ensure the body
is positioned at the start of its file (following the message id), then write
it, applying the size limit if required. */
+/* If we have a wireformat -D file (CRNL lines, non-dotstuffed, no ending dot)
+and we want to send a body without dotstuffing or ending-dot, in-clear,
+then we can just dump it using sendfile.
+This should get used for CHUNKING output and also for writing the -K file for
+dkim signing, when we had CHUNKING input. */
+
+#ifdef HAVE_LINUX_SENDFILE
+if ( spool_file_wireformat
+ && !(tctx->options & (topt_no_body | topt_end_dot))
+ && !nl_check_length
+ && tls_out.active != tctx->u.fd
+ )
+ {
+ ssize_t copied = 0;
+ off_t offset = SPOOL_DATA_START_OFFSET;
+
+ /* Write out any header data in the buffer */
+
+ if ((len = chunk_ptr - deliver_out_buffer) > 0)
+ {
+ if (!transport_write_block(tctx, deliver_out_buffer, len, TRUE))
+ return FALSE;
+ size -= len;
+ }
+
+ DEBUG(D_transport) debug_printf("using sendfile for body\n");
+
+ while(size > 0)
+ {
+ if ((copied = sendfile(tctx->u.fd, deliver_datafile, &offset, size)) <= 0) break;
+ size -= copied;
+ }
+ return copied >= 0;
+ }
+#else
+DEBUG(D_transport) debug_printf("cannot use sendfile for body: no support\n");
+#endif
+
+DEBUG(D_transport)
+ if (!(tctx->options & topt_no_body))
+ debug_printf("cannot use sendfile for body: %s\n",
+ !spool_file_wireformat ? "spoolfile not wireformat"
+ : tctx->options & topt_end_dot ? "terminating dot wanted"
+ : nl_check_length ? "dot- or From-stuffing wanted"
+ : "TLS output wanted");
+
if (!(tctx->options & topt_no_body))
{
int size = size_limit;
@@ -1077,6 +1143,7 @@ return (len = chunk_ptr - deliver_out_buffer) <= 0 ||
+
/*************************************************
* External interface to write the message *
*************************************************/
@@ -1098,6 +1165,7 @@ BOOL
transport_write_message(transport_ctx * tctx, int size_limit)
{
BOOL last_filter_was_NL = TRUE;
+BOOL save_spool_file_wireformat = spool_file_wireformat;
int rc, len, yield, fd_read, fd_write, save_errno;
int pfd[2] = {-1, -1};
pid_t filter_pid, write_pid;
@@ -1215,8 +1283,10 @@ DEBUG(D_transport) debug_printf("copying from the filter\n");
/* Copy the output of the filter, remembering if the last character was NL. If
no data is returned, that counts as "ended with NL" (default setting of the
-variable is TRUE). */
+variable is TRUE). The output should always be unix-format as we converted
+any wireformat source on writing input to the filter. */
+spool_file_wireformat = FALSE;
chunk_ptr = deliver_out_buffer;
for (;;)
@@ -1256,6 +1326,7 @@ there has been an error, kill the processes before waiting for them, just to be
sure. Also apply a paranoia timeout. */
TIDY_UP:
+spool_file_wireformat = save_spool_file_wireformat;
save_errno = errno;
(void)close(fd_read);
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index e28a5bfe6..ecba054a2 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -2254,6 +2254,9 @@ included in the count.) */
if (sx->peer_offered & PEER_OFFERED_SIZE)
{
+/*XXX problem here under spool_files_wireformat?
+Or just forget about lines? Or inflate by a fixed proportion? */
+
sprintf(CS p, " SIZE=%d", message_size+message_linecount+sx->ob->size_addition);
while (*p) p++;
}
diff --git a/src/src/verify.c b/src/src/verify.c
index 706d42a0f..6a50af506 100644
--- a/src/src/verify.c
+++ b/src/src/verify.c
@@ -1344,6 +1344,7 @@ tctx.tblock = cutthrough.addr.transport;
tctx.addr = &cutthrough.addr;
tctx.check_string = US".";
tctx.escape_string = US"..";
+/*XXX check under spool_files_wireformat. Might be irrelevant */
tctx.options = topt_use_crlf;
if (!transport_headers_send(&tctx, &cutthrough_write_chunk))