{
if (testflag(addr, af_pipelining))
g = string_catn(g, US" L", 2);
-#ifdef SUPPORT_PIPE_CONNECT
+#ifndef DISABLE_PIPE_CONNECT
if (testflag(addr, af_early_pipe))
g = string_catn(g, US"*", 1);
#endif
tls_out.peercert = addr->peercert;
addr->peercert = NULL;
+ tls_out.ver = addr->tlsver;
tls_out.cipher = addr->cipher;
tls_out.peerdn = addr->peerdn;
tls_out.ocsp = addr->ocsp;
#ifndef DISABLE_TLS
tls_free_cert(&tls_out.ourcert);
tls_free_cert(&tls_out.peercert);
+ tls_out.ver = NULL;
tls_out.cipher = NULL;
tls_out.peerdn = NULL;
tls_out.ocsp = OCSP_NOT_REQ;
uschar *s;
int ret;
- if( (ret = write(pfd[pipe_write], &addr2->transport_return, sizeof(int))) != sizeof(int)
- || (ret = write(pfd[pipe_write], &transport_count, sizeof(transport_count))) != sizeof(transport_count)
- || (ret = write(pfd[pipe_write], &addr2->flags, sizeof(addr2->flags))) != sizeof(addr2->flags)
- || (ret = write(pfd[pipe_write], &addr2->basic_errno, sizeof(int))) != sizeof(int)
- || (ret = write(pfd[pipe_write], &addr2->more_errno, sizeof(int))) != sizeof(int)
- || (ret = write(pfd[pipe_write], &addr2->delivery_usec, sizeof(int))) != sizeof(int)
- || (ret = write(pfd[pipe_write], &addr2->special_action, sizeof(int))) != sizeof(int)
- || (ret = write(pfd[pipe_write], &addr2->transport,
+ if( (ret = os_pipe_write(pfd[pipe_write], &addr2->transport_return, sizeof(int))) != sizeof(int)
+ || (ret = os_pipe_write(pfd[pipe_write], &transport_count, sizeof(transport_count))) != sizeof(transport_count)
+ || (ret = os_pipe_write(pfd[pipe_write], &addr2->flags, sizeof(addr2->flags))) != sizeof(addr2->flags)
+ || (ret = os_pipe_write(pfd[pipe_write], &addr2->basic_errno, sizeof(int))) != sizeof(int)
+ || (ret = os_pipe_write(pfd[pipe_write], &addr2->more_errno, sizeof(int))) != sizeof(int)
+ || (ret = os_pipe_write(pfd[pipe_write], &addr2->delivery_usec, sizeof(int))) != sizeof(int)
+ || (ret = os_pipe_write(pfd[pipe_write], &addr2->special_action, sizeof(int))) != sizeof(int)
+ || (ret = os_pipe_write(pfd[pipe_write], &addr2->transport,
sizeof(transport_instance *))) != sizeof(transport_instance *)
/* For a file delivery, pass back the local part, in case the original
logging. */
|| (testflag(addr2, af_file)
- && ( (ret = write(pfd[pipe_write], &local_part_length, sizeof(int))) != sizeof(int)
- || (ret = write(pfd[pipe_write], addr2->local_part, local_part_length)) != local_part_length
+ && ( (ret = os_pipe_write(pfd[pipe_write], &local_part_length, sizeof(int))) != sizeof(int)
+ || (ret = os_pipe_write(pfd[pipe_write], addr2->local_part, local_part_length)) != local_part_length
)
)
)
for (i = 0, s = addr2->message; i < 2; i++, s = addr2->user_message)
{
int message_length = s ? Ustrlen(s) + 1 : 0;
- if( (ret = write(pfd[pipe_write], &message_length, sizeof(int))) != sizeof(int)
- || message_length > 0 && (ret = write(pfd[pipe_write], s, message_length)) != message_length
+ if( (ret = os_pipe_write(pfd[pipe_write], &message_length, sizeof(int))) != sizeof(int)
+ || message_length > 0 && (ret = os_pipe_write(pfd[pipe_write], s, message_length)) != message_length
)
log_write(0, LOG_MAIN|LOG_PANIC, "Failed writing transport results to pipe: %s",
ret == -1 ? strerror(errno) : "short write");
for (addr2 = addr; addr2; addr2 = addr2->next)
{
- if ((len = read(pfd[pipe_read], &status, sizeof(int))) > 0)
+ if ((len = os_pipe_read(pfd[pipe_read], &status, sizeof(int))) > 0)
{
int i;
uschar **sptr;
addr2->transport_return = status;
- len = read(pfd[pipe_read], &transport_count,
+ len = os_pipe_read(pfd[pipe_read], &transport_count,
sizeof(transport_count));
- len = read(pfd[pipe_read], &addr2->flags, sizeof(addr2->flags));
- len = read(pfd[pipe_read], &addr2->basic_errno, sizeof(int));
- len = read(pfd[pipe_read], &addr2->more_errno, sizeof(int));
- len = read(pfd[pipe_read], &addr2->delivery_usec, sizeof(int));
- len = read(pfd[pipe_read], &addr2->special_action, sizeof(int));
- len = read(pfd[pipe_read], &addr2->transport,
+ len = os_pipe_read(pfd[pipe_read], &addr2->flags, sizeof(addr2->flags));
+ len = os_pipe_read(pfd[pipe_read], &addr2->basic_errno, sizeof(int));
+ len = os_pipe_read(pfd[pipe_read], &addr2->more_errno, sizeof(int));
+ len = os_pipe_read(pfd[pipe_read], &addr2->delivery_usec, sizeof(int));
+ len = os_pipe_read(pfd[pipe_read], &addr2->special_action, sizeof(int));
+ len = os_pipe_read(pfd[pipe_read], &addr2->transport,
sizeof(transport_instance *));
if (testflag(addr2, af_file))
{
int llen;
- if ( read(pfd[pipe_read], &llen, sizeof(int)) != sizeof(int)
+ if ( os_pipe_read(pfd[pipe_read], &llen, sizeof(int)) != sizeof(int)
|| llen > 64*4 /* limit from rfc 5821, times I18N factor */
)
{
}
/* sanity-checked llen so disable the Coverity error */
/* coverity[tainted_data] */
- if (read(pfd[pipe_read], big_buffer, llen) != llen)
+ if (os_pipe_read(pfd[pipe_read], big_buffer, llen) != llen)
{
log_write(0, LOG_MAIN|LOG_PANIC, "bad local_part read"
" from delivery subprocess");
for (i = 0, sptr = &addr2->message; i < 2; i++, sptr = &addr2->user_message)
{
int message_length;
- len = read(pfd[pipe_read], &message_length, sizeof(int));
+ len = os_pipe_read(pfd[pipe_read], &message_length, sizeof(int));
if (message_length > 0)
{
- len = read(pfd[pipe_read], big_buffer, message_length);
+ len = os_pipe_read(pfd[pipe_read], big_buffer, message_length);
big_buffer[big_buffer_size-1] = '\0'; /* guard byte */
if (len > 0) *sptr = string_copy(big_buffer);
}
switch (*subid)
{
case '1':
- addr->cipher = NULL;
- addr->peerdn = NULL;
+ addr->tlsver = addr->cipher = addr->peerdn = NULL;
if (*ptr)
+ {
addr->cipher = string_copy(ptr);
+ addr->tlsver = string_copyn(ptr, Ustrchr(ptr, ':') - ptr);
+ }
while (*ptr++);
if (*ptr)
addr->peerdn = string_copy(ptr);
case 'L':
switch (*subid)
{
-#ifdef SUPPORT_PIPE_CONNECT
+#ifndef DISABLE_PIPE_CONNECT
case 2: setflag(addr, af_early_pipe); /*FALLTHROUGH*/
#endif
case 1: setflag(addr, af_pipelining); break;
DEBUG(D_deliver) debug_printf("header write id:%c,subid:%c,size:%ld,final:%s\n",
id, subid, (long)size, pipe_header);
-if ((ret = writev(fd, iov, 2)) != total_len)
+if ((ret = os_pipe_writev(fd, iov, 2)) != total_len)
log_write(0, LOG_MAIN|LOG_PANIC_DIE,
"Failed writing transport result to pipe (%ld of %ld bytes): %s",
(long)ret, (long)total_len, ret == -1 ? strerror(errno) : "short write");
#endif
if (testflag(addr, af_pipelining))
-#ifdef SUPPORT_PIPE_CONNECT
+#ifndef DISABLE_PIPE_CONNECT
if (testflag(addr, af_early_pipe))
rmt_dlv_checked_write(fd, 'L', '2', NULL, 0);
else
/* Precompile some regex that are used to recognize parameters in response
to an EHLO command, if they aren't already compiled. */
- deliver_init();
+ smtp_deliver_init();
/* Now sort the addresses if required, and do the deliveries. The yield of
do_remote_deliveries is FALSE when mua_wrapper is set and all addresses
void
-deliver_init(void)
+tcp_init(void)
{
#ifdef EXIM_TFO_PROBE
tfo_probe();
#else
f.tcp_fastopen_ok = TRUE;
#endif
-
-
-if (!regex_PIPELINING) regex_PIPELINING =
- regex_must_compile(US"\\n250[\\s\\-]PIPELINING(\\s|\\n|$)", FALSE, TRUE);
-
-if (!regex_SIZE) regex_SIZE =
- regex_must_compile(US"\\n250[\\s\\-]SIZE(\\s|\\n|$)", FALSE, TRUE);
-
-if (!regex_AUTH) regex_AUTH =
- regex_must_compile(AUTHS_REGEX, FALSE, TRUE);
-
-#ifndef DISABLE_TLS
-if (!regex_STARTTLS) regex_STARTTLS =
- regex_must_compile(US"\\n250[\\s\\-]STARTTLS(\\s|\\n|$)", FALSE, TRUE);
-#endif
-
-if (!regex_CHUNKING) regex_CHUNKING =
- regex_must_compile(US"\\n250[\\s\\-]CHUNKING(\\s|\\n|$)", FALSE, TRUE);
-
-#ifndef DISABLE_PRDR
-if (!regex_PRDR) regex_PRDR =
- regex_must_compile(US"\\n250[\\s\\-]PRDR(\\s|\\n|$)", FALSE, TRUE);
-#endif
-
-#ifdef SUPPORT_I18N
-if (!regex_UTF8) regex_UTF8 =
- regex_must_compile(US"\\n250[\\s\\-]SMTPUTF8(\\s|\\n|$)", FALSE, TRUE);
-#endif
-
-if (!regex_DSN) regex_DSN =
- regex_must_compile(US"\\n250[\\s\\-]DSN(\\s|\\n|$)", FALSE, TRUE);
-
-if (!regex_IGNOREQUOTA) regex_IGNOREQUOTA =
- regex_must_compile(US"\\n250[\\s\\-]IGNOREQUOTA(\\s|\\n|$)", FALSE, TRUE);
-
-#ifdef SUPPORT_PIPE_CONNECT
-if (!regex_EARLY_PIPE) regex_EARLY_PIPE =
- regex_must_compile(US"\\n250[\\s\\-]" EARLY_PIPE_FEATURE_NAME "(\\s|\\n|$)", FALSE, TRUE);
-#endif
}