Hi Viktor, it worked! I had to replace Reply-To by Return-To, but it works!
Thanks for the help, Have a wonderful Holiday and happy new year To you and everyone at Postfix ___________________________________ Étienne Gladu ________________________________ De : Viktor Dukhovni via Postfix-users <[email protected]> Envoyé : mardi 22 octobre 2024 09:08 À : [email protected] <[email protected]> Objet : [pfx] Re: Is possible with postfix to do port-based routing? On Mon, Oct 21, 2024 at 07:16:20PM +0000, Etienne Gladu via Postfix-users wrote: > Thanks for the config, but it still closes the port when I try to do a test. > Anyway the task changed a bit, we have to keep the original From, but only > change the Return-Path/Reply-to for every email sent. > Also it doesn't have to be specified for each port in master.cf, so maybe > something in main.cf ? > > example: > originalSender sends a email to receiverTest > > Received: from smtpr.test.com(localhost [127.0.0.1]) > by appsjava.test.com(Postfix) with ESMTP id 58546C0202B > for <[email protected]>; Fri, 18 Oct 2024 14:07:37 -0400 (EDT) > Subject: test > Message-ID: <[email protected]> > Date: Fri, 18 Oct 2024 14:07:37 -0400 > From: <[email protected]> <-needs to stay like this > To: Undisclosed recipients:; > Return-Path: [email protected] > ^^^this should be "[email protected]" > > Everything stays the same, but the Reply-To/Return-Path is replaced to be > NoReply@ > > Is this doable ? There is no "Return-Path:" in a message in transit. This header is added by the ultimate local delivery agent during final delivery, and records the envelope sender address at that point in time. The "best" you can do for "Return-Path" is rewrite the envelope sender. As for "Reply-To", you'll probably want a milter or content filter to alter it, or add it if missing. Though perhaps a header_checks file along the lines of: header-checks: /^Reply-To:/ IGNORE /^Message-Id:/ PREPEND Reply-To: ... should work, provided there's reliably already a "Message-Id:" header. You'll also want to set "nested_header_checks" empty or to something else of your choice, as you probably don't want to apply this to attached messages. Perhaps set "mime_header_checks" explicitly also, though these headers don't typically appear in that context. -- Viktor. _______________________________________________ Postfix-users mailing list -- [email protected] To unsubscribe send an email to [email protected]
_______________________________________________ Postfix-users mailing list -- [email protected] To unsubscribe send an email to [email protected]
