procmail
[Top] [All Lists]

Re: Re^2: Put From/Subject into BODY

1997-03-20 08:18:51
[snip]

I tried your script 
but it seems to fail at the first two lines.
What does it mean and how should I correct?

-xTo:: Cannot open
-zx: Bad option(s)
procmail: Error while writing to ""
procmail: Skipped..........
...........................

By the way, is FROM=`$FORMAIL -rt -xTo:` correct?

First of all, are you using `procmail` v3.11pre4 with the `formail` that
is included in there?  If not, you should upgrade -- definitely.

Unless I made a screwup, what this recipe should do is act on any incoming
email that contains 'important' or 'urgent' in the 'To:' header OR 
'important.com' or 'urgent.com' in the 'From:' header.  What is should do
create a properly formatted email to 
'0399999999(_at_)009(_dot_)docomonet(_dot_)or(_dot_)jp' that
is from the original sender with a subject of 'forwarding to pager' while
preserving the old 'From:', 'To:' and 'Subject:" by prefixing them with
an 'Old-'.  It should then put in the body the output of "From: $FROM" and
"Subject: $SUBJECT" while dropping the original body.  Sendmail should
then send this email off on its way.  A carbon copy of this email is also
generated so the original email continues on to be processed by any
further recipes.  If I made another goof, please feel free to correct me
anyone -- I'm just a rookie at this :^):

        # Define these variables for your particular system.
        FORMAIL=
        SENDMAIL=

        # Also make sure that the path to SHELL is set and that the
          command `echo` is in your current path.

        FROM=`$FORMAIL -rt -xTo:`
        SUBJECT=`$FORMAIL -zx 'Subject: '`

        :0 hc:
        * (^To:.*(important|urgent)|^From:.*(important.com|urgent.com))
        (| $FORMAIL -i"From: furu(_at_)009(_dot_)com" -i"Subject: forwarding to 
pager" \        
         -i"To: 0399999999(_at_)docomonet(_dot_)or(_dot_)jp"; echo "From: 
$FROM"; \ 
         echo "Subject: $SUBJECT") | $SENDMAIL -oi -t

Lates!
---------------------------------------------------------------------------
Tim <bodysurf(_at_)pobox(_dot_)com>                          
mailto:bodysurf(_at_)pobox(_dot_)com
Finger bodysurf(_at_)pobox(_dot_)com for my PGP public key (Bits 1024/KeyID 
09DA5C49).
PGP Key FPrint (09/03/94): 4C 97 F1 FA 70 55 68 91  49 D1 AD F2 DD 63 0C 15
---------------------> Please PGP encrypt your email <---------------------

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