git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix $mime_part_count for non-mime message on multi-message connection. Bug 2537
[exim.git]
/
src
/
src
/
receive.c
diff --git
a/src/src/receive.c
b/src/src/receive.c
index 6b5a28d3119b35637abbd1ca1243198abb7d0638..6d20a5cdae255ee68582545a7c3db1f974ec7203 100644
(file)
--- a/
src/src/receive.c
+++ b/
src/src/receive.c
@@
-14,9
+14,9
@@
extern int dcc_ok;
#endif
extern int dcc_ok;
#endif
-#ifdef
EXPERIMENTAL
_DMARC
+#ifdef
SUPPORT
_DMARC
# include "dmarc.h"
# include "dmarc.h"
-#endif
/* EXPERIMENTAL_DMARC */
+#endif
/*************************************************
* Local static variables *
/*************************************************
* Local static variables *
@@
-1343,7
+1343,7
@@
if (received_protocol)
if (LOGGING(pipelining) && f.smtp_in_pipelining_advertised)
{
g = string_catn(g, US" L", 2);
if (LOGGING(pipelining) && f.smtp_in_pipelining_advertised)
{
g = string_catn(g, US" L", 2);
-#if
def SUPPORT
_PIPE_CONNECT
+#if
ndef DISABLE
_PIPE_CONNECT
if (f.smtp_in_early_pipe_used)
g = string_catn(g, US"*", 1);
else if (f.smtp_in_early_pipe_advertised)
if (f.smtp_in_early_pipe_used)
g = string_catn(g, US"*", 1);
else if (f.smtp_in_early_pipe_advertised)
@@
-1399,6
+1399,7
@@
for (header_line * my_headerlist = header_list; my_headerlist;
goto DO_MIME_ACL;
}
goto DO_MIME_ACL;
}
+mime_part_count = -1;
DEBUG(D_receive) debug_printf("No Content-Type: header - presumably not a MIME message.\n");
return TRUE;
DEBUG(D_receive) debug_printf("No Content-Type: header - presumably not a MIME message.\n");
return TRUE;
@@
-1703,10
+1704,6
@@
header_line *msgid_header = NULL;
header_line *received_header;
BOOL msgid_header_newly_created = FALSE;
header_line *received_header;
BOOL msgid_header_newly_created = FALSE;
-#ifdef EXPERIMENTAL_DMARC
-int dmarc_up = 0;
-#endif /* EXPERIMENTAL_DMARC */
-
/* Variables for use when building the Received: header. */
uschar *timestamp;
/* Variables for use when building the Received: header. */
uschar *timestamp;
@@
-1760,6
+1757,13
@@
if (thismessage_size_limit <= 0) thismessage_size_limit = INT_MAX;
message_linecount = body_linecount = body_zerocount =
max_received_linelength = 0;
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 */
#ifndef DISABLE_DKIM
/* Call into DKIM to set up the context. In CHUNKING mode
we clear the dot-stuffing flag */
@@
-1767,9
+1771,8
@@
if (smtp_input && !smtp_batched_input && !f.dkim_disable_verify)
dkim_exim_verify_init(chunking_state <= CHUNKING_OFFERED);
#endif
dkim_exim_verify_init(chunking_state <= CHUNKING_OFFERED);
#endif
-#ifdef EXPERIMENTAL_DMARC
-/* initialize libopendmarc */
-dmarc_up = dmarc_init();
+#ifdef SUPPORT_DMARC
+if (sender_host_address) dmarc_init(); /* initialize libopendmarc */
#endif
/* Remember the time of reception. Exim uses time+pid for uniqueness of message
#endif
/* Remember the time of reception. Exim uses time+pid for uniqueness of message
@@
-2912,9
+2915,8
@@
if ( from_header
uschar *at = domain ? from_address + domain - 1 : NULL;
if (at) *at = 0;
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;
{
memmove(from_address+slen, from_address, Ustrlen(from_address)-slen);
from_address += slen;
@@
-3499,9
+3501,9
@@
else
goto TIDYUP;
#endif /* WITH_CONTENT_SCAN */
goto TIDYUP;
#endif /* WITH_CONTENT_SCAN */
-#ifdef
EXPERIMENTAL
_DMARC
- dmarc_
up = dmarc_
store_data(from_header);
-#endif
/* EXPERIMENTAL_DMARC */
+#ifdef
SUPPORT
_DMARC
+ dmarc_store_data(from_header);
+#endif
#ifndef DISABLE_PRDR
if (prdr_requested && recipients_count > 1 && acl_smtp_data_prdr)
#ifndef DISABLE_PRDR
if (prdr_requested && recipients_count > 1 && acl_smtp_data_prdr)
@@
-3837,7
+3839,6
@@
else
string_from_gstring(g), istemp, string_printing(errmsg));
if (smtp_input)
string_from_gstring(g), istemp, string_printing(errmsg));
if (smtp_input)
- {
if (!smtp_batched_input)
{
smtp_respond(smtp_code, 3, TRUE, errmsg);
if (!smtp_batched_input)
{
smtp_respond(smtp_code, 3, TRUE, errmsg);
@@
-3848,7
+3849,6
@@
else
else
moan_smtp_batch(NULL, "%s %s", smtp_code, errmsg);
/* Does not return */
else
moan_smtp_batch(NULL, "%s %s", smtp_code, errmsg);
/* Does not return */
- }
else
{
fseek(spool_data_file, (long int)SPOOL_DATA_START_OFFSET, SEEK_SET);
else
{
fseek(spool_data_file, (long int)SPOOL_DATA_START_OFFSET, SEEK_SET);
@@
-4026,18
+4026,14
@@
if (proxy_session && LOGGING(proxy))
if (chunking_state > CHUNKING_OFFERED)
g = string_catn(g, US" K", 2);
if (chunking_state > CHUNKING_OFFERED)
g = string_catn(g, US" K", 2);
-sprintf(CS big_buffer, "%d", msg_size);
-g = string_append(g, 2, US" S=", big_buffer);
+g = string_fmt_append(g, " S=%d", msg_size);
/* log 8BITMIME mode announced in MAIL_FROM
0 ... no BODY= used
7 ... 7BIT
8 ... 8BITMIME */
if (LOGGING(8bitmime))
/* log 8BITMIME mode announced in MAIL_FROM
0 ... no BODY= used
7 ... 7BIT
8 ... 8BITMIME */
if (LOGGING(8bitmime))
- {
- sprintf(CS big_buffer, "%d", body_8bitmime);
- g = string_append(g, 2, US" M8S=", big_buffer);
- }
+ g = string_fmt_append(g, " M8S=%d", body_8bitmime);
#ifndef DISABLE_DKIM
if (LOGGING(dkim) && dkim_verify_overall)
#ifndef DISABLE_DKIM
if (LOGGING(dkim) && dkim_verify_overall)