procmail and gpg

Chris Frey cdfrey at
Thu May 14 05:48:07 CEST 2009

On Wed, May 13, 2009 at 01:39:06AM -0400, Stormer's Cgi-Archive wrote:
> I asked this one before...  either no response or no one knows.
> Has anyone got a procmail recipe that works so that any email sent to
> a particular pop3 account will be encrypted with a public key?
> maybe I am on the wrong list?  Recommendations?

You need to make use of the idea of procmail filter rules.

For example, I use a rule like this to adjust the Subject line of
mail from the full-disclosure mailing list:

####### full-disclosure
* ^List-Id:.*
        # filter delivered mail's subject line for better mutt sorting
        | sed -e '/^Subject: / s/\[Full-disclosure\] //'

        # send to proper mailbox

The above was copied from a working setup.  You'll need to do some testing
and playing around, but extrapolating from my above rule, I'd likely
try something like this:

# send body of email through a gpg filter, and make sure it succeeds
| gpg --armor -r cdfrey at --encrypt

Hope that helps,
- Chris

More information about the Gnupg-users mailing list