I have a header_check that should match when the RECIPIENT address is domain.com and if it matches, then it changes the SENDER address to systems@service.domain.com
Scratching my head a little on this. Here is my header_check:
if /^To:(.*?)domain\.com/
/^From:(.*)/i REPLACE From: Systems <systems@service.domain.com>
endif
And here is an example header that I am testing against:
Date: Sat, 30 Jan 2021 16:25:31 +0000
Subject: Test Email
From: System <systems@domain.com>
To: IT.Devs.CMS@domain.com, IT.Devs.Transfer@domain.com,
IT.Devs.FO@domain.com, it.connectivity@domain.com,
Truncated for readability. The first regex line matches when tested using a regex testing suite. The second line to actually match and replace works fine (i.e. if I use an inverse match then the replace works no problem).
Why on earth is the first line refusing to match? Thanks for any insight.
Postfix 3.1.0