On Fri, Aug 09, 2024 at 10:01:11AM +0300, Eero Volotinen wrote:

> Lets say that this looks complex.
> 
> This works: smtp_generic_maps = hash:/etc/postfix/generic to rewrite smtp
> from:
> 
> and file contains:
> /.*/

A "hash" table is not do regular-expression matching.  Perhaps you want
one of:

    - smtp_generic_maps = static:j...@example.com
    - smtp_generic_maps = pcre:${config_directory}/generic.pcre

        generic.pcre:
            /^/     j...@example.com

even regardless of the original domain?  Though that seems much too
crude to me.  Note, however, that smtp_generic_maps will also rewrite
the "To:" and "cc:" heades and the envelope recipient address.

Do rewrite just the envelope sender and "From:" header, you'd want
sender_canonical_maps, which is semantically flawed, because when
replying to "all" the "From:", "To:" and "cc:" addresses are
functionally equivalent, and should generally be rewritten consistently,
but perhaps your use-case makes that defect tolerable.

> Yes, all from to same author regardless of original input. no need to
> touch to or cc headers.

My sense is that you're probably going about solving the wrong problem,
and that perhaps describing why you think you think you need to do this
would get you a more useful answer.

-- 
    Viktor.
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to