procmail
[Top] [All Lists]

Re: Adding to a field?

1996-08-01 13:39:37

On Thu, 1 Aug 1996, Doug Hughes wrote:



   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


      Yeah that's partially what I want, but I didn't give enough
detail. :) I want it to somehow extract or create (if needed) the variable
Reply-To: in the original message and add in the hard coded one (e.g.
"mary").  So it's more like:
      :0
      * ^TOmessagepool
      {
              :0
              extract/create (if needed) the Reply-To: and add in the 
                      "mary" or "archive" 
      }


How about this:
:0 H
* ^TOmessagepool
{
        REP=`formail -x Reply-To:`
        :0 a
        |$FORMAIL -rt -I "Reply-To: mary(_at_)somewherelse(_dot_)com, $REP" | 
$SENDMAIL -oi -t
}

This may generate an occassionally lonely trailing comma, but it shouldn't
matter (in the case where there is no previously existing Reply-To

____________________________________________________________________________
Doug Hughes                                     Engineering Network Services
System/Net Admin                                Auburn University
                        doug(_at_)eng(_dot_)auburn(_dot_)edu


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