Closed tdewolff closed 8 months ago
This is actually a bug in Postfix. You can circumvent the problem by issuing two modifications, first an insert at index=0, and then a chgheader at index=1 with empty value to delete the original. See https://www.mail-archive.com/postfix-users@postfix.org/msg101517.html
It seems undocumented that the ChangeHeader index starts at 1 and not zero. When sending a mail such as:
To
using:ChangeHeader(1, "To", "value")
From
using:ChangeHeader(2, "From", "value")
From
using:ChangeHeader(1, "From", "value")
. Instead of changing it, it adds a new header field to the end of the headerThis is regardless of whichever header field comes first, I simply can't change it. Might this be an issue with Postfix?