commit:     6abd1d66aceb4f0679372d2e63447f879967f2c1
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 25 00:15:14 2015 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Wed Nov 25 00:15:14 2015 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=6abd1d66

mail-mta/exim: version bump.

Package-Manager: portage-2.2.20.1
RepoMan-Options: --force

 mail-mta/exim/Manifest                             |    9 +-
 .../{exim-4.84-r99.ebuild => exim-4.85-r99.ebuild} |   16 +-
 mail-mta/exim/files/exim-4.76-dsn.patch            |   18 -
 .../exim/files/exim-4.77-makefile-freebsd.patch    |   48 -
 mail-mta/exim/files/exim_482_dsn_1_3.patch         | 1212 --------------------
 5 files changed, 11 insertions(+), 1292 deletions(-)

diff --git a/mail-mta/exim/Manifest b/mail-mta/exim/Manifest
index 2a37072..9e3aa95 100644
--- a/mail-mta/exim/Manifest
+++ b/mail-mta/exim/Manifest
@@ -5,9 +5,7 @@ AUX exim-4.69-r1.27021.patch 1447 SHA256 
dc81115be1324cf2d61ff2e2393462bd31aa635
 AUX exim-4.74-localscan_dlopen.patch 9280 SHA256 
dcd44f552e9b9b79facc988c9efad3ab1609a4e4209e9276323f49d1ea00e462 SHA512 
bfd35b8fcc7b8bd50a28b2bb7865d358ed1af3978b057da1c83a0be38ba30a737d983b6b5cf829559ba8c490709d28bdb7d679eb825fe7e24798ec223bedc94e
 WHIRLPOOL 
7140c45782d8611638f3aecc960f890963b1d34fd1cca7a5b78058a616607d10c1a50d4110498e9c3d700ca04df8797c184ce816bfd1cab8931bd4eb9ef3aa8a
 AUX exim-4.74-radius-db-ENV-clash.patch 667 SHA256 
a4150c9b73203dd284faa646a67e39f431d07c6a378af8fabc97a4ad9e078437 SHA512 
040bbdb2259df882569a428b7fef03f89c3685428654ac29e93360a4791bdabe66e52d33d14f0822461fac119295bd31aad5998f63d59d4af057bd26b310a568
 WHIRLPOOL 
3ef9641fc821be5d7477ccc41f8656f987a896e883a7aa3a627b92e64e2663a87f345bd0fc46ae1b4b9f6ac09a560c951c0396dd135305c97821374d8aa08806
 AUX exim-4.76-crosscompile.patch 462 SHA256 
25ba013858b0fc239e24166554c1e28832d3d25801b53ca633f289bc4ae72b8e SHA512 
d4fd4417c1ce727f139999c399795312cdbbb9735d0793d68f8e3150240bc53b31277cb26f9946ba549b34c661fc0a61147d376bda09aa6763cab55d80d62343
 WHIRLPOOL 
22026d355888efb2f823842c596fb670f0821076fe6faaae9d0a6ecf57a4a6de52af9f720e784e8d7bbcf681494a020f22e75f4a2aa079d30880f5c9af759405
-AUX exim-4.76-dsn.patch 822 SHA256 
2b36099285ff271f1c6db189435ebe3c2d3f3e8407ac11a041c7ea21b1997463 SHA512 
b25324ca0bb9d5d9fd6b4604c5fb4f601ed793d409f75c008e7638a2d8ac5435bccc300b95999fe34ff167275c7a19a0af7ebc8eb15627243b3cbcddb3fa4f04
 WHIRLPOOL 
d49305b97a43686436c12453366a71bd6730e4593566d340f73a02f08db94ff6b9b8c473993e5ec5ec699425aee5f50f4ba90bc14168f9e8876a0b4a91ee0ddd
 AUX exim-4.77-as-needed-ldflags.patch 5954 SHA256 
3960f6883f7c3b44110ca5916ad8fa63f829516624c011a807cda00972b4dffd SHA512 
716cac89116b66df645a6d49c88369ed062e3d3cf158fb50420984fe1fd2c1d3f56ad3a59ba36bb5d88dc9f8194f5fa105340baa82120b63298a245c6aaaaca2
 WHIRLPOOL 
8e321d3abf5a2d55af93d7cc865a33b1b8f13ba19af8ce6b17c29ba7b4003b4cc7acb4789ab941e8dc0b475d8568c0934e8da2c429dec9099901e85b966830d0
-AUX exim-4.77-makefile-freebsd.patch 1124 SHA256 
50108e7f26ca2acb594d3d9a57c25ad041f32ada729b604da7378e9376b3ac7c SHA512 
99dd86a5aedb6505356e3c5614b065a68d4bbae69502cd5c0a780038c231fb1047e21a2f0b8757a65d6b1a6dcdf8a7f7416a299edc1c85adeec4e362b992f321
 WHIRLPOOL 
33a4d49572cb3beafe2680b742fe68ceb6d7098be4244677c3ae2ea23dfed8af1be4ef91f0247e5d69adec5679dd02cb3dc71233ba4cb3418f93c70e717727fa
 AUX exim-4.80-spool-mail-group.patch 946 SHA256 
4f013e30f6f96360baa7d5d7818eaf5247984ab0eb43b8b5ba8d1bd8704b811b SHA512 
24f30e9a9d90dc0f1fe8b3db26f8bc2649182b4e78110dc28a9c0f3a3feb7589f923144a4f1c54a1c46ff8cfe40826a1f2212787753be752f4d15a72d54a143b
 WHIRLPOOL 
aa34f4e721fda796ebeb091514ec35ffcf153e813b7760245d25da5d6f27590734d28032498a0ffb2262e170355b0a99b53947818e669d1f79bd0393ae85a2d6
 AUX exim-4.82-makefile-freebsd.patch 1252 SHA256 
c407ea37ff8125f20f535ddb02793d5242a12582b9ab388d2ba956f932af2f3d SHA512 
fb440ad3e46b90d4c2e4826841944f4006390ccebee08154a39e46f6854be15edd7d0b028333b41451a0511f886ad3a30cb4b86e7ba8be99f12616a137f09d56
 WHIRLPOOL 
72132bdce44ba23fb162a5afaed33ea72ef2c917d020f5ddf920ce16991f02411c0bbcb23526b0e09753ab84cf2f258108aa2283ce5f9529810844497df29501
 AUX exim-submission.socket 161 SHA256 
d3bb58f0fbeaaa33c812a823708664bbcd828da7d24e2a098f84a15aee443fee SHA512 
4a233761793e3510e9efa5aad3a6098c41b757f13133a7ea825680f2b393aba8d7935f16bf1dd065dde884fe7ba45639a8d398333a7d9bf0a6b72f88c8f2a09d
 WHIRLPOOL 
7fe2a157ae3361440d8a85c8eca44a97a289be1689261efda943076c9a76ab74ef9d5f01ec0eecdde940ae30ccb46530c95d7223cf62b78e8eb2bde5268288e2
@@ -18,10 +16,9 @@ AUX exim.rc8 755 SHA256 
8ebeb8d406690918c6d4e9b87fd2fd44053055130091671e49ce7d77
 AUX exim.rc9 1236 SHA256 
e541e950313a4057e3cd13cabac26db924485c54607410e0dcb3a2c348bf2fab SHA512 
2032f27ecb23dc9dcc7154d959dd60f9e24316415a78a993ce1ed7511753a99f12774c649698aec1a92bd641c3254c6b81a9a42f2a424dd43ff10813e1aad2f5
 WHIRLPOOL 
ebbdda159ddd609a3524dfc2b79d482fc30a0b11dbaed11c4687fd781ed8231982cb61e2dfc5bc830f8ef281f0d02db84f18535660034ef8e0dbdc5ee960a578
 AUX exim.service 229 SHA256 
6e5372338d93b75d96bf571d892b167ac812378bcf978dcd3f3324d7e612463a SHA512 
a071e9fb74b5fc2fdf0c73ad64ddfbc3954d8f7095d6a363dacf8c75d72a479fbf6821822ec5c8f3846d7687342e1bd447b97f91ca7b0582e5c98008aac30cca
 WHIRLPOOL 
5f2ccd6898c95599f8e801aa111c53dbb50b7ec9f6ba6552fe195ad07d41efdcbff765cba1d696df6acb564bca29830d0bf61bcda9a244a3b48354318914bbd5
 AUX exim.socket 139 SHA256 
3e3d8b6be2741d2587a496196c08b3f2ffa05b5803b2bf9fb49359cef3a98d26 SHA512 
db621116907ceb573e6f34581f47c91f751bff593054d7ddc32397b34c7f2405bec184bdb0589d2ac457fa3a61bcba072761e3a6293a99c9c764d2d9fd6069ae
 WHIRLPOOL 
