I am running a mail server with Postfix, and I have set this line in /etc/postfix/header_checks.pcre:
/^To: board@example.org/ PREPEND Reply-To: board@example.org
Board@Example.org is a forwarding address. If someone sends an email to Board@Example.org, it'll forward to a number of other addresses. However, I want the Reply-To line to be Board@Example.org, so all replies go to everyone.
My line works, but the problem is that it's adding the 'Reply-To' header twice. I suspect the mail server is receiving the message, prepending the line, then sending out emails to each of the recipients, adding the line again. I have tried this:
if /^To: board@example.org/
!/^Reply-To: board@example.org/ PREPEND Reply-To: board@example.org
endif
The logic here is 'if this is going to board@example.org, and the Reply-To header is not board@example.org, then prepend the Reply-To header. The problem is, this still doesn't work. It adds the Reply-To header twice.
My understanding is that postfix header_checks can't determine whether a header is present or not, only what the content of it is. I am at a loss as to how to get this header going in only once.