On Wed, Jan 27, 2021 at 06:12:35PM +0100, Andy Smith wrote:

> I need to rewrite an address (known/fixed, is the localaddress of the
> user sending the email)

I am having trouble parsing this.  Email messages have:

    - An envelope-sender, specified via the SMTP "MAIL FROM:" command
      prior to and separately from the message headers and content.
      For local submission via sendmail(1) this is specified via the
      '-f <sender>' option.

    - The originator fields described in 

        https://tools.ietf.org/html/rfc5322#section-3.6.2

    - And for resent messages:

        https://tools.ietf.org/html/rfc5322#section-3.6.6

Can you more precise in your description, perhaps with a hypothetical
example specifying precisely the form of the input message envelope
and headers and the desired output values of the same.

> to be the same as the existing "Reply-To" address from the message.

Messages are not required to have "Reply-To", are you looking to modify
other message headers conditional on "Reply-To" being present?

> Ie in Exim I can use the variable "$reply_address". If anyone knows
> how I can achieve this that would be really helpful! 

    
http://www.exim.org/exim-html-current/doc/html/spec_html/ch-string_expansions.html#SECTexpvar

    $reply_address

        When a message is being processed, this variable contains
        the contents of the Reply-To: header line if one exists and
        it is not empty, or otherwise the contents of the From:
        header line. Apart from the removal of leading white space,
        the value is not processed in any way.  In particular, no
        RFC 2047 decoding or character code translation takes place.

There is no equivalent feature built-in to Postfix.  If you want to
modify a message based on the value of the "Reply-To:" or else "From:"
address of a message, you'd need a content_filter or milter.

Postfix header rewriting happens one address at a time, with the
original value of the particular address as the sole input from
the message in question, this is then used to look up replacements
in any configured tables.

-- 
    Viktor.

Reply via email to