diff -urN src.orig/expand.c src/expand.c --- src.orig/expand.c Fri Apr 28 13:32:22 2006 +++ src/expand.c Mon Jun 12 16:27:43 2006 @@ -344,6 +344,9 @@ { "dnslist_value", vtype_stringptr, &dnslist_value }, { "domain", vtype_stringptr, &deliver_domain }, { "domain_data", vtype_stringptr, &deliver_domain_data }, +#ifdef SUPPORT_DSN + { "dsn_flag", vtype_int, &dsn_flag }, +#endif { "exim_gid", vtype_gid, &exim_gid }, { "exim_path", vtype_stringptr, &exim_path }, { "exim_uid", vtype_uid, &exim_uid }, diff -urN src.orig/globals.c src/globals.c --- src.orig/globals.c Mon Jun 12 16:25:20 2006 +++ src/globals.c Mon Jun 12 16:27:43 2006 @@ -828,6 +828,9 @@ int rcpt_count = 0; int rcpt_fail_count = 0; int rcpt_defer_count = 0; +#ifdef SUPPORT_DSN +int dsn_flag = 0; +#endif gid_t real_gid; uid_t real_uid; BOOL really_exim = TRUE; diff -urN src.orig/globals.h src/globals.h --- src.orig/globals.h Mon Jun 12 16:25:20 2006 +++ src/globals.h Mon Jun 12 16:27:43 2006 @@ -537,6 +537,9 @@ extern int rcpt_count; /* Count of RCPT commands in a message */ extern int rcpt_fail_count; /* Those that got 5xx */ extern int rcpt_defer_count; /* Those that got 4xx */ +#ifdef SUPPORT_DSN +extern int dsn_flag; /* DSN flag */ +#endif extern gid_t real_gid; /* Real gid */ extern uid_t real_uid; /* Real user running program */ extern BOOL really_exim; /* FALSE in utilities */ diff -urN src.orig/smtp_in.c src/smtp_in.c --- src.orig/smtp_in.c Mon Jun 12 16:25:20 2006 +++ src/smtp_in.c Mon Jun 12 16:27:43 2006 @@ -811,6 +811,9 @@ recipients_list = NULL; rcpt_count = rcpt_defer_count = rcpt_fail_count = raw_recipients_count = recipients_count = recipients_list_max = 0; +#ifdef SUPPORT_DSN +dsn_flag = 0; +#endif message_linecount = 0; message_size = -1; acl_added_headers = NULL; @@ -3243,6 +3246,10 @@ /* If the MAIL ACL discarded all the recipients, we bypass ACL checking for them. Otherwise, check the access control list for this recipient. */ + +#ifdef SUPPORT_DSN + dsn_flag = flags; +#endif rc = recipients_discarded? DISCARD : acl_check(ACL_WHERE_RCPT, recipient, acl_smtp_rcpt, &user_msg, &log_msg);