Currently I have a running Postfix server which delivers incoming mail through procmail. That works fine but now I want to decrypt any incoming mail which is encrypted with pgp automatically. So I have created a procmail rule to trigger gnupg.
This is my current .procmailrc:
:0 fw * ^Subject: encryptme | /usr/bin/gpg --decrypt | mail -s "ENCRYPTED: $subject" firstname.lastname@example.org
Now the mail is successfully decrypt and sent to email@example.com but with an empty subject (the mail only shows "ENCRYPTED: ") and with the email address of the server as the sender. And of course the decrypted mail contains parts of the email header.
Content-Type: multipart/mixed; boundary="713bkotRlnRGA7FAhJANoI0IsDpX3ws8N" --713bkotRlnRGA7FAhJANoI0IsDpX3ws8N Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Just a test. --713bkotRlnRGA7FAhJANoI0IsDpX3ws8N--
Is there any possibility to decrypt incoming mail this way automatically and "clean" (just the decrypted message) without additional software like GNU Anubis? And what is a good rule for procmail to trigger the program (insted of the subject)?
I hope this information is enough for somebody to help me.