I've used procmail before but I don't use it often so I'm still what
you'd call a procmail newbie.
I've configured my postfix mail aliases to forward all mail to root to
my user account. The idea here is to then forward all that mail to my
(Windows, Outlook) workstation account where I can then read it and
respond. Thing is, this mail may contain sensitive information so it
must be encrypted in transit. We use Entrust Entelligence to send
encrypted mail so I exported my key, converted it to a cert and now I'm
using that to encrypt the mail. Still, the sendmail program (from
postfix) is giving me lots of grief. No other mail program I've found
works at all for this purpose but sendmail delivers the message but
looses the subject and the recipients list.
As I've said I'm no procmail expert so I leave it up to you. If you can
please help me improve this procmail recipe, I would greatly appreciate it.
Thanks,
-Mark
-------
SHELL=/bin/sh
MAILDIR=${HOME}/Mail
LOGFILE=${MAILDIR}/procmail.log
LOG="--- Logging ${LOGFILE} for ${LOGNAME}, "
HOSTNAME=`hostname --fqdn`
ME=`whoami`
OPENSSL="/usr/bin/openssl smime -encrypt"
SENDMAIL=/usr/sbin/sendmail
REMOTE=myremoteemail(_at_)somedomain(_dot_)com
KEYID=938c8fbe.1
SMIMEDIR=${HOME}/.smime/certs
INPUT="-in /dev/stdin"
FROMADDR_=`formail -rt -xTo: \
| expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`
# Forward all system mail to users workstation, but encrypt with openssl
first.
:0:
* $ ? echo ${FROMADDR_} | egrep -is ${HOSTNAME}
* ! ^X-Loop: ${ME}(_at_){HOSTNAME}
{
:0fwh
| formail -A"X-Loop: ${ME}(_at_)${HOSTNAME}"
:0
| ${OPENSSL} ${INPUT} ${SMIMEDIR}/${KEYID} | ${SENDMAIL} ${REMOTE}
}
# Accept all the rest default mailbox
:0:
${DEFAULT}
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail