| Does someone have an example of how to use procmail and pgp
| together - i.e. to take certain incoming ascii e-mail messages
| and encrypt the body with my own key, before putting them
| in a particular folder? (So that they are never saved in a folder
| in non-encrypted form).
These don't do quite that, they do auto-grab keys, and could
easily be hacked into other tasks.
#This first ruleset protets me from mailbombs from an automated service
#that I often send incorrect commands to, generating 5mb of reply.
# It also sorts based on sucsess of the command.
:0
* From bal(_at_)swissnet(_dot_)ai(_dot_)mit(_dot_)edu
{
:0 h
* >10000
/dev/null
:0 h
*^Subject:.*no keys match
/dev/null
:0E
| pgp +batchmode -fka
}
# auto key retreival
#
# I have an elm alias, pgp, points to a keyserver
# The logfile gets unset briefly to keep the elm lines out of my
# logfile.
:0BW
* -----BEGIN PGP
*!^FROM_DAEMON
KEYID=|/usr3/adam/bin/sender_unknown
LOGFILE=
:0 ahc # added h 8 jan 95
* ! ^X-Loop: Adams autokey retreival.
| formail -a"X-Loop: Adams autokey" |elm -s"mget $KEYID" pgp
---------/usr3/adam/bin/sender_unknown:---------
#!/bin/sh
# unknown returns a keyid, exits 1 if the key is known
# $output is to get the exit status. Otherwise, this would be a one liner.
OUTPUT=`pgp -f +VERBOSE=0 +batchmode -o /dev/null`
echo $OUTPUT | egrep -s 'not found in file'
EV=$?
if [ $EV -eq 0 ]; then
echo $OUTPUT | awk '{print $6}'
fi
exit $EV
------------------------------------------------------