<<< Date Index >>>     <<< Thread Index >>>

Re: s/mime from the command line



Stephan Seitz wrote:
On Wed, Nov 16, 2005 at 12:48:12PM -0600, Mark F wrote:

My ultimate goal here is to configure my server to use mutt to forward all system mail to me at my workstation encrypted with my Entrust key.


I don't think, it will work. I didn't have success with GPG encryption and command line. As I was told here in the list, the command line code doesn't allow encryption.

So in my case, I had to encrypt the message file and send this.

Shade and sweet water!

    Stephan

I ended up going with the postfix-sendmail binary instead of mutt. This isn't a perfect solution but it seems to work ok:

.procmailrc
------------------------
SHELL=/bin/sh
LOGFILE=${HOME}/procmail.log
LOG="--- Logging ${LOGFILE} for ${LOGNAME}, "
HOSTNAME=`hostname --fqdn`
ME=$LOGNAME
OPENSSL="/usr/bin/openssl smime -encrypt"
REMOTE=my remote email address
KEYID=generated key from smime_keys
SMIMEDIR=${HOME}/.smime/certs
INPUT="-in /dev/stdin"
FROMADDR_=`formail -zrt -xTo:`

# Forward all system mail to users workstation, but encrypt with openssl first.
:0:
* $ ? echo ${FROMADDR_} | egrep -is ${HOSTNAME}
* ! ^X-Loop: ${ME}@{HOSTNAME}
{
  :0fwh
  | formail -A"X-Loop: ${ME}@${HOSTNAME}"
  :0
  | ${OPENSSL} ${INPUT} ${SMIMEDIR}/${KEYID} | ${SENDMAIL} ${REMOTE}

}

# Accept all the rest default mailbox
:0:
${DEFAULT}

Hope this helps someone...

-Mark