extern int dcc_ok;
#endif
-#ifdef EXPERIMENTAL_DMARC
+#ifdef SUPPORT_DMARC
# include "dmarc.h"
-#endif /* EXPERIMENTAL_DMARC */
+#endif
/*************************************************
* Local static variables *
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;
/* Exit from the program (non-BSMTP cases) */
-exim_exit(EXIT_FAILURE, NULL);
+exim_exit(EXIT_FAILURE);
}
{
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)
else
fprintf(stderr, "exim: %s%s\n", text2, text1); /* Sic */
(void)fclose(f);
-exim_exit(error_rc, US"");
+exim_exit(error_rc);
}
if (LOGGING(pipelining) && f.smtp_in_pipelining_advertised)
{
g = string_catn(g, US" L", 2);
-#ifdef SUPPORT_PIPE_CONNECT
+#ifndef DISABLE_PIPE_CONNECT
if (f.smtp_in_early_pipe_used)
g = string_catn(g, US"*", 1);
else if (f.smtp_in_early_pipe_advertised)
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);
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;
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 */
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
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);
to be the least significant base-62 digit of the time of arrival. Otherwise
ensure that it is an empty string. */
-message_subdir[0] = split_spool_directory ? message_id[5] : 0;
+set_subdir_str(message_subdir, message_id, 0);
/* Now that we have the message-id, if there is no message-id: header, generate
one, but only for local (without suppress_local_fixups) or submission mode
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;
{
Uunlink(spool_name);
(void)fclose(spool_data_file);
- exim_exit(error_rc, US"receiving");
+ exim_exit(error_rc);
}
}
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)
string_from_gstring(g), istemp, string_printing(errmsg));
if (smtp_input)
- {
if (!smtp_batched_input)
{
smtp_respond(smtp_code, 3, TRUE, errmsg);
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);
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))
- {
- 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)