Avoid generating duplicate headers in ezmlm-send
When processing a message's headers:
- Make note if Reply-To was seen.
- Save off and do not copy the Cc header to the output immediately.
- Save off and do not copy the From header to the output immediately.
At the end of the message headers, call rewrite_from().
When flagrewritefrom is set, either by the list's configuration or
because a DMARC reject policy applies to the message sender's address:
- The From header is rewritten as before.
- If replytolist is not enabled, a Reply-To header is only added
if the original message did not have one. Rationale is that the
original Reply-To header indicated where the post author is
interested in receiving responses, not the From header.
- When replytolist is enabled and the original message had a Cc header,
the From address is appended to the existing Cc header.
- When replytolist is enabled and the original message did not have a
Cc header, generate a new one using the From address.
After rewrite_from() performs any of the applicable manipulations
described above, the resulting From and Cc headers are copied to the
output.
Update tests/551-ezmlm-send-rewritefrom:
- Confirm Reply-To and Cc headers are not duplicated.
- Validate behavior when replytolist is configured.
4 files changed