> On 19 Apr 2022, at 10:22 am, Wietse Venema <wie...@porcupine.org> wrote:
> 
> If you must do this, why not copy the entire From: value?
> 
>    /^From:(.+@example\.com\b.+) Reply-To:$1
> 
> Note: the \b matches a word boundary, and the \. matches . instead
> of every character.

Since '\b' will also match before a ".", this could have false positives
for e.g. "example.com.au" or similar.  Therefore, closer would be:

        /^From:(.+@example\.com(?:[^-.a-z0-9]|$).*)/   PREPEND Reply-To:$1

However, even this could be wrong in unusual cases:

        From: "exotic displayn...@example.com" <u...@example.net>

A milter with a robust address parser would make a more correct approach.
It might also correctly handle any existing "Reply-To", ...

-- 
        Viktor.

Reply via email to