int i;
BOOL include_header = TRUE;
- list = tblock->remove_headers;
+ list = tblock ? tblock->remove_headers : NULL;
for (i = 0; i < 2; i++) /* For remove_headers && addr->prop.remove_headers */
{
if (list)
if (include_header)
{
- if (tblock->rewrite_rules)
+ if (tblock && tblock->rewrite_rules)
{
void *reset_point = store_get(0);
header_line *hh;
noops. An added header string from a transport may not end with a newline;
add one if it does not. */
-if ((list = CUS tblock->add_headers))
+if (tblock && (list = CUS tblock->add_headers))
{
int sep = '\n';
uschar * s;
before being written to the incoming fd. First set up the special processing to
be done during the copying. */
-use_crlf = (tctx->options & topt_use_crlf) != 0;
+use_crlf = (tctx->options & topt_use_crlf) != 0;
nl_partial_match = -1;
if (tctx->check_string && tctx->escape_string)
if (filter_pid < 0) goto TIDY_UP; /* errno set */
DEBUG(D_transport)
- debug_printf("process %d running as transport filter: write=%d read=%d\n",
+ debug_printf("process %d running as transport filter: fd_write=%d fd_read=%d\n",
(int)filter_pid, fd_write, fd_read);
/* Fork subprocess to write the message to the filter, and return the result
(void)close(pfd[pipe_read]);
nl_check_length = nl_escape_length = 0;
+ tctx->check_string = tctx->escape_string = NULL;
tctx->options &= ~(topt_use_crlf | topt_end_dot);
rc = internal_transport_write_message(fd_write, tctx, size_limit);
nl_check_length = nl_escape_length = 0;
if ( tctx->options & topt_end_dot
&& ( last_filter_was_NL
- ? !write_chunk(fd, US".\n", 2, tctx->options)
- : !write_chunk(fd, US"\n.\n", 3, tctx->options)
+ ? !write_chunk(fd, US".\n", 2, use_crlf)
+ : !write_chunk(fd, US"\n.\n", 3, use_crlf)
) )
yield = FALSE;
mailbox TESTSUITE/test-mail/userx is locked
writing to file TESTSUITE/test-mail/userx
writing data block fd=dddd size=sss timeout=0
-process pppp running as transport filter: write=dddd read=dddd
+process pppp running as transport filter: fd_write=10 fd_read=11
writing data block fd=dddd size=sss timeout=0
process pppp writing to transport filter
copying from the filter