procmail
[Top] [All Lists]

Re: Adding to a field?

1996-08-01 18:43:59
Doug Hughes <Doug(_dot_)Hughes(_at_)Eng(_dot_)Auburn(_dot_)EDU> writes:
Jeff Gustafson <jeffgus(_at_)packardbell(_dot_)com> writes:
     What the best way to add to a field with procmail, formail?  I 
want procmail to send some messages to formail so it can add an 
additional address to the Reply-To field. E.g.:

     Orig:
     Reply-To: john(_at_)somewhere(_dot_)com

     New:
     Reply-To: john(_at_)somewhere(_dot_)com, 
mary(_at_)somewherelse(_dot_)com

     Is there a smooth way to do this?

How about this one?

:0 H
* ^Reply-To: john(_at_)somewhere(_dot_)com
|$FORMAIL -rt -I "Reply-To: john(_at_)somewhere(_dot_)com, 
mary(_at_)somewherelse(_dot_)com" | $SENDMAIL -oi -t


Hmm, since Jeff didn't mention that this is on outgoing mail, I'll show
it as a filter.  BTW, the 'H' flag is superfluous in your answer.


# The []'s below contain a carat, a space, and a tab.
:0 fh
* ^Reply-To: *\/[^      ]+
|formail -I "Reply-To: $MATCH, mary(_at_)somewherelse(_dot_)com"


Note that if there is no Reply-To: header, this doesn't do anything.
It's not too difficult to handle that case as well, but first you have
to figure out what the Right Thing would be: create a Reply-To: header
with just mary(_at_)somewherelse(_dot_)com?  Or should it create a Reply-To:
header with both mary(_at_)somewherelse(_dot_)com and the sender's address?

Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>