[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Exim4: automatically GPG-encrypting messages to specific recipients



On Sunday 06 April 2014 19:55:34 Brian wrote:
> On Sun 06 Apr 2014 at 18:18:18 +0200, Michael Schuerig wrote:
> > On Sunday 06 April 2014 15:23:23 Curt wrote:
> > > On 2014-04-06, Michael Schuerig <michael.lists@schuerig.de> wrote:
> > > > I don't intend to use it for personal mail. I want this for
> > > > system-
> > > > generated messages that are send to root. Those messages are
> > > > already
> > > > forwarded (/etc/aliases) to another user; in addition I'd like
> > > > to
> > > > send them to an (presumably) insecure email account hosted at a
> > > > mail provider.
> > > > 
> > > > Michael
> > > 
> > > What about this (involves a simple Procmail ditty):
> > > 
> > > http://www.marcus-povey.co.uk/2013/10/31/automatically-encrypt-sys
> > > tem-> emails/> 
> > Thanks! That works very nicely.
> > 
> > I always thought procmail wasn't for me as I only use desktop MUAs.
> > Apparently I was mistaken.
> 
> How does procmail get called on all your *outgoing* mail?

It isn't and it doesn't need to. It is called for *incoming* mail. 
Remember, I'm interested in messages send to root by system processes 
such as cron. By way of /etc/aliases these messages are forwarded (root: 
michael). /home/michael/.procmailrc contains

SUBJECT=`formail -xSubject:`
FROM=`formail -xFrom:`
:0 c
*^To:.*root@.*
|formail -I "" | gpg --trust-model always -ear "pubkey@domain" | mail -r 
"$FROM" -s "$SUBJECT" recipient@domain

In effect, messages to root on that system are encrypted with the public 
key belonging to pubkey@domain and re-send to recipient@domain.

The integration of procmail with exim4 works out of the box. There was 
no need for any explicit configuration to ensure it is called.

Michael

-- 
Michael Schuerig
mailto:michael@schuerig.de
http://www.schuerig.de/michael/


Reply to: