X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fsrc%2Freceive.c;h=2d88d6476e355f489f2253c35b6e11edb6e5c5b4;hb=ab1604ea9202d3dbc0fd7fd230dc693d83d3092c;hp=83613092fea8b2d7eb32e1eae335584206d70142;hpb=81344b40e3de597f60758926e5e1ae7a81dd5457;p=exim.git diff --git a/src/src/receive.c b/src/src/receive.c index 83613092f..2d88d6476 100644 --- a/src/src/receive.c +++ b/src/src/receive.c @@ -216,7 +216,7 @@ if (STATVFS(CS path, &statbuf) != 0) log_write(0, LOG_MAIN|LOG_PANIC, "cannot accept message: failed to stat " "%s directory %s: %s", name, path, strerror(errno)); smtp_closedown(US"spool or log directory problem"); - exim_exit(EXIT_FAILURE, NULL); + exim_exit(EXIT_FAILURE); } *inodeptr = (statbuf.F_FILES > 0)? statbuf.F_FAVAIL : -1; @@ -372,7 +372,7 @@ if (!already_bombing_out) /* Exit from the program (non-BSMTP cases) */ -exim_exit(EXIT_FAILURE, NULL); +exim_exit(EXIT_FAILURE); } @@ -645,6 +645,11 @@ if (!f.dot_ends) { int last_ch = '\n'; +/*XXX we do a gettimeofday before checking for every received char, +which is hardly clever. The function-indirection doesn't help, but +an additional function to check for nonempty read buffer would help. +See stdin_getc() / smtp_getc() / tls_getc() / bdat_getc(). */ + for ( ; log_close_chk(), (ch = (receive_getc)(GETC_BUFFER_UNLIMITED)) != EOF; last_ch = ch) @@ -1167,7 +1172,7 @@ if (error_handling == ERRORS_SENDER) else fprintf(stderr, "exim: %s%s\n", text2, text1); /* Sic */ (void)fclose(f); -exim_exit(error_rc, US""); +exim_exit(error_rc); } @@ -1448,7 +1453,7 @@ if (rc == OK) struct dirent * entry; DIR * tempdir; - for (tempdir = opendir(CS scandir); entry = readdir(tempdir); ) + for (tempdir = exim_opendir(scandir); entry = readdir(tempdir); ) if (strncmpic(US entry->d_name, US"__rfc822_", 9) == 0) { rfc822_file_path = string_sprintf("%s/%s", scandir, entry->d_name); @@ -1703,10 +1708,6 @@ header_line *msgid_header = NULL; header_line *received_header; BOOL msgid_header_newly_created = FALSE; -#ifdef SUPPORT_DMARC -int dmarc_up = 0; -#endif - /* Variables for use when building the Received: header. */ uschar *timestamp; @@ -1760,6 +1761,13 @@ if (thismessage_size_limit <= 0) thismessage_size_limit = INT_MAX; message_linecount = body_linecount = body_zerocount = max_received_linelength = 0; +#ifdef WITH_CONTENT_SCAN +/* reset non-per-part mime variables */ +mime_is_coverletter = 0; +mime_is_rfc822 = 0; +mime_part_count = -1; +#endif + #ifndef DISABLE_DKIM /* Call into DKIM to set up the context. In CHUNKING mode we clear the dot-stuffing flag */ @@ -1768,7 +1776,7 @@ if (smtp_input && !smtp_batched_input && !f.dkim_disable_verify) #endif #ifdef SUPPORT_DMARC -dmarc_up = dmarc_init(); /* initialize libopendmarc */ +if (sender_host_address) dmarc_init(); /* initialize libopendmarc */ #endif /* Remember the time of reception. Exim uses time+pid for uniqueness of message @@ -2560,7 +2568,7 @@ if (extract_recip) If there are no recipients at all, an error will occur later. */ - if (recipient == NULL && Ustrcmp(errmess, "empty address") != 0) + if (!recipient && Ustrcmp(errmess, "empty address") != 0) { int len = Ustrlen(s); error_block *b = store_get(sizeof(error_block), FALSE); @@ -2911,9 +2919,8 @@ if ( from_header uschar *at = domain ? from_address + domain - 1 : NULL; if (at) *at = 0; - from_address += route_check_prefix(from_address, local_from_prefix); - slen = route_check_suffix(from_address, local_from_suffix); - if (slen > 0) + from_address += route_check_prefix(from_address, local_from_prefix, NULL); + if ((slen = route_check_suffix(from_address, local_from_suffix, NULL)) > 0) { memmove(from_address+slen, from_address, Ustrlen(from_address)-slen); from_address += slen; @@ -3333,7 +3340,7 @@ if (extract_recip && (bad_addresses || recipients_count == 0)) { Uunlink(spool_name); (void)fclose(spool_data_file); - exim_exit(error_rc, US"receiving"); + exim_exit(error_rc); } } @@ -3499,7 +3506,7 @@ else #endif /* WITH_CONTENT_SCAN */ #ifdef SUPPORT_DMARC - dmarc_up = dmarc_store_data(from_header); + dmarc_store_data(from_header); #endif #ifndef DISABLE_PRDR