[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

OT: procmail recipe/bash scripting issue



hey everyone,

trying to get procmail to pipe messages to a script I wrote that
processes mail to a web page.  Here's the recipe: 
-------------------------------------------
:0:  
*  ? $FORMAIL -x From: | grep -isF -f /home/movies/friends_and_family.txt 
| /usr/local/scripts/moviepage 
 -------------------------------------
If I run the script from the command line iwth a message as input
file, I get this:

$ moviepage movietest/cur/1075094038.31194_26.anarres\:2\,S 

<h2> Millenium Actress</h2>
<h3></h3>
<p>
Brilliant piece of Japanese animation, highly recommended to all.
Very interesting use of comic-book tropes to do stuff that would be
very hard to do with live action.  And none of the stupid blood&gore
that characterizes most anime.  </p>

however, when I use the procmail recipe, I get this (same message): 
<h2></h2>
<h3></h3>
<p></p>


So I asusme the script is running, but it's not receiving the data it
needs, or at least not understanding it.  

Here's the script, which as ou see is very primitive:  
----------------------------------
 cat /usr/local/scripts/moviepage 
#!/bin/bash

TITLE=`formail -x"Subject:" < "$@"` ;
HEADER="<h2>$TITLE</h2>";
FROM=`formail -x"From:" < "$@"` ;
BYLINE="<h3>$FROM</h3>";
BODY=`formail -I "" < "$@"`;
TEXT="<p>$BODY</p>";
echo "$HEADER" >> /www/derailleur.org/movies.html;
echo "$BYLINE" >> /www/derailleur.org/movies.html;
echo "$TEXT" >> /www/derailleur.org/movies.html;
-----------------------------------

soooo... am I using the $@ wrong somehow?  should I substitute
somethng else?  

Thanks for your help!

matt



Reply to: