>>>>> "Viktor" == Viktor Dukhovni <postfix-us...@dukhovni.org> writes:

>> On Apr 4, 2017, at 5:26 PM, John Stoffel <j...@stoffel.org> wrote:
>> 
>> But I only want this replamcent to happen for email that comes from a
>> specific set of outside servers.  I think I might have to run my own
>> milter here to do this.   I really can't depend on the headers not
>> being forged somehow, but I can depend on the host which connects to
>> me being who it says.
>> 
>> To a degree.
>> 
>> Am I making sense?

Viktor> Yes.  Another option is to build a custom version of Postfix in which
Viktor> the Delivered-To: header is renamed.  Perhaps this should be 
configurable,
Viktor> and maybe even forgery-protected, but an obscure alternative header 
would
Viktor> suffice, if you're willing to run Postfix binaries built on site.

Since I built 2.11.9 by hand, I'm willing to do this hack as well I
think.  It's a total hack too... and I'm still amazed I'm the only one
seeing this.  But maybe most people who use Office365 for spam
filtering also use Exchange on the inside and not the setup we have
which is due to Lotus Notes, Mailman and Exchange all being valid
internal targets.  Whee...

Looks like I just need to hack src/global/mail_copy.c and
src/global/delivered_hrd.c, or better yet, just change the
global/header_opts.c to maybe be something like this:

diff -ur postfix-2.11.9/src/global/header_opts.c 
postfix-2.11.9.jfs/src/global/header_opts.c
--- postfix-2.11.9/src/global/header_opts.c     2017-04-10 12:50:34.381884494 
-0700
+++ postfix-2.11.9.jfs/src/global/header_opts.c 2008-05-08 13:41:35.000000000 
-0700
@@ -62,7 +62,7 @@
     "Content-Length", HDR_CONTENT_LENGTH, HDR_OPT_DROP,
     "Content-Transfer-Encoding", HDR_CONTENT_TRANSFER_ENCODING, HDR_OPT_MIME,
     "Content-Type", HDR_CONTENT_TYPE, HDR_OPT_MIME,
-    "Delivered-To", HDR_DELIVERED_TO, 0,
+    "My-Delivered-To", HDR_DELIVERED_TO, 0,
     "Disposition-Notification-To", HDR_DISP_NOTIFICATION, HDR_OPT_SENDER,
     "Date", HDR_DATE, 0,
     "Errors-To", HDR_ERRORS_TO, HDR_OPT_SENDER,


Which certainly can't hurt as a test.

John

Reply via email to