Quoting Tim Messer (ressem(_at_)imsa(_dot_)edu):
I'm interested in running an autoresponder/archive server using procmail.
The procmail man pages weren't much of a help, and neither were some of
the FAQs I found.
Someone already posted a recipie that will work if only want to
allow access to specific files. If you want people to be able
to allow people to access any arbitrary file from a particular
directory use this recipie (from the procmailex man page...)
Now follows an example for a very simple fileserver acces-
sible by mail. For more demanding applications, I suggest
you take a look at SmartList (available from the same
place as the procmail distribution). As listed, this
fileserver sends back at most one file per request, it
ignores the body of incoming mails, the Subject: line has
to look like "Subject: send file the_file_you_want" (the
blanks are significant), it does not return files that
have names starting with a dot, nor does it allow files to
be retrieved that are outside the fileserver directory
tree (if you decide to munge this example, make sure you
do not inadvertently loosen this last restriction).
:0
* ^Subject: send file [0-9a-z]
* !^X-Loop: yourname(_at_)your(_dot_)main(_dot_)mail(_dot_)address
* !^Subject:.*Re:
* !^FROM_DAEMON
* !^Subject: send file .*[/.]\.
{
MAILDIR=$HOME/fileserver # chdir to the fileserver directory
:0 fhw # reverse mailheader and extract name
* ^Subject: send file \/[^ ]*
| formail -rA "X-Loop:
yourname(_at_)your(_dot_)main(_dot_)mail(_dot_)address"
FILE="$MATCH" # the requested filename
:0 ah
| cat - ./$FILE 2>&1 | $SENDMAIL -oi -t
}
--
Michael Stone, Sysadmin, ITRI PGP: key 1024/76556F95 from mit keyserver,
mstone(_at_)itri(_dot_)loyola(_dot_)edu finger, or email with
"Subject: get pgp key"