B. J. (or is it Randy?) Banks asked,
| Excuse my ignorance, but I've RTFM'd (and a RFM it is too ...) but
| cannot discover how to get formail to generate a complete set of
| return addresses when there are 2+ addresses in the REPLY-TO field.
Stephen explained why formail selects a single address in such situations
(even when the reply address are separated with commas).
If one is running formail inside a procmail rcfile, one can extract the full
contents of the incoming Reply-To: or Resent-Reply-To: header with the $MATCH
facility (although it will be fooled, harmlessly, when a formal name is
included in the Reply-To: header, thus marking a space that doesn't separate
two addresses). The first set of brackets in each expression enclose a
caret, a space, and a tab; the second set enclose a space and a comma:
:0hwf
* !^Resent-Reply-To:.*\/[^ ].*[ ,]
* !^Reply-To:.*\/[^ ].*[ ,]
| formail -r
:0Ehwf
| formail -r -I"To: $MATCH"
If you don't want to honor Resent-Reply-To: headers, it can be simplified:
:0hwf
* ^Reply-To:.*\/[^ ].*[ ,]
| formail -r -I"To: $MATCH"
:0Ehwf
| formail -r