procmail
[Top] [All Lists]

ok, how do I get this to work (recipe needed)

1996-06-03 14:12:17
Ok, procmail is still having fits and refuses to save out a mail message
under the name filename I specify (I want each message to have a unique
name).  So, I have an idea, but don't know how to get it to work after
several tries.  Here is the deal, I can get procmail to save out the
message as an MH mail foder in a directory I specify.  The recipe is simple
and looks like this:

:0
* ^To:.*some account*
testmail/.

This will save each message in the testmail directory under a unique number.
Now, I noticed that it assigns the path and unique number to the LASTFOLDER
variable.  Now, I have a script which I want to execute upon the message
and do various things with it depending upon what is in the body of the
message.  It's recipe looks something like this:

:0
FROM=`formail -rx To:`
|/some/path/to/script/script.pl $FROM $LASTFOLDER

Here, I just extract who sent the mail and pass that, along with the contents
of LASTFOLDER, to the script.  So, my question is this: how do I set this up
such that if someone sends mail to *some account*, the message will
get written out and then the FROM variable will be assigned, plus, the script
will be ran with the given arguments?  I tried using {...} to do nesting,
but I must have done it wrong because it would always skip the 'testmail/.'
part (all of the above was in the braces except the first :0 and *some account*
part.  

Thanks in advance for any suggestions,
Larry
-- 
------------------------------------------------------------------------------
|Larry Glaze                            |       "...Life's a bummer..."      |
|System Administrator                   |               --Smashing Pumpkins  |
|The Ohio State University              |                                    |
|http://rclsgi.eng.ohio-state.edu/~glaze|   
glaze(_at_)rclsgi(_dot_)eng(_dot_)ohio-state(_dot_)edu  |
------------------------------------------------------------------------------
|                All opinions are my own, as they should be.                 |
------------------------------------------------------------------------------

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