[Mimedefang] PGP encyption of outging email

Steffen Kaiser skmimedefang at smail.inf.fh-bonn-rhein-sieg.de
Thu May 7 03:42:31 EDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 6 May 2009, pete wrote:

> Is there a method for encrypting outgoing email using PGP (or other
> methods). I am thinking of doing this on a per recipient basis. I.e encrypt
> email to people I regularly email and leave plain the rest.

If you search CPAN, you find tons of PGP / GnuPG modules unfortunatly. I 
made a quick search for PGP & MIME (so you don't fiddle with the MIME 
structure yourself) and there are a few as well, e.g. Mail::GnuPG.

The most problem I see is that you have to open your secret key to 
MIMEDefang. As I understand your mail so, that you are using a 
single-person system, this drops down to how secure your server is and if 
you trust the system to hold your key without passphrase or in pgp-agent.

If the mail has more than one recipient, you need to use 
"stream_by_recipient()" (or similiar) to have all recipients receiving 
either encrypted or not.

Depending on the module you need to encrypt either in filter() each part 
or in filter_end() the message awhole.

BTW: You wrote "encrypt", if you really mean "encrypt" rather than "sign", 
you need to have the public keys of the recipients, maybe from a 
keyserver, and if there are multiple recipients, you need to think about 
if you encrypt for all recipients (and yourself) and send one copy of the 
mail to all or send one mail per recipient (using stream_by_recipient()).

Long time ago I looked at to sign the first text part of each outgoing 
message using PGP, but we dropped the idea after initial stage because of 
the security problems of the private keys.

I wonder why you don't want to encrypt/sign in the MUA. It is more 
flexible and, well, works most of the time.

Bye,

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iQEVAwUBSgKQ6tlJzF6z/k3SAQJF8gf+N9rAMDxHm50NaRTn3VCyxqM1VZUXe5GR
Yzwrx25g0JBxzDp1kpmsYjy4E6mD4CNT61ymKa3pFIZ7hNOkpFjhJc8gy5shEuHs
FRDo7GZGWtbSHpUVesrpJi+02dZ+iDXZcMwgMch3uKh3cAqJsBMafaxPP/GhgKH1
CniS+dc8EzIi+f/OzIvfsdqNt5QmgkzwfIanqTZJC0kbNARQos//OmTHQRys9pDD
R3viKrJoJt9FukVKJ0MtQAS9D1xqYpRWd7ClxFR5OaDweiMCQszqN+yI0vngdVze
Wy6XPHVVjEiUUJ5dXAodWXrEpBsiOI3h0jIFFo7cJrPOKA9r8vEO4g==
=7R0I
-----END PGP SIGNATURE-----



More information about the MIMEDefang mailing list