summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2014-12-23 20:07:16 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2015-01-12 18:58:35 +0000
commit50dc740948ba43eaeb6d33757bc83beff33f2a64 (patch)
tree37f66e9fc90cdba979a6b6474669083d146e7a6d /src
parente0eb00cd78f2dbf91aba5dffa579177b1e1815a1 (diff)
Move DSN support to mainline
Affects bug 893
Diffstat (limited to 'src')
-rw-r--r--src/exim_monitor/em_globals.c2
-rw-r--r--src/src/EDITME3
-rw-r--r--src/src/config.h.defaults1
-rw-r--r--src/src/deliver.c121
-rw-r--r--src/src/exim.c5
-rw-r--r--src/src/globals.c6
-rw-r--r--src/src/globals.h2
-rw-r--r--src/src/local_scan.h2
-rw-r--r--src/src/macros.h2
-rw-r--r--src/src/readconf.c2
-rw-r--r--src/src/receive.c2
-rw-r--r--src/src/route.c10
-rw-r--r--src/src/smtp_in.c28
-rw-r--r--src/src/spool_in.c16
-rw-r--r--src/src/spool_out.c17
-rw-r--r--src/src/structs.h4
-rw-r--r--src/src/transport.c2
-rw-r--r--src/src/transports/smtp.c18
18 files changed, 22 insertions, 221 deletions
diff --git a/src/exim_monitor/em_globals.c b/src/exim_monitor/em_globals.c
index 918659d98..3277012f0 100644
--- a/src/exim_monitor/em_globals.c
+++ b/src/exim_monitor/em_globals.c
@@ -145,10 +145,8 @@ BOOL dkim_disable_verify = FALSE;
BOOL dont_deliver = FALSE;
-#ifdef EXPERIMENTAL_DSN
int dsn_ret = 0;
uschar *dsn_envid = NULL;
-#endif
#ifdef WITH_CONTENT_SCAN
int fake_response = OK;
diff --git a/src/src/EDITME b/src/src/EDITME
index 4a290a4bc..353dde3ee 100644
--- a/src/src/EDITME
+++ b/src/src/EDITME
@@ -491,9 +491,6 @@ EXIM_MONITOR=eximon.bin
# ownership
# EXPERIMENTAL_CERTNAMES=yes
-# Uncomment the following line to add DSN support
-# EXPERIMENTAL_DSN=yes
-
# Uncomment the following line to add DANE support
# EXPERIMENTAL_DANE=yes
diff --git a/src/src/config.h.defaults b/src/src/config.h.defaults
index ec4322c70..e339bdf9e 100644
--- a/src/src/config.h.defaults
+++ b/src/src/config.h.defaults
@@ -170,7 +170,6 @@ it's a default value. */
#define EXPERIMENTAL_DANE
#define EXPERIMENTAL_DCC
#define EXPERIMENTAL_DMARC
-#define EXPERIMENTAL_DSN
#define EXPERIMENTAL_PROXY
#define EXPERIMENTAL_REDIS
#define EXPERIMENTAL_SPF
diff --git a/src/src/deliver.c b/src/src/deliver.c
index 5000f1cbc..462aaf49d 100644
--- a/src/src/deliver.c
+++ b/src/src/deliver.c
@@ -63,10 +63,8 @@ static address_item *addr_new = NULL;
static address_item *addr_remote = NULL;
static address_item *addr_route = NULL;
static address_item *addr_succeed = NULL;
-#ifdef EXPERIMENTAL_DSN
static address_item *addr_dsntmp = NULL;
static address_item *addr_senddsn = NULL;
-#endif
static FILE *message_log = NULL;
static BOOL update_spool;
@@ -3166,14 +3164,12 @@ while (!done)
break;
#endif
-#ifdef EXPERIMENTAL_DSN
case 'D':
if (addr == NULL) goto ADDR_MISMATCH;
memcpy(&(addr->dsn_aware), ptr, sizeof(addr->dsn_aware));
ptr += sizeof(addr->dsn_aware);
DEBUG(D_deliver) debug_printf("DSN read: addr->dsn_aware = %d\n", addr->dsn_aware);
break;
-#endif
case 'A':
if (addr == NULL)
@@ -4370,11 +4366,9 @@ for (delivery_count = 0; addr_remote != NULL; delivery_count++)
rmt_dlv_checked_write(fd, 'P', '0', NULL, 0);
#endif
-#ifdef EXPERIMENTAL_DSN
memcpy(big_buffer, &addr->dsn_aware, sizeof(addr->dsn_aware));
rmt_dlv_checked_write(fd, 'D', '0', big_buffer, sizeof(addr->dsn_aware));
DEBUG(D_deliver) debug_printf("DSN write: addr->dsn_aware = %d\n", addr->dsn_aware);
-#endif
/* Retry information: for most success cases this will be null. */
@@ -4814,7 +4808,6 @@ while (*s != 0)
}
-#ifdef EXPERIMENTAL_DSN
/***********************************************************
* Print Diagnostic-Code for an address *
************************************************************/
@@ -4863,7 +4856,6 @@ while (*s)
fputc('\n', f);
}
-#endif /* EXPERIMENTAL_DSN */
/*************************************************
@@ -5577,13 +5569,11 @@ if (process_recipients != RECIP_IGNORE)
if (r->pno >= 0)
new->onetime_parent = recipients_list[r->pno].address;
-#ifdef EXPERIMENTAL_DSN
/* If DSN support is enabled, set the dsn flags and the original receipt
to be passed on to other DSN enabled MTAs */
new->dsn_flags = r->dsn_flags & rf_dsnflags;
new->dsn_orcpt = r->orcpt;
DEBUG(D_deliver) debug_printf("DSN: set orcpt: %s flags: %d\n", new->dsn_orcpt, new->dsn_flags);
-#endif
switch (process_recipients)
{
@@ -6548,11 +6538,9 @@ if (addr_remote != NULL)
regex_must_compile(US"\\n250[\\s\\-]PRDR(\\s|\\n|$)", FALSE, TRUE);
#endif
-#ifdef EXPERIMENTAL_DSN
/* Set the regex to check for DSN support on remote MTA */
if (regex_DSN == NULL) regex_DSN =
regex_must_compile(US"\\n250[\\s\\-]DSN(\\s|\\n|$)", FALSE, TRUE);
-#endif
/* 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
@@ -6661,7 +6649,6 @@ prevents actual delivery. */
else if (!dont_deliver) retry_update(&addr_defer, &addr_failed, &addr_succeed);
-#ifdef EXPERIMENTAL_DSN
/* Send DSN for successful messages */
addr_dsntmp = addr_succeed;
addr_senddsn = NULL;
@@ -6820,7 +6807,6 @@ if (addr_senddsn != NULL)
rc = child_close(pid, 0); /* Waits for child to close, no timeout */
}
}
-#endif /*EXPERIMENTAL_DSN*/
/* If any addresses failed, we must send a message to somebody, unless
af_ignore_error is set, in which case no action is taken. It is possible for
@@ -6879,11 +6865,9 @@ while (addr_failed != NULL)
it from the list, throw away any saved message file, log it, and
mark the recipient done. */
- if (testflag(addr_failed, af_ignore_error)
-#ifdef EXPERIMENTAL_DSN
- || (((addr_failed->dsn_flags & rf_dsnflags) != 0)
- && ((addr_failed->dsn_flags & rf_notify_failure) != rf_notify_failure))
-#endif
+ if ( testflag(addr_failed, af_ignore_error)
+ || ( ((addr_failed->dsn_flags & rf_dsnflags) != 0)
+ && ((addr_failed->dsn_flags & rf_notify_failure) != rf_notify_failure))
)
{
addr = addr_failed;
@@ -6937,12 +6921,10 @@ while (addr_failed != NULL)
BOOL to_sender = strcmpic(sender_address, bounce_recipient) == 0;
int max = (bounce_return_size_limit/DELIVER_IN_BUFFER_SIZE + 1) *
DELIVER_IN_BUFFER_SIZE;
-#ifdef EXPERIMENTAL_DSN
uschar * bound;
uschar *dsnlimitmsg;
uschar *dsnnotifyhdr;
int topt;
-#endif
DEBUG(D_deliver)
debug_printf("sending error message to: %s\n", bounce_recipient);
@@ -6996,7 +6978,6 @@ while (addr_failed != NULL)
moan_write_from(f);
fprintf(f, "To: %s\n", bounce_recipient);
-#ifdef EXPERIMENTAL_DSN
/* generate boundary string and output MIME-Headers */
bound = string_sprintf(TIME_T_FMT "-eximdsn-%d", time(NULL), rand());
@@ -7004,7 +6985,6 @@ while (addr_failed != NULL)
" report-type=delivery-status; boundary=%s\n"
"MIME-Version: 1.0\n",
bound);
-#endif
/* Open a template file if one is provided. Log failure to open, but
carry on - default texts will be used. */
@@ -7029,12 +7009,10 @@ while (addr_failed != NULL)
fprintf(f, "Subject: Mail delivery failed%s\n\n",
to_sender? ": returning message to sender" : "");
-#ifdef EXPERIMENTAL_DSN
/* output human readable part as text/plain section */
fprintf(f, "--%s\n"
"Content-type: text/plain; charset=us-ascii\n\n",
bound);
-#endif
if ((emf_text = next_emf(emf, US"intro")))
fprintf(f, "%s", CS emf_text);
@@ -7161,7 +7139,6 @@ wording. */
fputc('\n', f);
}
-#ifdef EXPERIMENTAL_DSN
/* output machine readable part */
fprintf(f, "--%s\n"
"Content-type: message/delivery-status\n\n"
@@ -7192,7 +7169,6 @@ wording. */
print_dsn_diagnostic_code(addr, f);
}
}
-#endif
/* Now copy the message, trying to give an intelligible comment if
it is too long for it all to be copied. The limit isn't strictly
@@ -7201,65 +7177,6 @@ wording. */
emf_text = next_emf(emf, US"copy");
-#ifndef EXPERIMENTAL_DSN
- if (bounce_return_message)
- {
- int topt = topt_add_return_path;
- if (!bounce_return_body) topt |= topt_no_body;
-
- if (emf_text)
- fprintf(f, "%s", CS emf_text);
- else
- {
- if (bounce_return_body) fprintf(f,
-"------ This is a copy of the message, including all the headers. ------\n");
- else fprintf(f,
-"------ This is a copy of the message's headers. ------\n");
- }
-
- /* While reading the "truncated" message, set return_size_limit to
- the actual max testing value, rounded. We need to read the message
- whether we are going to use it or not. */
-
- {
- int temp = bounce_return_size_limit;
- bounce_return_size_limit = (max/1000)*1000;
- emf_text = next_emf(emf, US"truncated");
- bounce_return_size_limit = temp;
- }
-
- if (bounce_return_body && bounce_return_size_limit > 0)
- {
- struct stat statbuf;
- if (fstat(deliver_datafile, &statbuf) == 0 && statbuf.st_size > max)
- {
- if (emf_text)
- fprintf(f, "%s", CS emf_text);
- else
- fprintf(f,
-"------ The body of the message is " OFF_T_FMT " characters long; only the first\n"
-"------ %d or so are included here.\n", statbuf.st_size, max);
- }
- }
-
- fputc('\n', f);
- fflush(f);
-
- transport_filter_argv = NULL; /* Just in case */
- return_path = sender_address; /* In case not previously set */
- transport_write_message(NULL, fileno(f), topt,
- bounce_return_size_limit, NULL, NULL, NULL, NULL, NULL, 0);
- }
-
- /* Write final text and close the template file if one is open */
-
- if (emf)
- {
- if ((emf_text = next_emf(emf, US"final")))
- fprintf(f, "%s", CS emf_text);
- (void)fclose(emf);
- }
-#else
/* add message body
we ignore the intro text from template and add
the text for bounce_return_size_limit at the end.
@@ -7317,7 +7234,6 @@ wording. */
(void)fclose(emf);
fprintf(f, "\n--%s--\n", bound);
-#endif /*EXPERIMENTAL_DSN*/
/* Close the file, which should send an EOF to the child process
that is receiving the message. Wait for it to finish. */
@@ -7552,15 +7468,18 @@ else if (addr_defer != (address_item *)(+1))
is not sent. Another attempt will be made at the next delivery attempt (if
it also defers). */
- if (!queue_2stage && delivery_attempted &&
-#ifdef EXPERIMENTAL_DSN
- (((addr_defer->dsn_flags & rf_dsnflags) == 0) ||
- (addr_defer->dsn_flags & rf_notify_delay) == rf_notify_delay) &&
-#endif
- delay_warning[1] > 0 && sender_address[0] != 0 &&
- (delay_warning_condition == NULL ||
- expand_check_condition(delay_warning_condition,
- US"delay_warning", US"option")))
+ if ( !queue_2stage
+ && delivery_attempted
+ && ( ((addr_defer->dsn_flags & rf_dsnflags) == 0)
+ || (addr_defer->dsn_flags & rf_notify_delay) == rf_notify_delay
+ )
+ && delay_warning[1] > 0
+ && sender_address[0] != 0
+ && ( delay_warning_condition == NULL
+ || expand_check_condition(delay_warning_condition,
+ US"delay_warning", US"option")
+ )
+ )
{
int count;
int show_time;
@@ -7621,9 +7540,7 @@ else if (addr_defer != (address_item *)(+1))
uschar *wmf_text;
FILE *wmf = NULL;
FILE *f = fdopen(fd, "wb");
-#ifdef EXPERIMENTAL_DSN
uschar * bound;
-#endif
if (warn_message_file)
{
@@ -7644,7 +7561,6 @@ else if (addr_defer != (address_item *)(+1))
moan_write_from(f);
fprintf(f, "To: %s\n", recipients);
-#ifdef EXPERIMENTAL_DSN
/* generated boundary string and output MIME-Headers */
bound = string_sprintf(TIME_T_FMT "-eximdsn-%d", time(NULL), rand());
@@ -7652,7 +7568,6 @@ else if (addr_defer != (address_item *)(+1))
" report-type=delivery-status; boundary=%s\n"
"MIME-Version: 1.0\n",
bound);
-#endif
if ((wmf_text = next_emf(wmf, US"header")))
fprintf(f, "%s\n", wmf_text);
@@ -7660,12 +7575,10 @@ else if (addr_defer != (address_item *)(+1))
fprintf(f, "Subject: Warning: message %s delayed %s\n\n",
message_id, warnmsg_delay);
-#ifdef EXPERIMENTAL_DSN
/* output human readable part as text/plain section */
fprintf(f, "--%s\n"
"Content-type: text/plain; charset=us-ascii\n\n",
bound);
-#endif
if ((wmf_text = next_emf(wmf, US"intro")))
fprintf(f, "%s", CS wmf_text);
@@ -7704,10 +7617,8 @@ else if (addr_defer != (address_item *)(+1))
/* List the addresses, with error information if allowed */
-#ifdef EXPERIMENTAL_DSN
/* store addr_defer for machine readable part */
address_item *addr_dsndefer = addr_defer;
-#endif
fputc('\n', f);
while (addr_defer)
{
@@ -7736,7 +7647,6 @@ else if (addr_defer != (address_item *)(+1))
"and when that happens, the message will be returned to you.\n");
}
-#ifdef EXPERIMENTAL_DSN
/* output machine readable part */
fprintf(f, "\n--%s\n"
"Content-type: message/delivery-status\n\n"
@@ -7789,7 +7699,6 @@ else if (addr_defer != (address_item *)(+1))
fprintf(f,"\n--%s--\n", bound);
fflush(f);
-#endif /*EXPERIMENTAL_DSN*/
/* Close and wait for child process to complete, without a timeout.
If there's an error, don't update the count. */
diff --git a/src/src/exim.c b/src/src/exim.c
index e0b754666..33c2a90bd 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -853,9 +853,6 @@ fprintf(f, "Support for:");
#ifdef EXPERIMENTAL_REDIS
fprintf(f, " Experimental_Redis");
#endif
-#ifdef EXPERIMENTAL_DSN
- fprintf(f, " Experimental_DSN");
-#endif
fprintf(f, "\n");
fprintf(f, "Lookups (built-in):");
@@ -2678,7 +2675,6 @@ for (i = 1; i < argc; i++)
break;
}
- #ifdef EXPERIMENTAL_DSN
/* -MCD: set the smtp_use_dsn flag; this indicates that the host
that exim is connected to supports the esmtp extension DSN */
else if (Ustrcmp(argrest, "CD") == 0)
@@ -2686,7 +2682,6 @@ for (i = 1; i < argc; i++)
smtp_use_dsn = TRUE;
break;
}
- #endif
/* -MCP: set the smtp_use_pipelining flag; this is useful only when
it preceded -MC (see above) */
diff --git a/src/src/globals.c b/src/src/globals.c
index 8cdfb0ee0..85d2e5c36 100644
--- a/src/src/globals.c
+++ b/src/src/globals.c
@@ -134,13 +134,11 @@ tls_support tls_out = {
0 /* tls_ocsp */
};
-#ifdef EXPERIMENTAL_DSN
uschar *dsn_envid = NULL;
int dsn_ret = 0;
const pcre *regex_DSN = NULL;
BOOL smtp_use_dsn = FALSE;
uschar *dsn_advertise_hosts = NULL;
-#endif
#ifdef SUPPORT_TLS
BOOL gnutls_compat_mode = FALSE;
@@ -361,11 +359,9 @@ address_item address_defaults = {
NULL, /* authenticator */
NULL, /* auth_id */
NULL, /* auth_sndr */
- #ifdef EXPERIMENTAL_DSN
NULL, /* dsn_orcpt */
0, /* dsn_flags */
0, /* dsn_aware */
- #endif
(uid_t)(-1), /* uid */
(gid_t)(-1), /* gid */
0, /* flags */
@@ -1149,9 +1145,7 @@ router_instance router_defaults = {
TRUE, /* verify_sender */
FALSE, /* uid_set */
FALSE, /* unseen */
-#ifdef EXPERIMENTAL_DSN
FALSE, /* dsn_lasthop */
-#endif
self_freeze, /* self_code */
(uid_t)(-1), /* uid */
diff --git a/src/src/globals.h b/src/src/globals.h
index 5746167dd..7ca07d56c 100644
--- a/src/src/globals.h
+++ b/src/src/globals.h
@@ -130,13 +130,11 @@ extern uschar *tls_verify_certificates;/* Path for certificates to check */
extern uschar *tls_verify_hosts; /* Mandatory client verification */
#endif
-#ifdef EXPERIMENTAL_DSN
extern uschar *dsn_envid; /* DSN envid string */
extern int dsn_ret; /* DSN ret type*/
extern const pcre *regex_DSN; /* For recognizing DSN settings */
extern BOOL smtp_use_dsn; /* Global for passed connections */
extern uschar *dsn_advertise_hosts; /* host for which TLS is advertised */
-#endif
/* Input-reading functions for messages, so we can use special ones for
incoming TCP/IP. */
diff --git a/src/src/local_scan.h b/src/src/local_scan.h
index 6df601af4..5bd335eca 100644
--- a/src/src/local_scan.h
+++ b/src/src/local_scan.h
@@ -128,10 +128,8 @@ typedef struct recipient_item {
uschar *address; /* the recipient address */
int pno; /* parent number for "one_time" alias, or -1 */
uschar *errors_to; /* the errors_to address or NULL */
-#ifdef EXPERIMENTAL_DSN
uschar *orcpt; /* DSN orcpt */
int dsn_flags; /* DSN flags */
-#endif
#ifdef EXPERIMENTAL_BRIGHTMAIL
uschar *bmi_optin;
#endif
diff --git a/src/src/macros.h b/src/src/macros.h
index 67e804f56..2a49c1d10 100644
--- a/src/src/macros.h
+++ b/src/src/macros.h
@@ -793,7 +793,6 @@ enum {
#define topt_no_body 0x040 /* Omit body */
#define topt_escape_headers 0x080 /* Apply escape check to headers */
-#ifdef EXPERIMENTAL_DSN
/* Flags for recipient_block, used in DSN support */
#define rf_dsnlasthop 0x01 /* Do not propagate DSN any further */
@@ -814,7 +813,6 @@ enum {
#define dsn_support_yes 1
#define dsn_support_no 2
-#endif
/* Codes for the host_find_failed and host_all_ignored options. */
diff --git a/src/src/readconf.c b/src/src/readconf.c
index df4cbb2fd..0b3778054 100644
--- a/src/src/readconf.c
+++ b/src/src/readconf.c
@@ -229,9 +229,7 @@ static optionlist optionlist_config[] = {
/* This option is now a no-op, retained for compability */
{ "drop_cr", opt_bool, &drop_cr },
/*********************************************************/
-#ifdef EXPERIMENTAL_DSN
{ "dsn_advertise_hosts", opt_stringptr, &dsn_advertise_hosts },
-#endif
{ "dsn_from", opt_stringptr, &dsn_from },
{ "envelope_to_remove", opt_bool, &envelope_to_remove },
{ "errors_copy", opt_stringptr, &errors_copy },
diff --git a/src/src/receive.c b/src/src/receive.c
index 0466cab8d..8ab3166d0 100644
--- a/src/src/receive.c
+++ b/src/src/receive.c
@@ -497,10 +497,8 @@ recipients_list[recipients_count].bmi_optin = bmi_current_optin;
/* reset optin string pointer for next recipient */
bmi_current_optin = NULL;
#endif
-#ifdef EXPERIMENTAL_DSN
recipients_list[recipients_count].orcpt = NULL;
recipients_list[recipients_count].dsn_flags = 0;
-#endif
recipients_list[recipients_count++].errors_to = NULL;
}
diff --git a/src/src/route.c b/src/src/route.c
index c640e9e71..09503044f 100644
--- a/src/src/route.c
+++ b/src/src/route.c
@@ -58,10 +58,8 @@ optionlist optionlist_routers[] = {
(void *)offsetof(router_instance, domains) },
{ "driver", opt_stringptr|opt_public,
(void *)offsetof(router_instance, driver_name) },
- #ifdef EXPERIMENTAL_DSN
{ "dsn_lasthop", opt_bool|opt_public,
(void *)offsetof(router_instance, dsn_lasthop) },
- #endif
{ "errors_to", opt_stringptr|opt_public,
(void *)(offsetof(router_instance, errors_to)) },
{ "expn", opt_bool|opt_public,
@@ -275,14 +273,12 @@ for (r = routers; r != NULL; r = r->next)
if (r->pass_router_name != NULL)
set_router(r, r->pass_router_name, &(r->pass_router), TRUE);
- #ifdef EXPERIMENTAL_DSN
- DEBUG(D_route) {
+ DEBUG(D_route) {
if (r->dsn_lasthop == FALSE)
debug_printf("DSN: %s propagating DSN\n", r->name);
else
debug_printf("DSN: %s lasthop set\n", r->name);
}
- #endif
}
}
@@ -1364,10 +1360,8 @@ new->p.errors_address = parent->p.errors_address;
copyflag(new, addr, af_propagate);
new->p.address_data = addr->p.address_data;
-#ifdef EXPERIMENTAL_DSN
new->dsn_flags = addr->dsn_flags;
new->dsn_orcpt = addr->dsn_orcpt;
-#endif
/* As it has turned out, we haven't set headers_add or headers_remove for the
@@ -1675,7 +1669,6 @@ for (r = (addr->start_router == NULL)? routers : addr->start_router;
/* Run the router, and handle the consequences. */
-#ifdef EXPERIMENTAL_DSN
/* ... but let us check on DSN before. If this should be the last hop for DSN
set flag
*/
@@ -1684,7 +1677,6 @@ for (r = (addr->start_router == NULL)? routers : addr->start_router;
addr->dsn_flags |= rf_dsnlasthop;
HDEBUG(D_route) debug_printf("DSN: last hop for %s\n", addr->address);
}
-#endif
HDEBUG(D_route) debug_printf("calling %s router\n", r->name);
diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c
index 54dcaa5e5..d646fe0bd 100644
--- a/src/src/smtp_in.c
+++ b/src/src/smtp_in.c
@@ -121,9 +121,7 @@ static BOOL auth_advertised;
#ifdef SUPPORT_TLS
static BOOL tls_advertised;
#endif
-#ifdef EXPERIMENTAL_DSN
static BOOL dsn_advertised;
-#endif
static BOOL esmtp;
static BOOL helo_required = FALSE;
static BOOL helo_verify = FALSE;
@@ -220,9 +218,7 @@ enum {
#ifndef DISABLE_PRDR
ENV_MAIL_OPT_PRDR,
#endif
-#ifdef EXPERIMENTAL_DSN
ENV_MAIL_OPT_RET, ENV_MAIL_OPT_ENVID,
-#endif
ENV_MAIL_OPT_NULL
};
typedef struct {
@@ -238,10 +234,8 @@ static env_mail_type_t env_mail_type_list[] = {
#ifndef DISABLE_PRDR
{ US"PRDR", ENV_MAIL_OPT_PRDR, FALSE },
#endif
-#ifdef EXPERIMENTAL_DSN
{ US"RET", ENV_MAIL_OPT_RET, TRUE },
{ US"ENVID", ENV_MAIL_OPT_ENVID, TRUE },
-#endif
{ US"NULL", ENV_MAIL_OPT_NULL, FALSE }
};
@@ -1500,11 +1494,9 @@ sender_verified_list = NULL; /* No senders verified */
memset(sender_address_cache, 0, sizeof(sender_address_cache));
memset(sender_domain_cache, 0, sizeof(sender_domain_cache));
-#ifdef EXPERIMENTAL_DSN
/* Reset the DSN flags */
dsn_ret = 0;
dsn_envid = NULL;
-#endif
authenticated_sender = NULL;
#ifdef EXPERIMENTAL_BRIGHTMAIL
@@ -1855,9 +1847,7 @@ tls_in.sni = NULL;
tls_in.ocsp = OCSP_NOT_REQ;
tls_advertised = FALSE;
#endif
-#ifdef EXPERIMENTAL_DSN
dsn_advertised = FALSE;
-#endif
/* Reset ACL connection variables */
@@ -3147,10 +3137,8 @@ while (done <= 0)
int ptr, size, rc;
int c, i;
auth_instance *au;
-#ifdef EXPERIMENTAL_DSN
uschar *orcpt = NULL;
int flags;
-#endif
switch(smtp_read_command(TRUE))
{
@@ -3495,9 +3483,7 @@ while (done <= 0)
#ifdef SUPPORT_TLS
tls_advertised = FALSE;
#endif
- #ifdef EXPERIMENTAL_DSN
dsn_advertised = FALSE;
- #endif
smtp_code = US"250 "; /* Default response code plus space*/
if (user_msg == NULL)
@@ -3581,7 +3567,6 @@ while (done <= 0)
s = string_cat(s, &size, &ptr, US"-8BITMIME\r\n", 11);
}
- #ifdef EXPERIMENTAL_DSN
/* Advertise DSN support if configured to do so. */
if (verify_check_host(&dsn_advertise_hosts) != FAIL)
{
@@ -3589,7 +3574,6 @@ while (done <= 0)
s = string_cat(s, &size, &ptr, US"-DSN\r\n", 6);
dsn_advertised = TRUE;
}
- #endif
/* Advertise ETRN if there's an ACL checking whether a host is
permitted to issue it; a check is made when any host actually tries. */
@@ -3846,8 +3830,6 @@ while (done <= 0)
arg_error = TRUE;
break;
- #ifdef EXPERIMENTAL_DSN
-
/* Handle the two DSN options, but only if configured to do so (which
will have caused "DSN" to be given in the EHLO response). The code itself
is included only if configured in at build time. */
@@ -3883,7 +3865,6 @@ while (done <= 0)
DEBUG(D_receive) debug_printf("DSN_ENVID: %s\n", dsn_envid);
}
break;
- #endif
/* Handle the AUTH extension. If the value given is not "<>" and either
the ACL says "yes" or there is no ACL but the sending host is
@@ -4161,8 +4142,7 @@ while (done <= 0)
rcpt_fail_count++;
break;
}
-
- #ifdef EXPERIMENTAL_DSN
+
/* Set the DSN flags orcpt and dsn_flags from the session*/
orcpt = NULL;
flags = 0;
@@ -4245,7 +4225,6 @@ while (done <= 0)
break;
}
}
- #endif
/* Apply SMTP rewriting then extract the working address. Don't allow "<>"
as a recipient address */
@@ -4360,8 +4339,7 @@ while (done <= 0)
if (user_msg == NULL) smtp_printf("250 Accepted\r\n");
else smtp_user_msg(US"250", user_msg);
receive_add_recipient(recipient, -1);
-
- #ifdef EXPERIMENTAL_DSN
+
/* Set the dsn flags in the recipients_list */
if (orcpt != NULL)
recipients_list[recipients_count-1].orcpt = orcpt;
@@ -4373,8 +4351,6 @@ while (done <= 0)
else
recipients_list[recipients_count-1].dsn_flags = 0;
DEBUG(D_receive) debug_printf("DSN: orcpt: %s flags: %d\n", recipients_list[recipients_count-1].orcpt, recipients_list[recipients_count-1].dsn_flags);
- #endif
-
}
/* The recipient was discarded */
diff --git a/src/src/spool_in.c b/src/src/spool_in.c
index bd8f094d3..79970cb40 100644
--- a/src/src/spool_in.c
+++ b/src/src/spool_in.c
@@ -299,10 +299,8 @@ tls_in.ocsp = OCSP_NOT_REQ;
spam_score_int = NULL;
#endif
-#ifdef EXPERIMENTAL_DSN
dsn_ret = 0;
dsn_envid = NULL;
-#endif
/* Generate the full name and open the file. If message_subdir is already
set, just look in the given directory. Otherwise, look in both the split
@@ -493,13 +491,11 @@ for (;;)
case 'd':
if (Ustrcmp(p, "eliver_firsttime") == 0)
deliver_firsttime = TRUE;
-#ifdef EXPERIMENTAL_DSN
/* Check if the dsn flags have been set in the header file */
else if (Ustrncmp(p, "sn_ret", 6) == 0)
dsn_ret= atoi(CS big_buffer + 8);
else if (Ustrncmp(p, "sn_envid", 8) == 0)
dsn_envid = string_copy(big_buffer + 11);
-#endif
break;
case 'f':
@@ -645,10 +641,8 @@ for (recipients_count = 0; recipients_count < rcount; recipients_count++)
{
int nn;
int pno = -1;
-#ifdef EXPERIMENTAL_DSN
int dsn_flags = 0;
uschar *orcpt = NULL;
-#endif
uschar *errors_to = NULL;
uschar *p;
@@ -725,7 +719,7 @@ for (recipients_count = 0; recipients_count < rcount; recipients_count++)
{
int flags;
-#if defined(EXPERIMENTAL_DSN) && !defined (COMPILE_UTILITY)
+#if !defined (COMPILE_UTILITY)
DEBUG(D_deliver) debug_printf("**** SPOOL_IN - Exim 4 standard format spoolfile\n");
#endif
@@ -745,7 +739,6 @@ for (recipients_count = 0; recipients_count < rcount; recipients_count++)
}
*(--p) = 0; /* Terminate address */
-#ifdef EXPERIMENTAL_DSN
if ((flags & 0x02) != 0) /* one_time data exists */
{
int len;
@@ -760,9 +753,8 @@ for (recipients_count = 0; recipients_count < rcount; recipients_count++)
}
*(--p) = 0; /* Terminate address */
-#endif /* EXPERIMENTAL_DSN */
}
-#if defined(EXPERIMENTAL_DSN) && !defined(COMPILE_UTILITY)
+#if !defined(COMPILE_UTILITY)
else
{ DEBUG(D_deliver) debug_printf("**** SPOOL_IN - No additional fields\n"); }
@@ -776,15 +768,13 @@ for (recipients_count = 0; recipients_count < rcount; recipients_count++)
DEBUG(D_deliver) debug_printf("**** SPOOL_IN - address: |%s| errorsto: |%s|\n",
big_buffer, errors_to);
}
-#endif /* EXPERIMENTAL_DSN */
+#endif
recipients_list[recipients_count].address = string_copy(big_buffer);
recipients_list[recipients_count].pno = pno;
recipients_list[recipients_count].errors_to = errors_to;
-#ifdef EXPERIMENTAL_DSN
recipients_list[recipients_count].orcpt = orcpt;
recipients_list[recipients_count].dsn_flags = dsn_flags;
-#endif
}
/* The remainder of the spool header file contains the headers for the message,
diff --git a/src/src/spool_out.c b/src/src/spool_out.c
index 67ac8bce7..fc56057c1 100644
--- a/src/src/spool_out.c
+++ b/src/src/spool_out.c
@@ -245,13 +245,11 @@ if (tls_in.ourcert)
if (tls_in.ocsp) fprintf(f, "-tls_ocsp %d\n", tls_in.ocsp);
#endif
-#ifdef EXPERIMENTAL_DSN
/* Write the dsn flags to the spool header file */
DEBUG(D_deliver) debug_printf("DSN: Write SPOOL :-dsn_envid %s\n", dsn_envid);
if (dsn_envid != NULL) fprintf(f, "-dsn_envid %s\n", dsn_envid);
DEBUG(D_deliver) debug_printf("DSN: Write SPOOL :-dsn_ret %d\n", dsn_ret);
if (dsn_ret != 0) fprintf(f, "-dsn_ret %d\n", dsn_ret);
-#endif
/* To complete the envelope, write out the tree of non-recipients, followed by
the list of recipients. These won't be disjoint the first time, when no
@@ -263,34 +261,21 @@ fprintf(f, "%d\n", recipients_count);
for (i = 0; i < recipients_count; i++)
{
recipient_item *r = recipients_list + i;
-#ifdef EXPERIMENTAL_DSN
DEBUG(D_deliver) debug_printf("DSN: Flags :%d\n", r->dsn_flags);
-#endif
- if (r->pno < 0 && r->errors_to == NULL
- #ifdef EXPERIMENTAL_DSN
- && r->dsn_flags == 0
- #endif
- )
+ if (r->pno < 0 && r->errors_to == NULL && r->dsn_flags == 0)
fprintf(f, "%s\n", r->address);
else
{
uschar *errors_to = (r->errors_to == NULL)? US"" : r->errors_to;
- #ifdef EXPERIMENTAL_DSN
/* for DSN SUPPORT extend exim 4 spool in a compatible way by
adding new values upfront and add flag 0x02 */
uschar *orcpt = (r->orcpt == NULL)? US"" : r->orcpt;
fprintf(f, "%s %s %d,%d %s %d,%d#3\n", r->address, orcpt, Ustrlen(orcpt), r->dsn_flags,
errors_to, Ustrlen(errors_to), r->pno);
- #else
- fprintf(f, "%s %s %d,%d#1\n", r->address, errors_to,
- Ustrlen(errors_to), r->pno);
- #endif
}
- #ifdef EXPERIMENTAL_DSN
DEBUG(D_deliver) debug_printf("DSN: **** SPOOL_OUT - address: |%s| errorsto: |%s| orcpt: |%s| dsn_flags: %d\n",
r->address, r->errors_to, r->orcpt, r->dsn_flags);
- #endif
}
/* Put a blank line before the headers */
diff --git a/src/src/structs.h b/src/src/structs.h
index 2250bbbde..3cdf12a8f 100644
--- a/src/src/structs.h
+++ b/src/src/structs.h
@@ -286,9 +286,7 @@ typedef struct router_instance {
BOOL verify_sender; /* Use this router when verifying a sender */
BOOL uid_set; /* Flag to indicate uid is set */
BOOL unseen; /* If TRUE carry on, even after success */
-#ifdef EXPERIMENTAL_DSN
BOOL dsn_lasthop; /* If TRUE, this router is a DSN endpoint */
-#endif
int self_code; /* Encoded version of "self" */
uid_t uid; /* Fixed uid value */
@@ -560,11 +558,9 @@ typedef struct address_item {
uschar *auth_id; /* auth "login" name used by transport */
uschar *auth_sndr; /* AUTH arg to SMTP MAIL, used by transport */
- #ifdef EXPERIMENTAL_DSN
uschar *dsn_orcpt; /* DSN orcpt value */
int dsn_flags; /* DSN flags */
int dsn_aware; /* DSN aware flag */
- #endif
uid_t uid; /* uid for transporting */
gid_t gid; /* gid for transporting */
diff --git a/src/src/transport.c b/src/src/transport.c
index 30e4268d1..58fc4ec93 100644
--- a/src/src/transport.c
+++ b/src/src/transport.c
@@ -1842,10 +1842,8 @@ if ((pid = fork()) == 0)
argv = child_exec_exim(CEE_RETURN_ARGV, TRUE, &i, FALSE, 0);
- #ifdef EXPERIMENTAL_DSN
/* Call with the dsn flag */
if (smtp_use_dsn) argv[i++] = US"-MCD";
- #endif
if (smtp_authenticated) argv[i++] = US"-MCA";
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index 181081b60..017cc5a37 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -273,14 +273,12 @@ smtp_transport_options_block smtp_transport_option_defaults = {
#endif
};
-#ifdef EXPERIMENTAL_DSN
/* some DSN flags for use later */
static int rf_list[] = {rf_notify_never, rf_notify_success,
rf_notify_failure, rf_notify_delay };
static uschar *rf_names[] = { US"NEVER", US"SUCCESS", US"FAILURE", US"DELAY" };
-#endif
@@ -1278,9 +1276,7 @@ BOOL pass_message = FALSE;
BOOL prdr_offered = FALSE;
BOOL prdr_active;
#endif
-#ifdef EXPERIMENTAL_DSN
BOOL dsn_all_lasthop = TRUE;
-#endif
#if defined(SUPPORT_TLS) && defined(EXPERIMENTAL_DANE)
BOOL dane = FALSE;
dns_answer tlsa_dnsa;
@@ -1743,12 +1739,10 @@ if (continue_hostname == NULL
{DEBUG(D_transport) debug_printf("PRDR usable\n");}
#endif
-#ifdef EXPERIMENTAL_DSN
/* Note if the server supports DSN */
smtp_use_dsn = esmtp && pcre_exec(regex_DSN, NULL, CS buffer, (int)Ustrlen(CS buffer), 0,
PCRE_EOPT, NULL, 0) >= 0;
DEBUG(D_transport) debug_printf("use_dsn=%d\n", smtp_use_dsn);
-#endif
/* Note if the response to EHLO specifies support for the AUTH extension.
If it has, check that this host is one we want to authenticate to, and do
@@ -1846,7 +1840,6 @@ if (prdr_offered)
}
#endif
-#ifdef EXPERIMENTAL_DSN
/* check if all addresses have lasthop flag */
/* do not send RET and ENVID if true */
dsn_all_lasthop = TRUE;
@@ -1876,7 +1869,6 @@ if ((smtp_use_dsn) && (dsn_all_lasthop == FALSE))
while (*p) p++;
}
}
-#endif
/* If an authenticated_sender override has been specified for this transport
instance, expand it. If the expansion is forced to fail, and there was already
@@ -1943,16 +1935,13 @@ for (addr = first_addr;
int count;
BOOL no_flush;
-#ifdef EXPERIMENTAL_DSN
addr->dsn_aware = smtp_use_dsn ? dsn_support_yes : dsn_support_no;
-#endif
if (addr->transport_return != PENDING_DEFER) continue;
address_count++;
no_flush = smtp_use_pipelining && (!mua_wrapper || addr->next != NULL);
-#ifdef EXPERIMENTAL_DSN
/* Add any DSN flags to the rcpt command and add to the sent string */
p = buffer;
@@ -1983,21 +1972,14 @@ for (addr = first_addr;
while (*p) p++;
}
}
-#endif
-
/* Now send the RCPT command, and process outstanding responses when
necessary. After a timeout on RCPT, we just end the function, leaving the
yield as OK, because this error can often mean that there is a problem with
just one address, so we don't want to delay the host. */
-#ifdef EXPERIMENTAL_DSN
count = smtp_write_command(&outblock, no_flush, "RCPT TO:<%s>%s%s\r\n",
transport_rcpt_address(addr, tblock->rcpt_include_affixes), igquotstr, buffer);
-#else
- count = smtp_write_command(&outblock, no_flush, "RCPT TO:<%s>%s\r\n",
- transport_rcpt_address(addr, tblock->rcpt_include_affixes), igquotstr);
-#endif
if (count < 0) goto SEND_FAILED;
if (count > 0)