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 <receivert...@test.com>; Fri, 18 Oct 2024 14:07:37 -0400 (EDT)
> Subject: test
> Message-ID: <20241018180745.58546c02...@appsjava.test.com>
> Date: Fri, 18 Oct 2024 14:07:37 -0400
> From: <originalsen...@test.com>    <-needs to stay like this
> To: Undisclosed recipients:;
> Return-Path: originalsen...@test.com
>       ^^^this should be "nore...@test.com"
> 
> 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 -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to