I'm new to procmail, and I have a somewhat complicated recipe to set
up. Unfortunately, I don't have easy access to the procmailrc file to
just try things out, and it's for a fairly important situation where
we *really* don't want to lose any incoming mail. I guess I'm just
paranoid, but I'd like to have someone who's actually ever written a
recipe before check this one before I install it. The man pages are
great, but they can only do so much...
I'd greatly appreciate it if someone could look over my proposed
recipe and see if it does what I hope it does, and especially if I
have :c flags everywhere I need them.
Here's a pseudo-code desccription of what I think it's doing.
If the message is to "submit", not a loop, and not also sent to "queue",
pass it to the file_message script
also pass it to the save-faq program
if save-faq exited with nonzero status
send the reply save-faq generated (in stdout)
exit this recipe, but continue on to later recipes
send the reply save-faq generated
send the incoming mail to "queue"
continue on to later recipes
Now here's the mess of a recipe:
# pass message to file_message script
|/usr/local/file_message # I know this script iself works
# also pass it to save-faq script, and store output (stdout) in CHECK
if !$? ; then # check sh status var from save-faq
# send a reply which contains output from save-faq
(formail -rt -A [various handy headers] ; echo $CHECK ) \
| $SENDMAIL -t
#exit this script (jump down to the final } ), but not procmail
# otherwise, save-faq was successful; again, send a reply with
# its output -- this is repeated so !$? refers to the save-faq
# command and not the formail
(formail -rt -A [same handy headers] ; echo $CHECK ) \
| $SENDMAIL -t
# if save-faq was successful, also pass this message to "queue"
| (formail -t -i To queue) | sendmail -t # send it to queue
# other recipes follow, including one which handles things sent to
# "queue" (like "submit", an alias to the account this procmailrc is for)
My thanks to anyone who takes the time to look this over!
- Pam Greene
Ferret Central <http://www.optics.rochester.edu:8080/users/pgreene/>
or ftp to ftp.optics.rochester.edu and look in pgreene/
or send INDEX FERRET in email to