X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Freceive.c;h=3e950ffc6e86280a8487848a18a4cd4eb939b0cb;hb=44c16250ddbeef7b3c93cde26f97164f5d6c85bc;hp=df8719ec666a6eaeea95ea890405a673911045f8;hpb=2983e1a616058c03b57f1ab32a691f8b8ff9764e;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/receive.c b/src/src/receive.c index df8719ec6..3e950ffc6 100644 --- a/src/src/receive.c +++ b/src/src/receive.c @@ -176,6 +176,7 @@ else empty item in a list. */ if (*p == 0) p = US":"; + /* should never be a tainted list */ while ((path = string_nextinlist(&p, &sep, buffer, sizeof(buffer)))) if (Ustrcmp(path, "syslog") != 0) break; @@ -1228,9 +1229,8 @@ if (acl_removed_headers) const uschar * list = acl_removed_headers; int sep = ':'; /* This is specified as a colon-separated list */ uschar *s; - uschar buffer[128]; - while ((s = string_nextinlist(&list, &sep, buffer, sizeof(buffer)))) + while ((s = string_nextinlist(&list, &sep, NULL, 0))) if (header_testname(h, s, Ustrlen(s), FALSE)) { h->type = htype_old; @@ -1784,7 +1784,7 @@ if (sender_host_address) dmarc_init(); /* initialize libopendmarc */ ids, and fractions of a second are required. See the comments that precede the message id creation below. */ -(void)gettimeofday(&message_id_tv, NULL); +exim_gettime(&message_id_tv); /* For other uses of the received time we can operate with granularity of one second, and for that we use the global variable received_time. This is for @@ -2806,7 +2806,7 @@ From:) but we still want to ensure a valid Sender: if it is required. */ if ( !from_header && ((!sender_host_address && !f.suppress_local_fixups) || f.submission_mode)) { - uschar *oname = US""; + const uschar * oname = US""; /* Use the originator_name if this is a locally submitted message and the caller is not trusted. For trusted callers, use it only if -F was used to @@ -4004,7 +4004,7 @@ if (LOGGING(tls_certificate_verified) && tls_in.cipher) if (LOGGING(tls_peerdn) && tls_in.peerdn) g = string_append(g, 3, US" DN=\"", string_printing(tls_in.peerdn), US"\""); if (LOGGING(tls_sni) && tls_in.sni) - g = string_append(g, 3, US" SNI=\"", string_printing(tls_in.sni), US"\""); + g = string_append(g, 2, US" SNI=", string_printing2(tls_in.sni, SP_TAB|SP_SPACE)); #endif if (sender_host_authenticated) @@ -4177,12 +4177,10 @@ response, but the chance of this happening should be small. */ if (smtp_input && sender_host_address && !f.sender_host_notsocket && !receive_smtp_buffered()) { - struct timeval tv; + struct timeval tv = {.tv_sec = 0, .tv_usec = 0}; fd_set select_check; FD_ZERO(&select_check); FD_SET(fileno(smtp_in), &select_check); - tv.tv_sec = 0; - tv.tv_usec = 0; if (select(fileno(smtp_in) + 1, &select_check, NULL, NULL, &tv) != 0) { @@ -4375,12 +4373,17 @@ if (smtp_input) else if (chunking_state > CHUNKING_OFFERED) { - smtp_printf("250- %u byte chunk, total %d\r\n250 OK id=%s\r\n", FALSE, + /* If there is more input waiting, no need to flush (probably the client + pipelined QUIT after data). We check only the in-process buffer, not + the socket. */ + + smtp_printf("250- %u byte chunk, total %d\r\n250 OK id=%s\r\n", + receive_smtp_buffered(), chunking_datasize, message_size+message_linecount, message_id); chunking_state = CHUNKING_OFFERED; } else - smtp_printf("250 OK id=%s\r\n", FALSE, message_id); + smtp_printf("250 OK id=%s\r\n", receive_smtp_buffered(), message_id); if (host_checking) fprintf(stdout,