6ddceaa1bf31d995afa2dc49ab4d8e1068321ab12b158e075f6ea3f2cc4dff35c2052da2a85fe998813354755e574670086880ef7e42e2a02877d4f766706d3c
-AUX exim_482_dsn_1_3.patch 41505 SHA256 
4e00069a4b2e2deb414f05ea33f29b3f007d9ebff17cfc16998800b21b8e0ef5 SHA512 
5f184d903300851dba46f4c3d46e70269111ff335fc71e9d14b04f40462c163411521f6fd60e1d703dfab3a173911225a209133369bb3c26d83455499261e777
 WHIRLPOOL 
842040f5009ad43b40ceff4935510b06a0f7496bfb7e7a13db8f3eeb6fec63d7c7b38e4ed31b2d8de543ddaf7e8af8becef334c88d1365910e783c8c0ad5a7ff
 AUX exim_at.service 140 SHA256 
faad96dadbb2750faa5652d830f10d5a14be487a42e8db1cec797164acf14b73 SHA512 
11c8133ee15b3e5193c9b1c59aed66c81b6e045dd23310bede9fcde6c88905db5ef08afdb798b53b75a7465915ea1247e980edf95db07a7f9b7bb58ce95fbb5a
 WHIRLPOOL 
78f0c825526ae890458c4e71df2bd724d77d508081c6d6c2e3493732f11576ffeed755968dd2f3bcfb1cc6e0b0d61ea9fc175cd71340d908646f1a9ccbc7406e
-DIST exim-4.84.tar.bz2 1761790 SHA256 
78ea22be87fb6df880e7fd482f3bec9ef6ceca0c9dedd50f8a26cae0b38b9e9c SHA512 
3cd41af6d57e5f0377fc93367753eae6cb6bf835803e8608c44e1da5acefce1ed8886f4fe7536950de072bfed6e927afe1536c1e6466cf3121dd352b69a68039
 WHIRLPOOL 
9e840aa6afa0db68455b4ab458706eedd7ea57b084999c9e85eaaec0530ed93958731d934ff1d7830d9b5cd086e36cb56dc8a2f78dad85bdba9ae6573510e840
-DIST exim-html-4.84.tar.bz2 465281 SHA256 
7ee7e9015b853915604b7806be93d56e9ba1fb915b63f0d6828c47f2228fd45b SHA512 
7de8513476b6abcdfd36b0121a2a9d6decf1ccf94ef51b8363e544066cc05670e6f2b4d03d5fbc49071b1431183dfd9badde5cbcc65f51d55ec6b25ebcb070b9
 WHIRLPOOL 
88c376fd399e17b2bc06d2d0fad19f8c6485807118a81e0c200f6c39defe7155fa920489481a8b82e629951766ce0222b85956f387d22d22549303bd3dff7f82
+DIST exim-4.85.tar.bz2 1784150 SHA256 
13211f2bbc5400d095a9b4be075eb1347e0d98676fdfe4be8a3b4d56281daaa4 SHA512 
2c5846528ee98e4aff5dbabe49dfa5ba6753fa64154b9671a7849db8a17773917fe13bcb9e5f732c43d7479debfadd8012b8650823eb12504a6b1b28be456161
 WHIRLPOOL 
4057cd745f12ff62e956838406544060d3d2d7383027959f3c1ca12eff43bddb9be63e284767245b271e53bef92596c1241f5e90e9ed611d02e95b7a30adc7c8
+DIST exim-html-4.85.tar.bz2 467069 SHA256 
fd91946369626e74842a0799b93d0d9e4a201fe640af84e1b5349fe6ff204167 SHA512 
8214576300827f79c0880e2d2163f71d7f1b3fe2aff714b591a011e48816965de5a773c3509137b085fec3d4d2128931f8398768c24dad6c92b7df27cbcafe74
 WHIRLPOOL 
a7edffd7124c4920708616d3e59c0db5159dee5f7e4fd62ce29fdba769d39781a3826d4e3e39cdc97669941bb9a5c977defe280feb73cbe159b23df4cb6fe95f
 DIST system_filter.exim.gz 3075 SHA256 
3a3471b486a09e0a0153f7b520e1eaf26d21b97d73ea8348bdc593c00eb1e437 SHA512 
cb358d3ce2499a0bb5920d962a06f2af8486e55ec90c8c928bd8e3aefb279aa57f5f960d5adfcef68bd94110b405eaa144e9629cfe6014a529c79c544600bbf3
 WHIRLPOOL 
ce68d9c18b24eca3ef97ea810964cc1ada5f85b795a7c432ad39b5788188a16419101c92fb52b418738d760e1d658f7a41485e5561079a667d84d276c71be5a4
-EBUILD exim-4.84-r99.ebuild 12405 SHA256 
c62882bcabceff343d0384e3ddb34dbdce36af3594bbd00dd2f21cf985b97f51 SHA512 
2198d439730ed2429ef113a7898bcf69d131a81bcc0e612bfc67f4b7f34ac09df561304f8c27bee1640c784f1718cd527e1cac236e2a401994421b4acc51af90
 WHIRLPOOL 
6eb6d0e1ba489623779c13bc43ba88e97b383b518eefd51319ec9ef8c61fbb15eddc8bdd2d1fa70ba4ef10265df41629c9c36ec6c6160ba6c484d4b5e12f707b
+EBUILD exim-4.85-r99.ebuild 12277 SHA256 
9320f7b93c2565386839054b3804a16125c078e744d6cc551e8e579f4aa35a85 SHA512 
b98a3721fcf0d144ada88ab9a3761fe85cf19ffc04259f678d28822cb9c2f94c4b2271265f60db59919b3e547e88848797d172088d820f75c1107ee182c78c0c
 WHIRLPOOL 
3fdea090d6f61748fdf86036377682d675b7e18dd92f096e9eca7f503f491184ddec5f3475d80077d9cde8697b0fb30c8505795d32d3e00e3182f169558986b0
 MISC metadata.xml 2299 SHA256 
a2985b24eb4e06b72f5c3a77403fd36e511112d789c584c391f344f547b21bcf SHA512 
a7d4c9faf6240b5795e1da7df99f918bf438b1bf93fbe9ce12269b0f48000beb622dfad2489337f35b42c342605cd19359edf4e581794fc33f76a4cb0d035568
 WHIRLPOOL 
7eb7ade4038826e0947df620a65044acd2167b32126963c3f28336050680b05e4dca211588b722e7fb8273e13e171690a5ba0114182047e0690c43fdf244b71f

diff --git a/mail-mta/exim/exim-4.84-r99.ebuild 
b/mail-mta/exim/exim-4.85-r99.ebuild
similarity index 96%
rename from mail-mta/exim/exim-4.84-r99.ebuild
rename to mail-mta/exim/exim-4.85-r99.ebuild
index e160456..20a63f2 100644
--- a/mail-mta/exim/exim-4.84-r99.ebuild
+++ b/mail-mta/exim/exim-4.85-r99.ebuild
@@ -1,6 +1,6 @@
 # Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/exim/exim-4.84.ebuild,v 1.17 
2015/03/21 21:18:34 jlec Exp $
+# $Id$
 
 EAPI="5"
 
@@ -19,7 +19,7 @@ HOMEPAGE="http://www.exim.org/";
 
 SLOT="0"
 LICENSE="GPL-2"
-KEYWORDS="amd64 ppc ~mips  x86"
+KEYWORDS="amd64 ppc x86"
 
 COMMON_DEPEND=">=sys-apps/sed-4.0.5
        >=sys-libs/db-3.2
