As explained well in [1], reply-to munging has one important problem that is not addressed by [2] yet. I quote the relevant section here: It may be impossible to reply to the author of a message once the Reply-To header is munged. The Reply-To header was not invented on a whim. It is there for the sender of a mail message to use. If you stomp on this header, you can lose important information. There are good reasons why the sender might insert a Reply-To header. The sender might not be the original author of the message (the name that appears in the From header). If responses should return to the sender and not the original author, then the sender will insert a Reply-To header. Or, maybe the sender added a Reply-To because he or she cannot receive email at the account from which the message was sent. There are many good reasons to place a Reply-To header into a mailing list message. If the Reply-To is munged by the mailing list, the value provided by the original sender is lost. Reply-To munging can make it impossible to reach the sender of a message. The solution, as I see it, is to have the munging lists copy the original reply-to address to something like 'X-Original-Reply-To' first before munging. This way the original reply-to could actually be restored by the following procmail rule: # This restores the original Reply-To: header :0 fhw * ^List-Id:.*gentoo.org. | formail -R "X-Original-Reply-To:" "Reply-To:" This would put the issue to bed once and for all. I hope. Implementing this may just be as simple as piping all messages through the opposite formail cmdline to move 'Reply-To' to 'X-Original-Reply-To' before the mailing list software sees it, though perhaps the mailing list software could do this itself too. References: [1] http://www.unicom.com/pw/reply-to-harmful.html [2] http://dev.gentoo.org/~wolf31o2/xml/reply-to.xml
formail question. WITHOUT having to invoke procmail, I'd like to duplicate the original Reply-To header to Old-Reply-To. Not rename, but duplicate. I can't see any way to do this with formail directly. I specifically don't want to invoke procmail, as I want to put the command into the aliases as: |formail ... |/usr/bin/mlmmj....
I don't know of a way to do that with formail, but it could be done with this sed script: sed -e '0,/^$/ { /^Reply-To:/ { p; s//Old-&/ } }' The only potential problem here, I think, is if the original Reply-To header is multiline.
yeah, flunks on multiline, and I do see some multiline cases of it.
Reply-To munging by mailing lists violates rfc2822 [1], so I don't think we should be munging at all. The RFC makes it clear that this field is to be used by the author of the message. [1] http://www.ietf.org/rfc/rfc2822.txt