I am using Sieve filter to redirect incoming emails to my gmail account. In some cases I am seeing messages bounced from gmail with a duplicate header error. Investigating further it looks like there is a duplicate Message-ID header being added by Sieve when it believes that the original Message-ID header is invalid/malformed.
In some cases this is reasonable, e.g. the message ID value does not contain the “@” character. However in some cases the original message ID value does not include the “<” and “>” around the value but is otherwise OK. From what I have been reading it looks like the relevant RFC says that the “<” and “>” are not actually part of the message ID itself, so this seems like a bug with Sieve in this case.
Is there any way to suppress this behaviour in Sieve and ignore malformed message ID headers in the redirected messages?