@@ -117,7 +117,6 @@ src_configure() {
 
        if use elibc_musl; then
                sed -e 's/^LIBS = -lnsl/LIBS =/g' \
-               -e 's/^HAVE_ICONV=yes/#HAVE_ICONV=yes/' \
                -i OS/Makefile-Linux
        fi
 
@@ -127,6 +126,7 @@ src_configure() {
                INFO_DIRECTORY=${EPREFIX}/usr/share/info
                PID_FILE_PATH=${EPREFIX}/run/exim.pid
                SPOOL_DIRECTORY=${EPREFIX}/var/spool/exim
+               HAVE_ICONV=yes
        EOC
 
        # if we use libiconv, now is the time to tell so
@@ -349,7 +349,7 @@ src_configure() {
        # Transport post-delivery actions
        if use tpda; then
                cat >> Makefile <<- EOC
-                       EXPERIMENTAL_TPDA=yes
+                       EXPERIMENTAL_EVENT=yes
                EOC
        fi
 
@@ -469,14 +469,14 @@ src_install () {
        insinto /etc/logrotate.d
        newins "${FILESDIR}/exim.logrotate" exim
 
-       newinitd "${FILESDIR}"/exim.rc8 exim
+       newinitd "${FILESDIR}"/exim.rc9 exim
        newconfd "${FILESDIR}"/exim.confd exim
 
        systemd_dounit 
"${FILESDIR}"/{exim.service,exim.socket,exim-submission.socket}
        systemd_newunit "${FILESDIR}"/exim_at.service '[email protected]'
        systemd_newunit "${FILESDIR}"/exim-submission_at.service 
'[email protected]'
 
-       DIROPTIONS="-m 0750 -o ${MAILUSER} -g ${MAILGROUP}"
+       diropts -m 0750 -o ${MAILUSER} -g ${MAILGROUP}
        dodir /var/log/${PN}
 }
 
@@ -498,13 +498,13 @@ pkg_postinst() {
                einfo "configure DMARC, for usage see the documentation at "
                einfo "experimental-spec.txt."
        fi
-       use tpda && einfo "TPDA support is experimental"
+       use tpda && einfo "TPDA/EVENT support is experimental"
        use proxy && einfo "proxy support is experimental"
        if use dsn ; then
                einfo "Starting from Exim 4.83, DSN support comes from 
upstream."
                einfo "DSN support is an experimental feature.  If you used DSN"
                einfo "support prior to 4.83, make sure to remove all 
dsn_process"
-               einfo "switches from your routers, see 
http://bugs.gentoo.org/511818";
+               einfo "switches from your routers, see 
https://bugs.gentoo.org/511818";
        fi
        einfo "Exim maintains some db files under its spool directory that need"
        einfo "cleaning from time to time.  (${EROOT}var/spool/exim/db)"

diff --git a/mail-mta/exim/files/exim-4.76-dsn.patch 
b/mail-mta/exim/files/exim-4.76-dsn.patch
deleted file mode 100644
index 8a608ba..0000000
--- a/mail-mta/exim/files/exim-4.76-dsn.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-http://bugs.gentoo.org/show_bug.cgi?id=366835
-https://sourceforge.net/tracker/?func=detail&aid=3300653&group_id=121058&atid=689120
-
---- exim_469_dsn_1_3.patch
-+++ exim_469_dsn_1_3.patch
-@@ -524,10 +524,10 @@
- diff -urN exim-4.69-orig/src/readconf.c exim-4.69-dsn/src/readconf.c
- --- exim-4.69-orig/src/readconf.c     2007-08-23 12:01:49.000000000 +0100
- +++ exim-4.69-dsn/src/readconf.c      2008-07-28 09:52:55.000000000 +0100
--@@ -207,6 +207,9 @@
--   { "dns_ipv4_lookup",          opt_stringptr,   &dns_ipv4_lookup },
-+@@ -219,6 +219,9 @@
-    { "dns_retrans",              opt_time,        &dns_retrans },
-    { "dns_retry",                opt_int,         &dns_retry },
-+   { "dns_use_edns0",            opt_int,         &dns_use_edns0 },
- +#ifdef SUPPORT_DSN
- +  { "dsn",                      opt_bool,        &dsn },
- +#endif

diff --git a/mail-mta/exim/files/exim-4.77-makefile-freebsd.patch 
b/mail-mta/exim/files/exim-4.77-makefile-freebsd.patch
deleted file mode 100644
index f3c0332..0000000
--- a/mail-mta/exim/files/exim-4.77-makefile-freebsd.patch
+++ /dev/null
@@ -1,48 +0,0 @@
---- OS/Makefile-FreeBSD
-+++ OS/Makefile-FreeBSD
-@@ -1,12 +1,10 @@
--# Exim: OS-specific make file for FreeBSD
--# There's no setting of CFLAGS here, to allow the system default
--# for "make" to be the default.
--
--PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout
--
--CHOWN_COMMAND=/usr/sbin/chown
--STRIP_COMMAND=/usr/bin/strip
--CHMOD_COMMAND=/bin/chmod
-+# Exim: OS-specific FreeBSD make file, modified for Gentoo Prefix
-+
-+
-+BASENAME_COMMAND=look_for_it
-+CHOWN_COMMAND=look_for_it
-+CHGRP_COMMAND=look_for_it
-+CHMOD_COMMAND=look_for_it
- 
- HAVE_SA_LEN=YES
- 
-@@ -18,23 +16,12 @@
- # Dynamicly loaded modules need to be built with -fPIC
- CFLAGS_DYNAMIC=-shared -rdynamic -fPIC
- 
--# FreeBSD always ships with Berkeley DB
-+DBMLIB = -ldb
- USE_DB=yes
- 
--# This code for building outside ports suggested by Richard Clayton
--.ifdef   X11BASE
--X11=${X11BASE}
--.elifdef LOCALBASE
--X11=$(LOCALBASE)
--.else
--X11=/usr/local
--.endif
--
-+X11=/usr/X11R6
- XINCLUDE=-I$(X11)/include
- XLFLAGS=-L$(X11)/lib
--.if ${PORTOBJFORMAT} == "elf"
--XLFLAGS+=-Wl,-rpath,${X11}/lib
--.endif
- X11_LD_LIB=$(X11)/lib
- 
- EXIWHAT_PS_ARG=-ax

diff --git a/mail-mta/exim/files/exim_482_dsn_1_3.patch 
b/mail-mta/exim/files/exim_482_dsn_1_3.patch
deleted file mode 100644
index c300699..0000000
--- a/mail-mta/exim/files/exim_482_dsn_1_3.patch
+++ /dev/null
@@ -1,1212 +0,0 @@
-Modified for 4.82 by Gentoo -- not the official patch from
-http://sourceforge.net/projects/eximdsn/
-
-diff -Naur exim-4.82_RC5.orig/README.DSN exim-4.82_RC5/README.DSN
---- exim-4.82_RC5.orig/README.DSN      1970-01-01 01:00:00.000000000 +0100
-+++ exim-4.82_RC5/README.DSN   2013-10-27 21:47:32.000000000 +0100
-@@ -0,0 +1,118 @@
-+Exim DSN Patch (4.76)
-+---------------------
-+
-+This patch is free software; you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation; either version 2 of the License, or
-+(at your option) any later version.
-+
-+This patch is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with this patch; if not, write to the Free Software
-+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
-+
-+Install
-+-------
-+cd into the source tree for a vanilla exim
-+
-+patch -p1 </path/to/patch/file.patch
-+
-+Example :-
-+[root@linuxbuild exim-4.72-test]# patch -p1 <../exim.dsn.patch-472
-+
-+Expected Output :-
-+patching file README.DSN
-+patching file src/config.h.defaults
-+patching file src/deliver.c
-+patching file src/exim.c
-+patching file src/exim.h
-+patching file src/globals.c
-+patching file src/globals.h
-+patching file src/local_scan.h
-+patching file src/macros.h
-+patching file src/readconf.c
-+patching file src/route.c
-+patching file src/smtp_in.c
-+patching file src/spool_in.c
-+patching file src/spool_out.c
-+patching file src/structs.h
-+patching file src/transport.c
-+patching file src/transports/smtp.c
-+
-+
-+This patch can be included / excluded from the compilation by use of the 
#define SUPPORT_DSN
-+which gets added into src/config.h.defaults & src/EDITME by the patch.
-+
-+Use
-+---
-+
-+The facility (once compiled in) can be turned on for a particular router via 
the
-+dsn_process directive Eg :-
-+
-+dest_delivery_int:
-+  driver = manualroute
-+  domains = +relay_to_domains
-+  condition = ${if eq {${lc:$sender_address_domain}}\
-+                                 {domain.com}\
-+                                 {yes}{no}\
-+                       }
-+  dsn_process
-+  hide route_data = ${lc:${extract{mailHost}{$address_data}{$value}{}}}
-+  transport = remote_smtp
-+
-+Exim will produce 1 of 2 DSN's back to the originator, or pass on the DSN 
request.
-+The 2 DSN's will either contain (relayed via non "Remote SMTP" router) or
-+(relayed to non-DSN-aware mailer) depending on if the delivery was VIA an SMTP
-+transport or not.
-+
-+
-+Credits
-+-------
-+
-+The original work for the patch was done by Philip Hazel in Exim 3
-+
-+The extract was taken and re-applied to Exim 4 by the following :-
-+Phil Bingham   ([email protected])
-+Steve Falla    ([email protected])
-+Ray Edah       ([email protected])
-+Andrew Johnson ([email protected])
-+Adrian Hungate ([email protected])
-+
-+Now Primarily maintained by :-
-+Andrew Johnson ([email protected])
-+
-+Contributions
-+-------------
-+Andrey J. Melnikoff (TEMHOTA) ([email protected]) 
-+
-+
-+ChangeLog
-+---------
-+
-+14-Apr-2006 : Changed subject to "Delivery Status Notification"
-+
-+17-May-2006 : debug_printf in spool-in.c were not wrapped with #ifndef 
COMPILE_UTILITY
-+              thanks to Andrey J. Melnikoff for this information
-+
-+12-Sep-2006 : Now supports Exim 4.63
-+
-+12-Sep-2006 : src/EDITME did not include the #define SUPPORT_DSN as stated
-+              in the documentation, this has now been corrected
-+              thanks to Robert Kehl for this information
-+
-+28-Jul-2008 : New version for exim 4.69 released.
-+
-+02-Jul-2010 : New version for exim 4.72 released.
-+
-+20-May-2011 : New version for exim 4.76 released.
-+
-+
-+Support for this patch (limited though it is) will only be provided through 
the SourceForge
-+project page (http://sourceforge.net/projects/eximdsn/)
-+
-+--
-+Andrew Johnson Cable & Wireless
-diff -Naur exim-4.82_RC5.orig/src/config.h.defaults 
exim-4.82_RC5/src/config.h.defaults
---- exim-4.82_RC5.orig/src/config.h.defaults   2013-10-27 21:46:25.000000000 
+0100
-+++ exim-4.82_RC5/src/config.h.defaults        2013-10-27 21:47:32.000000000 
+0100
-@@ -136,6 +136,7 @@
- #define SUPPORT_MOVE_FROZEN_MESSAGES
- #define SUPPORT_PAM
- #define SUPPORT_TLS
-+#define SUPPORT_DSN
- #define SUPPORT_TRANSLATE_IP_ADDRESS
- 
- #define SYSLOG_LOG_PID
-diff -Naur exim-4.82_RC5.orig/src/deliver.c exim-4.82_RC5/src/deliver.c
---- exim-4.82_RC5.orig/src/deliver.c   2013-10-27 21:46:25.000000000 +0100
-+++ exim-4.82_RC5/src/deliver.c        2013-10-27 21:47:32.000000000 +0100
-@@ -63,6 +63,9 @@
- static address_item *addr_remote = NULL;
- static address_item *addr_route = NULL;
- static address_item *addr_succeed = NULL;
-+#ifdef SUPPORT_DSN
-+static address_item *addr_dsntmp = NULL;
-+#endif
- 
- static FILE *message_log = NULL;
- static BOOL update_spool;
-@@ -2966,6 +2969,15 @@
-       addr->flags |= af_prdr_used; break;
- #endif
- 
-+    #ifdef SUPPORT_DSN
-+    case 'D':
-+    if (addr == NULL) break;
-+    addr->dsn_aware = (*ptr)? string_copy(ptr) : string_copy(" ");
-+    while (*ptr++);
-+    DEBUG(D_deliver) debug_printf("DSN read: addr->dsn_aware = %s\n", 
addr->dsn_aware);
-+    break;
-+    #endif
-+
-     case 'A':
-     if (addr == NULL)
-       {
-@@ -4074,6 +4086,15 @@
-       if (addr->flags & af_prdr_used) rmt_dlv_checked_write(fd, "P", 1);
-       #endif
- 
-+      #ifdef SUPPORT_DSN
-+      if (addr->dsn_aware == NULL)
-+        addr->dsn_aware = string_copy(" ");
-+      DEBUG(D_deliver) debug_printf("DSN write: addr->dsn_aware = %s\n", 
addr->dsn_aware);     
-+      sprintf(big_buffer, "D%s", addr->dsn_aware);
-+      DEBUG(D_deliver) debug_printf("DSN write: big_buffer = %s (%d)\n", 
big_buffer, strlen(big_buffer)+1);
-+      write(fd, big_buffer, strlen(big_buffer)+1);
-+      #endif
-+
-       /* Retry information: for most success cases this will be null. */
- 
-       for (r = addr->retries; r != NULL; r = r->next)
-@@ -5219,6 +5240,14 @@
-       if (r->pno >= 0)
-         new->onetime_parent = recipients_list[r->pno].address;
- 
-+      #ifdef SUPPORT_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_printf("DSN (deliver): orcpt: %s  flags: %d\n", new->dsn_orcpt, 
new->dsn_flags);   
-+      #endif
-+
-       switch (process_recipients)
-         {
-         /* RECIP_DEFER is set when a system filter freezes a message. */
-@@ -6163,6 +6192,12 @@
-     regex_must_compile(US"\\n250[\\s\\-]PRDR(\\s|\\n|$)", FALSE, TRUE);
-   #endif
- 
-+  #ifdef SUPPORT_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
-   cannot be delivered in one transaction. */
-@@ -6267,6 +6302,179 @@
- 
- else if (!dont_deliver) retry_update(&addr_defer, &addr_failed, 
&addr_succeed);
- 
-+#ifdef SUPPORT_DSN
-+/* ********** philb - Send DSN for successful messages */
-+
-+addr_dsntmp = addr_succeed;
-+
-+while(addr_dsntmp != NULL)
-+{
-+   BOOL dsn_sendmessage = FALSE;
-+   uschar dsnmsgbuf[4096];
-+ 
-+   DEBUG(D_deliver)
-+      debug_printf("DSN: processing router : %s\n", 
addr_dsntmp->router->name);
-+
-+   DEBUG(D_deliver)
-+      debug_printf("DSN: processing successful delivery address: %s\n", 
addr_dsntmp->address);
-+  
-+   if (testflag(addr_dsntmp, af_ignore_error))
-+   {   
-+      DEBUG(D_deliver)
-+         debug_printf("DSN: Ignore error for: %s\n", addr_dsntmp->address);
-+   }
-+   else
-+   {
-+     DEBUG(D_deliver) debug_printf("DSN: Checking Flag\n");    
-+     if (addr_dsntmp->dsn_aware == NULL) {
-+         DEBUG(D_deliver) debug_printf("DSN: dsn_aware was NULL, setting to 
space at %s %d\n", __FILE__, __LINE__);
-+         addr_dsntmp->dsn_aware = string_copy(" ");
-+     }
-+     DEBUG(D_deliver) debug_printf("DSN: Sender_address: %s\n", 
sender_address);       
-+     DEBUG(D_deliver) debug_printf("DSN: orcpt: %s  flags: %d\n", 
addr_dsntmp->dsn_orcpt, addr_dsntmp->dsn_flags);     
-+     DEBUG(D_deliver) debug_printf("DSN: envid: %s  ret: %d\n", dsn_envid, 
dsn_ret);   
-+     DEBUG(D_deliver) debug_printf("DSN: Remote SMTP server supports DSN: 
%s\n", addr_dsntmp->dsn_aware);      
-+              
-+      /* Process the flags */
-+     if((addr_dsntmp->dsn_flags & rf_dsnflags) != 0) 
-+     {
-+         /* We've got at least one flag set */
-+
-+       /* set flag so we don't send bounces */
-+       setflag(addr_dsntmp, af_ignore_error);
-+
-+       if((addr_dsntmp->dsn_flags & rf_notify_never) != 0)
-+         {
-+            DEBUG(D_deliver) debug_printf("DSN: NEVER FLAG\n");
-+
-+            /* nothing to do here */
-+         }
-+         
-+         if((addr_dsntmp->dsn_flags & rf_notify_success) != 0)
-+         {
-+            DEBUG(D_deliver) debug_printf("DSN: SUCCESS FLAG\n");
-+
-+            dsn_sendmessage = TRUE;
-+         }
-+
-+         if((addr_dsntmp->dsn_flags & rf_notify_failure) != 0)
-+         {
-+            DEBUG(D_deliver) debug_printf("DSN: FAILURE FLAG\n");
-+
-+            /* allow bounce messages */
-+            clearflag(addr_dsntmp, af_ignore_error);
-+         }
-+
-+         if((addr_dsntmp->dsn_flags & rf_notify_delay) != 0)
-+         {
-+            DEBUG(D_deliver) debug_printf("DSN: DELAY FLAG\n");
-+
-+            /* hmm, what to do here? */
-+         }
-+      }
-+
-+      if ((addr_dsntmp->dsn_aware != 0) && (addr_dsntmp->dsn_aware[0] != 'Y') 
&& (dsn_sendmessage == TRUE) && (addr_dsntmp->router->dsn_process == TRUE))
-+      {
-+         pid_t pid;
-+         int fd;
-+      
-+       /* remote MTA does not support DSN, so we need to send message */
-+       
-+       /* create exim process to send message */       
-+       pid = child_open_exim(&fd);
-+
-+         DEBUG(D_deliver) debug_printf("DSN: child_open_exim returns: %d\n", 
pid);
-+       
-+       if (pid < 0)  /* Creation of child failed */
-+       {
-+          log_write(0, LOG_MAIN|LOG_PANIC_DIE, "Process %d (parent %d) failed 
to "
-+               "create child process to send failure message: %s", getpid(),
-+               getppid(), strerror(errno));
-+
-+             DEBUG(D_deliver) debug_printf("DSN: child_open_exim failed\n");
-+
-+         }     
-+       else  /* Creation of child succeeded */
-+       {
-+           FILE *f = fdopen(fd, "wb");
-+         int topt = topt_add_return_path;
-+         uschar boundaryStr[64];
-+         
-+           DEBUG(D_deliver) debug_printf("sending error message to: %s\n", 
sender_address);
-+      
-+           /* build unique id for MIME boundary */
-+           snprintf(boundaryStr, 63, "%d-cwdsn-%d", pid, rand());      
-+           DEBUG(D_deliver) debug_printf("DSN: MIME boundary: %s\n", 
boundaryStr);
-+      
-+           /* if the sender doesn't want the whole message returned, don't 
send the body */
-+           if (dsn_ret != dsn_ret_full) topt |= topt_no_body;
-+      
-+           if (errors_reply_to != NULL) fprintf(f,"Reply-To: %s\n", 
errors_reply_to);
-+     
-+         fprintf(f,"Auto-Submitted: auto-generated\n");
-+         fprintf(f,"From: Mail Delivery System <Mailer-Daemon@%s>\n", 
qualify_domain_sender);
-+         fprintf(f,"To: %s\n", sender_address);
-+         fprintf(f,"Subject: Delivery Status Notification\n");
-+         fprintf(f,"Content-Type: multipart/report; 
report-type=delivery-status; boundary=%s\n", boundaryStr);
-+           fprintf(f,"MIME-Version: 1.0\n\n");
-+
-+           fprintf(f,"--%s\n", boundaryStr);
-+         fprintf(f,"Content-type: text/plain; charset=us-ascii\n\n");
-+         
-+         fprintf(f,"This message was created automatically by mail delivery 
software.\n");
-+         fprintf(f," ----- The following addresses had successful delivery 
notifications -----\n");
-+/* AH: added specific message for non "Remote SMTP" situations */
-+           if (addr_dsntmp->dsn_aware[0] == 'N') {
-+           fprintf(f,"<%s> (relayed to non-DSN-aware mailer)\n\n", 
addr_dsntmp->address);
-+           } else {
-+           fprintf(f,"<%s> (relayed via non \"Remote SMTP\" router)\n\n", 
addr_dsntmp->address);
-+           }
-+
-+         fprintf(f,"--%s\n", boundaryStr);
-+         fprintf(f,"Content-type: message/delivery-status\n\n");
-+         
-+           if (dsn_envid) { /* Test for NULL added by GC */
-+               fprintf(f,"Original-Envelope-Id: %s\n", dsn_envid);
-+           }
-+         fprintf(f,"Reporting-MTA: dns; %s\n", qualify_domain_sender);
-+           if (addr_dsntmp->dsn_orcpt) { /* Test for NULL added by GC */
-+               fprintf(f,"Original-Recipient: %s\n", addr_dsntmp->dsn_orcpt);
-+           }
-+         fprintf(f,"Action: delivered\n\n");
-+         
-+         fprintf(f,"--%s\n", boundaryStr);
-+         fprintf(f,"Content-type: message/rfc822\n\n");
-+         
-+         fflush(f);
-+         transport_filter_argv = NULL;   /* Just in case */
-+           return_path = sender_address;   /* In case not previously set */
-+         
-+         /* Write the original email out */
-+         transport_write_message(NULL, fileno(f), topt, 2048, NULL, NULL, 
NULL, NULL, NULL, 0);          
-+         fflush(f);
-+            
-+         fprintf(f,"\n");        
-+         fprintf(f,"--%s--\n", boundaryStr);
-+         
-+         fflush(f);              
-+         fclose(f);
-+           rc = child_close(pid, 0);     /* Waits for child to close, no 
timeout */
-+      }
-+      }
-+      else
-+      {  if (addr_dsntmp->router->dsn_process == TRUE)
-+       DEBUG(D_deliver) debug_printf("DSN: *** NOT SENDING DSN SUCCESS 
Message ***\n"); 
-+         if (addr_dsntmp->router->dsn_process == FALSE)
-+       DEBUG(D_deliver) debug_printf("DSN: *** NOT SENDING DSN SUCCESS 
Message (gagged) ***\n"); 
-+      }
-+   }
-+
-+   addr_dsntmp = addr_dsntmp->next;
-+}
-+
-+/* ********** philb - end of mod */
-+#endif
-+
- /* 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
- several messages to get sent if there are addresses with different
-diff -Naur exim-4.82_RC5.orig/src/EDITME exim-4.82_RC5/src/EDITME
---- exim-4.82_RC5.orig/src/EDITME      2013-10-27 21:46:25.000000000 +0100
-+++ exim-4.82_RC5/src/EDITME   2013-10-27 21:47:32.000000000 +0100
-@@ -192,6 +192,8 @@
- # least one type of lookup. You should consider whether you want to build
- # the Exim monitor or not.
- 
-+# Support DSN
-+SUPPORT_DSN=yes
- 
- 
#------------------------------------------------------------------------------
- # These settings determine which individual router drivers are included in the
-diff -Naur exim-4.82_RC5.orig/src/exim.c exim-4.82_RC5/src/exim.c
---- exim-4.82_RC5.orig/src/exim.c      2013-10-27 21:46:25.000000000 +0100
-+++ exim-4.82_RC5/src/exim.c   2013-10-27 21:47:32.000000000 +0100
-@@ -831,6 +831,9 @@
- #ifdef EXPERIMENTAL_REDIS
-   fprintf(f, " Experimental_Redis");
- #endif
-+#ifdef SUPPORT_DSN
-+  fprintf(f, " C&W_DSN_1.3");
-+#endif
- fprintf(f, "\n");
- 
- fprintf(f, "Lookups (built-in):");
-@@ -2653,6 +2656,16 @@
-       break;
-       }
- 
-+    #ifdef SUPPORT_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 (strcmp(argrest, "CD") == 0)
-+      {
-+      smtp_use_dsn = TRUE;
-+      break;
-+      }
-+    #endif
-+
-     /* -MCP: set the smtp_use_pipelining flag; this is useful only when
-     it preceded -MC (see above) */
- 
-diff -Naur exim-4.82_RC5.orig/src/globals.c exim-4.82_RC5/src/globals.c
---- exim-4.82_RC5.orig/src/globals.c   2013-10-27 21:46:25.000000000 +0100
-+++ exim-4.82_RC5/src/globals.c        2013-10-27 21:47:32.000000000 +0100
-@@ -124,6 +124,13 @@
- uschar *local_scan_path        = NULL;
- #endif
- 
-+#ifdef SUPPORT_DSN
-+BOOL   dsn                    = TRUE;
-+uschar  *dsn_envid            = NULL;
-+int    dsn_ret                = 0;
-+const pcre  *regex_DSN        = NULL;
-+BOOL   smtp_use_dsn           = FALSE;
-+#endif
- 
- #ifdef SUPPORT_TLS
- BOOL    gnutls_compat_mode     = FALSE;
-@@ -341,6 +348,11 @@
-   NULL,                       /* authenticator */
-   NULL,                       /* auth_id */
-   NULL,                       /* auth_sndr */
-+  #ifdef SUPPORT_DSN
-+  NULL,                 /* dsn_orcpt */
-+  0,                    /* dsn_flags */
-+  NULL,                 /* dsn_aware */
-+  #endif
-   (uid_t)(-1),          /* uid */
-   (gid_t)(-1),          /* gid */
-   0,                    /* flags */
-@@ -1096,6 +1108,9 @@
-     TRUE,                      /* verify_sender */
-     FALSE,                     /* uid_set */
-     FALSE,                     /* unseen */
-+#ifdef SUPPORT_DSN
-+    FALSE,                     /* dsn_process */
-+#endif
- 
-     self_freeze,               /* self_code */
-     (uid_t)(-1),               /* uid */
-@@ -1105,6 +1120,7 @@
-     NULL,                      /* transport instance */
-     NULL,                      /* pass_router */
-     NULL                       /* redirect_router */
-+
- };
- 
- uschar *router_name            = NULL;
-diff -Naur exim-4.82_RC5.orig/src/globals.h exim-4.82_RC5/src/globals.h
---- exim-4.82_RC5.orig/src/globals.h   2013-10-27 21:46:25.000000000 +0100
-+++ exim-4.82_RC5/src/globals.h        2013-10-27 21:47:32.000000000 +0100
-@@ -130,6 +130,13 @@
- extern int (*receive_ferror)(void);
- extern BOOL (*receive_smtp_buffered)(void);
- 
-+#ifdef SUPPORT_DSN
-+extern BOOL   dsn;                    /* FALSE if DSN not to be used */
-+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 */
-+#endif
- 
- /* For clearing, saving, restoring address expansion variables. We have to 
have
- the size of this vector set explicitly, because it is referenced from more 
than
-diff -Naur exim-4.82_RC5.orig/src/local_scan.h exim-4.82_RC5/src/local_scan.h
---- exim-4.82_RC5.orig/src/local_scan.h        2013-10-27 21:46:25.000000000 
+0100
-+++ exim-4.82_RC5/src/local_scan.h     2013-10-27 21:47:32.000000000 +0100
-@@ -124,9 +124,13 @@
- field is always NULL except for one_time aliases that had errors_to on the
- routers that generated them. */
- 
-+/* Added the dsn attributes orcpt and dsn_flags for DSN support*/
-+
- typedef struct recipient_item {
-   uschar *address;              /* the recipient address */
-   int     pno;                  /* parent number for "one_time" alias, or -1 
*/
-+  uschar *orcpt;                /* DSN orcpt */
-+  int    dsn_flags;             /* DSN flags */
-   uschar *errors_to;            /* the errors_to address or NULL */
- #ifdef EXPERIMENTAL_BRIGHTMAIL
-   uschar *bmi_optin;
-diff -Naur exim-4.82_RC5.orig/src/macros.h exim-4.82_RC5/src/macros.h
---- exim-4.82_RC5.orig/src/macros.h    2013-10-27 21:46:25.000000000 +0100
-+++ exim-4.82_RC5/src/macros.h 2013-10-27 21:47:32.000000000 +0100
-@@ -778,6 +778,22 @@
- #define topt_no_body            0x040  /* Omit body */
- #define topt_escape_headers     0x080  /* Apply escape check to headers */
- 
-+ /* Flags for recipient_block, used in DSN support */
-+
-+ #define rf_onetime              0x01  /* A one-time alias */
-+ #define rf_notify_never         0x02  /* NOTIFY= settings */
-+ #define rf_notify_success       0x04
-+ #define rf_notify_failure       0x08
-+ #define rf_notify_delay         0x10
-+
-+ #define rf_dsnflags  (rf_notify_never | rf_notify_success | \
-+                       rf_notify_failure | rf_notify_delay)
-+
-+ /* DSN RET types */
-+
-+ #define dsn_ret_full            1
-+ #define dsn_ret_hdrs            2
-+
- /* Codes for the host_find_failed and host_all_ignored options. */
- 
- #define hff_freeze   0
-diff -Naur exim-4.82_RC5.orig/src/readconf.c exim-4.82_RC5/src/readconf.c
---- exim-4.82_RC5.orig/src/readconf.c  2013-10-27 21:46:25.000000000 +0100
-+++ exim-4.82_RC5/src/readconf.c       2013-10-27 21:49:15.000000000 +0100
-@@ -229,6 +229,9 @@
-  /* This option is now a no-op, retained for compability */
-   { "drop_cr",                  opt_bool,        &drop_cr },
- /*********************************************************/
-+#ifdef SUPPORT_DSN
-+  { "dsn",                      opt_bool,        &dsn },
-+#endif
-   { "dsn_from",                 opt_stringptr,   &dsn_from },
-   { "envelope_to_remove",       opt_bool,        &envelope_to_remove },
-   { "errors_copy",              opt_stringptr,   &errors_copy },
-diff -Naur exim-4.82_RC5.orig/src/receive.c exim-4.82_RC5/src/receive.c
---- exim-4.82_RC5.orig/src/receive.c   2013-10-27 21:46:25.000000000 +0100
-+++ exim-4.82_RC5/src/receive.c        2013-10-27 21:47:32.000000000 +0100
-@@ -490,6 +490,8 @@
-     memcpy(recipients_list, oldlist, oldmax * sizeof(recipient_item));
-   }
- 
-+/* memset added by GC to blank dsn records, etc. */
-+memset(&recipients_list[recipients_count], 0, sizeof(recipient_item));
- recipients_list[recipients_count].address = recipient;
- recipients_list[recipients_count].pno = pno;
- #ifdef EXPERIMENTAL_BRIGHTMAIL
-diff -Naur exim-4.82_RC5.orig/src/route.c exim-4.82_RC5/src/route.c
---- exim-4.82_RC5.orig/src/route.c     2013-10-27 21:46:25.000000000 +0100
-+++ exim-4.82_RC5/src/route.c  2013-10-27 21:47:32.000000000 +0100
-@@ -58,6 +58,10 @@
-                  (void *)offsetof(router_instance, domains) },
-   { "driver",             opt_stringptr|opt_public,
-                  (void *)offsetof(router_instance, driver_name) },
-+  #ifdef SUPPORT_DSN
-+  { "dsn_process",        opt_bool|opt_public,
-+                 (void *)offsetof(router_instance, dsn_process) },
-+  #endif
-   { "errors_to",          opt_stringptr|opt_public,
-                  (void *)(offsetof(router_instance, errors_to)) },
-   { "expn",               opt_bool|opt_public,
-@@ -270,6 +274,13 @@
- 
-   if (r->pass_router_name != NULL)
-     set_router(r, r->pass_router_name, &(r->pass_router), TRUE);
-+
-+  #ifdef SUPPORT_DSN
-+    if (r->dsn_process == FALSE)
-+      DEBUG(D_route) debug_printf("%s router skipping DSN - add dsn_process 
to router\n", r->name);
-+    if (r->dsn_process == TRUE)
-+      DEBUG(D_route) debug_printf("%s router performing DSN \n", r->name);
-+  #endif
-   }
- }
- 
-@@ -1412,7 +1423,10 @@
- 
- copyflag(new, addr, af_propagate);
- new->p.address_data = addr->p.address_data;
--
-+#ifdef SUPPORT_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
-  * clone. Thinking about it, it isn't entirely clear whether they should be
-diff -Naur exim-4.82_RC5.orig/src/smtp_in.c exim-4.82_RC5/src/smtp_in.c
---- exim-4.82_RC5.orig/src/smtp_in.c   2013-10-27 21:46:25.000000000 +0100
-+++ exim-4.82_RC5/src/smtp_in.c        2013-10-27 21:47:32.000000000 +0100
-@@ -213,6 +213,9 @@
- #ifdef EXPERIMENTAL_PRDR
-   ENV_MAIL_OPT_PRDR,
- #endif
-+#ifdef SUPPORT_DSN
-+  ENV_MAIL_OPT_RET, ENV_MAIL_OPT_ENVID,
-+#endif
-   ENV_MAIL_OPT_NULL
-   };
- typedef struct {
-@@ -228,6 +231,10 @@
- #ifdef EXPERIMENTAL_PRDR
-     { US"PRDR",   ENV_MAIL_OPT_PRDR,   FALSE },
- #endif
-+#ifdef SUPPORT_DSN
-+    { US"RET",    ENV_MAIL_OPT_RET,    FALSE },
-+    { US"ENVID",  ENV_MAIL_OPT_ENVID,  FALSE },
-+#endif
-     { US"NULL",   ENV_MAIL_OPT_NULL,   FALSE }
-   };
- 
-@@ -1073,6 +1080,13 @@
- 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 SUPPORT_DSN
-+/* Reset the DSN flags */
-+dsn_ret = 0;
-+dsn_envid = NULL;
-+#endif
-+
- authenticated_sender = NULL;
- #ifdef EXPERIMENTAL_BRIGHTMAIL
- bmi_run = 0;
-@@ -2679,6 +2693,10 @@
-   int ptr, size, rc;
-   int c, i;
-   auth_instance *au;
-+#ifdef SUPPORT_DSN
-+  uschar *orcpt = NULL;
-+  int flags;
-+#endif
- 
-   switch(smtp_read_command(TRUE))
-     {
-@@ -3106,6 +3124,12 @@
-         s = string_cat(s, &size, &ptr, US"-8BITMIME\r\n", 11);
-         }
- 
-+      #ifdef SUPPORT_DSN
-+      /* Advertise DSN support if configured to do so. */
-+      if (dsn) 
-+        s = string_cat(s, &size, &ptr, US"250-DSN\r\n", 9);
-+      #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. */
- 
-@@ -3360,6 +3384,42 @@
-           arg_error = TRUE;
-           break;
- 
-+#ifdef SUPPORT_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. */
-+
-+        case ENV_MAIL_OPT_RET:
-+          /* Check if RET has already been set */
-+          if (dsn_ret > 0) {
-+            synprot_error(L_smtp_syntax_error, 501, NULL,
-+              US"RET can be specified once only");
-+            goto COMMAND_LOOP;
-+          }
-+          dsn_ret = (strcmpic(value, US"HDRS") == 0)? dsn_ret_hdrs :
-+                  (strcmpic(value, US"FULL") == 0)? dsn_ret_full : 0;
-+          DEBUG(D_receive) debug_printf("DSN_RET: %d\n", dsn_ret);
-+          /* Check for invalid invalid value, and exit with error */
-+          if (dsn_ret == 0) {
-+            synprot_error(L_smtp_syntax_error, 501, NULL,
-+              US"Value for RET is invalid");
-+            goto COMMAND_LOOP;
-+          }
-+          break;
-+        case ENV_MAIL_OPT_ENVID:
-+          /* Check if the dsn envid has been already set */
-+          if (dsn_envid != NULL) {
-+            synprot_error(L_smtp_syntax_error, 501, NULL,
-+              US"ENVID can be specified once only");
-+            goto COMMAND_LOOP;
-+          }
-+          dsn_envid = string_copy(value);
-+          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
-         authenticated, we set it up as the authenticated sender. However, if 
the
-@@ -3633,6 +3693,89 @@
-       rcpt_fail_count++;
-       break;
-       }
-+    
-+    #ifdef SUPPORT_DSN
-+    /* Set the DSN flags orcpt and dsn_flags from the session*/
-+    orcpt = NULL;
-+    flags = 0;
-+    
-+    if (esmtp) for(;;)
-+      {
-+      uschar *name, *value, *end;
-+      int size;
-+
-+      if (!extract_option(&name, &value))
-+      {
-+         break;
-+      }
-+
-+      if (strcmpic(name, US"ORCPT") == 0)
-+      {
-+        /* Check whether orcpt has been already set */
-+        if (orcpt != NULL) {
-+          synprot_error(L_smtp_syntax_error, 501, NULL,
-+            US"ORCPT can be specified once only");
-+          goto COMMAND_LOOP;
-+        }
-+        orcpt = string_copy(value);
-+        DEBUG(D_receive) debug_printf("DSN orcpt: %s\n", orcpt);
-+      }
-+
-+      else if (strcmpic(name, US"NOTIFY") == 0)
-+      {
-+        /* Check if the notify flags have been already set */
-+        if (flags > 0)
-+        {
-+          synprot_error(L_smtp_syntax_error, 501, NULL,
-+              US"NOTIFY can be specified once only");
-+          goto COMMAND_LOOP;
-+        }
-+        if (strcmpic(value, US"NEVER") == 0) flags |= rf_notify_never; else
-+          {
-+          uschar *p = value;
-+          while (*p != 0)
-+            {
-+            uschar *pp = p;
-+            while (*pp != 0 && *pp != ',') pp++;
-+              if (*pp == ',') *pp++ = 0;
-+            if (strcmpic(p, US"SUCCESS") == 0) {
-+                DEBUG(D_receive) debug_printf("GC: Setting notify success\n");
-+                flags |= rf_notify_success;
-+            }
-+            else if (strcmpic(p, US"FAILURE") == 0) {
-+                DEBUG(D_receive) debug_printf("GC: Setting notify failure\n");
-+                flags |= rf_notify_failure;
-+            }
-+            else if (strcmpic(p, US"DELAY") == 0) {
-+                DEBUG(D_receive) debug_printf("GC: Setting notify delay\n");
-+                flags |= rf_notify_delay;
-+            }
-+            else
-+            {
-+              /* Catch any strange values */
-+              synprot_error(L_smtp_syntax_error, 501, NULL,
-+                US"Invalid value for NOTIFY parameter");
-+              goto COMMAND_LOOP;
-+            }
-+            p = pp;
-+            }
-+            DEBUG(D_receive) debug_printf("DSN Flags: %x\n", flags);
-+          }
-+      }
-+
-+      /* Unknown option. Stick back the terminator characters and break
-+      the loop. An error for a malformed address will occur. */
-+
-+      else
-+        {
-+        DEBUG(D_receive) debug_printf("Invalid dsn command: %s : %s\n", name, 
value);
-+        name[-1] = ' ';
-+        value[-1] = '=';
-+        break;
-+        }
-+      }
-+    #endif
-+
- 
-     /* Apply SMTP rewriting then extract the working address. Don't allow "<>"
-     as a recipient address */
-@@ -3747,6 +3890,24 @@
-       if (user_msg == NULL) smtp_printf("250 Accepted\r\n");
-         else smtp_user_msg(US"250", user_msg);
-       receive_add_recipient(recipient, -1);
-+      
-+      #ifdef SUPPORT_DSN
-+      
-+      /* Set the dsn flags in the recipients_list */
-+      if (orcpt != NULL)
-+         recipients_list[recipients_count-1].orcpt = orcpt;
-+      else
-+         recipients_list[recipients_count-1].orcpt = NULL;
-+         
-+      if (flags != 0)
-+         recipients_list[recipients_count-1].dsn_flags = flags;
-+      else
-+         recipients_list[recipients_count-1].dsn_flags = 0;
-+         debug_printf("DSN-AJ(smtp-in): orcpt: %s  flags: %d\n", 
recipients_list[recipients_count-1].orcpt, 
recipients_list[recipients_count-1].dsn_flags);
-+
-+
-+      #endif
-+      
-       }
- 
-     /* The recipient was discarded */
-diff -Naur exim-4.82_RC5.orig/src/spool_in.c exim-4.82_RC5/src/spool_in.c
---- exim-4.82_RC5.orig/src/spool_in.c  2013-10-27 21:46:25.000000000 +0100
-+++ exim-4.82_RC5/src/spool_in.c       2013-10-27 21:47:32.000000000 +0100
-@@ -293,6 +293,13 @@
- spam_score_int = NULL;
- #endif
- 
-+#ifdef SUPPORT_DSN
-+#ifndef COMPILE_UTILITY
-+dsn_ret = 0;
-+dsn_envid = NULL;
-+#endif  /* COMPILE_UTILITY */
-+#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
- and unsplit directories, as for the data file above. */
-@@ -467,6 +474,19 @@
-     case 'd':
-     if (Ustrcmp(p, "eliver_firsttime") == 0)
-       deliver_firsttime = TRUE;
-+    #ifdef SUPPORT_DSN
-+    #ifndef COMPILE_UTILITY
-+    /* Check if the dsn flags have been set in the header file */
-+    else if (Ustrncmp(p, "sn_ret", 6) == 0)
-+    {
-+      dsn_ret= atoi(big_buffer + 8);
-+    }
-+    else if (Ustrncmp(p, "sn_envid", 8) == 0)
-+    {
-+      dsn_envid = string_copy(big_buffer + 11);
-+    }
-+    #endif  /* COMPILE_UTILITY */
-+    #endif
-     break;
- 
-     case 'f':
-@@ -554,7 +574,7 @@
-       tls_in.sni = string_unprinting(string_copy(big_buffer + 9));
-     break;
-     #endif
--
-+ 
-     default:    /* Present because some compilers complain if all */
-     break;      /* possibilities are not covered. */
-     }
-@@ -604,6 +624,10 @@
-   {
-   int nn;
-   int pno = -1;
-+  #ifdef SUPPORT_DSN
-+  int dsn_flags = 0;
-+  uschar *orcpt = NULL;
-+  #endif
-   uschar *errors_to = NULL;
-   uschar *p;
- 
-@@ -672,10 +696,19 @@
-     }
- 
-   /* Handle current format Exim 4 spool files */
-+  /* Spool file is modified if DSN is supported
-+     Original was "address errors_to len(errors_to),pno
-+     New for DSN support is now:
-+     "address errors_to orcpt len(errors_to),len(orcpt),pno,dsn_flags */
- 
-   else if (*p == '#')
-     {
-     int flags;
-+
-+    #ifndef COMPILE_UTILITY
-+      DEBUG(D_deliver) debug_printf("**** SPOOL_IN - Exim 4 standard format 
spoolfile\n");
-+    #endif  /* COMPILE_UTILITY */
-+
-     (void)sscanf(CS p+1, "%d", &flags);
- 
-     if ((flags & 0x01) != 0)      /* one_time data exists */
-@@ -688,15 +721,82 @@
-         {
-         p -= len;
-         errors_to = string_copy(p);
-+        }     
-+      }
-+
-+    *(--p) = 0;   /* Terminate address */
-+    }
-+    #ifdef SUPPORT_DSN
-+    else if (*p == '!') /* Handle Exim4 + DSN spool files */
-+    {
-+    int flags;
-+    int temp_dsn_flags;
-+
-+    #ifndef COMPILE_UTILITY
-+      DEBUG(D_deliver) debug_printf("**** SPOOL_IN - C&W DSN format 
spoolfile\n");
-+    #endif  /* COMPILE_UTILITY */
-+    
-+    sscanf(CS p+1, "%d,%d", &flags, &temp_dsn_flags);
-+    
-+    if (((flags & 0x01) != 0) || (temp_dsn_flags > 0)) /* one_time data or 
dsn_flags exist */  
-+      {
-+      int len;
-+      int len_orcpt;
-+
-+      #ifndef COMPILE_UTILITY
-+        DEBUG(D_deliver) debug_printf("**** spool_in dsn_flags = 0\n");
-+      #endif  /* COMPILE_UTILITY */
-+
-+      dsn_flags = 0;
-+      
-+      while (isdigit(*(--p)) || *p == ',' || *p == '-');
-+      sscanf(CS p+1, "%d,%d,%d,%d", &len, &len_orcpt, &pno, &dsn_flags);
-+       
-+      *p = 0;
-+      if (len_orcpt > 0)
-+        {
-+          p -= len_orcpt;
-+          orcpt = string_copy(p);
-         }
-+      *(--p) = 0; /* change the space to a NULL */
-+
-+      if (len > 0)
-+        {
-+        p -= len;
-+        errors_to = string_copy(p);
-+        }     
-       }
- 
-     *(--p) = 0;   /* Terminate address */
-     }
-+    #endif
-+    #ifndef COMPILE_UTILITY
-+    else
-+    {
-+       DEBUG(D_deliver) debug_printf("**** SPOOL_IN - No additional 
fields\n");
-+    }
-+    #endif  /* COMPILE_UTILITY */
-+  
-+  #ifdef SUPPORT_DSN
-+    #ifndef COMPILE_UTILITY
-+      DEBUG(D_deliver) debug_printf("**** SPOOL_IN - address: |%s| errorsto: 
|%s| orcpt: |%s| dsn_flags: %d\n",
-+      big_buffer, errors_to, orcpt, dsn_flags);
-+    #endif  /* COMPILE_UTILITY */
-+  #endif
-+  #ifndef SUPPORT_DSN
-+    #ifndef COMPILE_UTILITY
-+      DEBUG(D_deliver) debug_printf("**** SPOOL_IN - address: |%s| errorsto: 
|%s|\n",
-+      big_buffer, errors_to);
-+    #endif  /* COMPILE_UTILITY */
-+  #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 SUPPORT_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 -Naur exim-4.82_RC5.orig/src/spool_out.c exim-4.82_RC5/src/spool_out.c
---- exim-4.82_RC5.orig/src/spool_out.c 2013-10-27 21:46:25.000000000 +0100
-+++ exim-4.82_RC5/src/spool_out.c      2013-10-27 21:47:32.000000000 +0100
-@@ -234,6 +234,15 @@
- if (tls_in.sni != NULL)                fprintf(f, "-tls_sni %s\n",    
string_printing(tls_in.sni));
- #endif
- 
-+#ifdef SUPPORT_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
- checking has been done. If a recipient is a "one-time" alias, it is followed 
by
-@@ -244,14 +253,36 @@
- for (i = 0; i < recipients_count; i++)
-   {
-   recipient_item *r = recipients_list + i;
--  if (r->pno < 0 && r->errors_to == NULL)
-+#ifdef SUPPORT_DSN
-+DEBUG(D_deliver) debug_printf("DSN: Flags :%d\n", r->dsn_flags);
-+#endif
-+  if (r->pno < 0 && r->errors_to == NULL
-+    #ifdef SUPPORT_DSN
-+     && r->dsn_flags == 0
-+    #endif
-+    )
-     fprintf(f, "%s\n", r->address);
-   else
-     {
-     uschar *errors_to = (r->errors_to == NULL)? US"" : r->errors_to;
-+    #ifdef SUPPORT_DSN
-+    uschar *orcpt = (r->orcpt == NULL)? US"" : r->orcpt;
-+    fprintf(f, "%s %s %s %d,%d,%d,%d!1\n", r->address, errors_to, orcpt, 
-+      Ustrlen(errors_to), Ustrlen(orcpt), r->pno, r->dsn_flags);
-+    #else
-     fprintf(f, "%s %s %d,%d#1\n", r->address, errors_to,
-       Ustrlen(errors_to), r->pno);
-+    #endif
-     }
-+    
-+    #ifdef SUPPORT_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
-+    #ifndef SUPPORT_DSN
-+      DEBUG(D_deliver) debug_printf("**** SPOOL_OUT - address: |%s| errorsto: 
|%s|\n",
-+         r->address, r->errors_to);
-+    #endif
-   }
- 
- /* Put a blank line before the headers */
-diff -Naur exim-4.82_RC5.orig/src/structs.h exim-4.82_RC5/src/structs.h
---- exim-4.82_RC5.orig/src/structs.h   2013-10-27 21:46:25.000000000 +0100
-+++ exim-4.82_RC5/src/structs.h        2013-10-27 21:47:32.000000000 +0100
-@@ -282,7 +282,9 @@
-   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 SUPPORT_DSN
-+  BOOL    dsn_process;            /* If TRUE, activate DSN for this router */
-+#endif
-   int     self_code;              /* Encoded version of "self" */
-   uid_t   uid;                    /* Fixed uid value */
-   gid_t   gid;                    /* Fixed gid value */
-@@ -547,6 +549,12 @@
-   uschar *auth_id;              /* auth "login" name used by transport */
-   uschar *auth_sndr;            /* AUTH arg to SMTP MAIL, used by transport */
- 
-+  #ifdef SUPPORT_DSN
-+  uschar *dsn_orcpt;              /* DSN orcpt value */
-+  int  dsn_flags;                 /* DSN flags */
-+  uschar *dsn_aware;              /* DSN aware flag */
-+  #endif
-+
-   uid_t   uid;                    /* uid for transporting */
-   gid_t   gid;                    /* gid for transporting */
- 
-diff -Naur exim-4.82_RC5.orig/src/transport.c exim-4.82_RC5/src/transport.c
---- exim-4.82_RC5.orig/src/transport.c 2013-10-27 21:46:25.000000000 +0100
-+++ exim-4.82_RC5/src/transport.c      2013-10-27 21:47:32.000000000 +0100
-@@ -1802,6 +1802,11 @@
- 
-   argv = child_exec_exim(CEE_RETURN_ARGV, TRUE, &i, FALSE, 0);
- 
-+  #ifdef SUPPORT_DSN
-+  /* Call with the dsn flag */
-+  if (smtp_use_dsn) argv[i++] = US"-MCD";
-+  #endif
-+
-   if (smtp_authenticated) argv[i++] = US"-MCA";
- 
-   #ifdef SUPPORT_TLS
-diff -Naur exim-4.82_RC5.orig/src/transports/smtp.c 
exim-4.82_RC5/src/transports/smtp.c
---- exim-4.82_RC5.orig/src/transports/smtp.c   2013-10-27 21:46:25.000000000 
+0100
-+++ exim-4.82_RC5/src/transports/smtp.c        2013-10-27 21:47:32.000000000 
+0100
-@@ -242,6 +242,16 @@
- #endif
- };
- 
-+#ifdef SUPPORT_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[] = { "NEVER", "SUCCESS", "FAILURE", "DELAY" };
-+#endif
-+
-+
- 
- /* Local statics */
- 
-@@ -1079,6 +1089,27 @@
-   else if (new[0] != 0) local_authenticated_sender = new;
-   }
- 
-+#ifdef SUPPORT_DSN
-+/* Add any DSN flags to the mail command */
-+
-+if (smtp_use_dsn)
-+  {
-+  uschar *p = buffer;
-+  if (dsn_ret == dsn_ret_hdrs)
-+    {
-+    strcpy(p, " RET=HDRS");
-+    while (*p) p++;
-+    }
-+  else if (dsn_ret == dsn_ret_full)
-+    {
-+    strcpy(p, " RET=FULL");
-+    while (*p) p++;
-+    }
-+  if (dsn_envid != NULL)
-+    string_format(p, sizeof(buffer) - (p-buffer), " ENVID=%s", dsn_envid);
-+  }
-+#endif
-+
- /* Add the authenticated sender address if present */
- 
- if ((smtp_authenticated || ob->authenticated_sender_force) &&
-@@ -1587,6 +1618,14 @@
-     {DEBUG(D_transport) debug_printf("PRDR usable\n");}
- #endif
- 
-+  #ifdef SUPPORT_DSN
-+  /* Note if the server supports DSN */
-+  smtp_use_dsn = 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
-   the business. The host name and address must be available when the
-@@ -1746,18 +1785,66 @@
-   int count;
-   BOOL no_flush;
- 
-+  #ifdef SUPPORT_DSN
-+  /* philb - set dsn_aware flag for this recipient */
-+  if(smtp_use_dsn)
-+     addr->dsn_aware = string_copy("Y");
-+  else
-+     addr->dsn_aware = string_copy("N");
-+  #endif
-+
-   if (addr->transport_return != PENDING_DEFER) continue;
- 
-   address_count++;
-   no_flush = smtp_use_pipelining && (!mua_wrapper || addr->next != NULL);
- 
-+   #ifdef SUPPORT_DSN
-+   /* Add any DSN flags to the rcpt command and add to the sent string */
-+
-+   p = buffer;
-+   *p = 0;
-+
-+   if (smtp_use_dsn)
-+     {
-+     if ((addr->dsn_flags & rf_dsnflags) != 0)
-+       {
-+       int i;
-+       BOOL first = TRUE;
-+       strcpy(p, " NOTIFY=");
-+       while (*p) p++;
-+       for (i = 0; i < 4; i++)
-+         {
-+         if ((addr->dsn_flags & rf_list[i]) != 0)
-+           {
-+           if (!first) *p++ = ',';
-+           first = FALSE;
-+           strcpy(p, rf_names[i]);
-+           while (*p) p++;
-+           }
-+         }
-+       }
-+
-+     if (addr->dsn_orcpt != NULL)
-+       string_format(p, sizeof(buffer) - (p-buffer), " ORCPT=%s",
-+         addr->dsn_orcpt);
-+     }
-+
-+   #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 SUPPORT_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)
-     {

Reply via email to