Discussion:
Encrypting old mails on IMAP server
(too old to reply)
Vitus Jensen
2009-05-21 23:07:21 UTC
Permalink
Hej!

I keep all my mails on IMAP servers and most of those mails aren't
encrypted. Are there tools which allow to encrypt those mails but keep
the header intact? Just rewrite the body, so that reply-linking etc is
still correct.

I could forward every message to myself but that would create a new mail
header.

Any hints?

Vitus
--
Vitus Jensen, Hannover, Germany, Earth, Universe (current)
J.T.F.
2009-05-22 12:21:13 UTC
Permalink
Post by Vitus Jensen
Hej!
I think that forwarding the messages encrypted would be the best, but
definitely not the fastest, solution.
Post by Vitus Jensen
I keep all my mails on IMAP servers and most of those mails aren't
encrypted.  Are there tools which allow to encrypt those mails but keep
the header intact?  Just rewrite the body, so that reply-linking etc is
still correct.
I could forward every message to myself but that would create a new mail
header.
Any hints?
Vitus
--
Vitus Jensen, Hannover, Germany, Earth, Universe (current)
Neil - Salem, MA USA
2009-05-24 14:31:43 UTC
Permalink
Post by Vitus Jensen
Hej!
I keep all my mails on IMAP servers and most of those mails aren't
encrypted. Are there tools which allow to encrypt those mails but keep
the header intact? Just rewrite the body, so that reply-linking etc is
still correct.
I could forward every message to myself but that would create a new mail
header.
Any hints?
Vitus
--
Vitus Jensen, Hannover, Germany, Earth, Universe (current)
Perhaps the following might work? (Readers: please feel free to comment.)

What if you were to forward the email to yourself *as an attachment*,
choosing PGP Partioned protocol for the encryption when sending? If when
you receive the email you do not decrypt it, then the original email will
appear as an encrypted attachment on the forwarded email. You could save
the attachment to a folder or directory on your system.

Neil - Salem, MA USA
J.T.F.
2009-05-24 15:09:45 UTC
Permalink
Post by Vitus Jensen
Hej!
I keep all my mails on IMAP servers and most of those mails aren't
encrypted.  Are there tools which allow to encrypt those mails but keep
the header intact?  Just rewrite the body, so that reply-linking etc is
still correct.
I could forward every message to myself but that would create a new mail
header.
Any hints?
Vitus
--
Vitus Jensen, Hannover, Germany, Earth, Universe (current)
Perhaps the following might work?  (Readers: please feel free to comment.)
What if you were to forward the email to yourself *as an attachment*,
choosing PGP Partioned protocol for the encryption when sending?  If when
you receive the email you do not decrypt it, then the original email will
appear as an encrypted attachment on the forwarded email.  You could save
the attachment to a folder or directory on your system.
Neil - Salem, MA USA
It may be more work to get the attached object encrypted than to just
FW: and encrypt inline.

Before you do any of this, be sure to make a safe copy of both your
public and private keys or you may lose all access to your emails
should your private key become lost.
Neil - Salem, MA USA
2009-05-24 16:49:29 UTC
Permalink
Post by J.T.F.
Post by Vitus Jensen
Hej!
I keep all my mails on IMAP servers and most of those mails aren't
encrypted. Are there tools which allow to encrypt those mails but keep
the header intact? Just rewrite the body, so that reply-linking etc is
still correct.
I could forward every message to myself but that would create a new mail
header.
Any hints?
Vitus
--
Vitus Jensen, Hannover, Germany, Earth, Universe (current)
Perhaps the following might work? (Readers: please feel free to comment.)
What if you were to forward the email to yourself *as an attachment*,
choosing PGP Partioned protocol for the encryption when sending? If when
you receive the email you do not decrypt it, then the original email will
appear as an encrypted attachment on the forwarded email. You could save
the attachment to a folder or directory on your system.
Neil - Salem, MA USA
It may be more work to get the attached object encrypted than to just
FW: and encrypt inline.
Before you do any of this, be sure to make a safe copy of both your
public and private keys or you may lose all access to your emails
should your private key become lost.
J.T.F.,

After reading your post and your concerns that it may be "more work to get
the attached object encrypted", I decided to try it and see.

Using Outlook Express, I selected a hundred emails in my Inbox,
right-clicked on the group and then chose "Forward as Attachment", selecting
myself as the recipient. The new "container" email being created showed the
selected emails as attachments, each with the Outlook Express email
extension of ".eml". I entered a Subject of "[pgp-e-p]" which on my
installation of PGP 9.9 (with my personally created PGP policies) invokes a
policy that causes the email to be encrypted with PGP Partitioned protocol.
Then I sent the encrypted email. All of this took no more than 60 seconds.

Then I received the email with the PGP 9.9 email proxy disabled. (I
disabled the proxy because I did not want PGP to automatically decrypt the
email.) Voila, I had an email with 100 attachments: my 100 encrypted
emails! This took no more than another 60 seconds.

Then I right-clicked on the attachments and did a "Save All" to a new folder
that I had previously created. This took 30 seconds.

To see how much work would be involved in decrypting these saved emails I
used Windows Explorer and selected all 100 encrypted emails in the new
folder. I then right-clicked on them and selected "PGP Desktop - Decrypt
and Verify 100 Items". I was prompted for my passphrase. Voila! All 100
emails were decrypted and fully intact, each of them with their original
names and each with an extension of ".eml".

There are a couple of issues with this procedure, though:

Problem #1: The encrypted emails were called "Attachment1.pgp",
"Attachment2.pgp", etc. It's impossible to tell which email is which until
you decrypt them.

Problem #2: If even one of the original emails is either encrypted or
signed using S/MIME, PGP 9.x will not use PGP Partioned protocol when
encrypting but will instead use PGP/MIME. It does this even when the policy
being invoked explicitly specifies to use PGP Partitioned protocol. The end
result of this is that upon receipt of the undecrypted email you have but
one encypted attachment called "Message.pgp". This is not necessarily a
huge problem though. The original emails can be recovered this way: Save
"Message.pgp" to a folder. Using Windows Explorer select the file,
right-click on it, select "PGP Desktop - Decrypt and Verify Message.pgp".
This yields a file called "Message". Since Outlook Express uses the
extension ".eml" for individual emails, if you are using OE, rename
"Message" to "Message.eml". (Other email programs may use other extensions.
Use whatever extension applies.) Open the email and you will see the email
you sent with all of the emails of interest attached and decypted. The
From, To and Subject fields of this one container email will probably be
empty and the Date field may be the date and time of when you open the
email, but the attachments will all have their original (correct)
information in their From, To, Subject and Date fields.

There is a good side to Problem #2. Any email that was originally S/MIME
signed or was encrypted with S/MIME will still retain its S/MIME signature
or will still be S/MIME encrypted after it is recovered from the attachment
called "Message.pgp".

So, this seems to be a good workable way for the original poster to
mass-encrypt his store of unencrypted emails, albeit with the issues I
mention above.

Neil - Salem, MA USA
Vitus Jensen
2009-05-25 09:59:21 UTC
Permalink
Post by Neil - Salem, MA USA
Post by J.T.F.
Post by Vitus Jensen
I keep all my mails on IMAP servers and most of those mails aren't
encrypted. Are there tools which allow to encrypt those mails but keep
the header intact? Just rewrite the body, so that reply-linking etc is
still correct.
I could forward every message to myself but that would create a new
mail header.
Any hints?
Vitus
Perhaps the following might work? (Readers: please feel free to comment.
What if you were to forward the email to yourself *as an attachment*,
choosing PGP Partioned protocol for the encryption when sending? If when
you receive the email you do not decrypt it, then the original email wil
appear as an encrypted attachment on the forwarded email. You could save
the attachment to a folder or directory on your system.
Neil - Salem, MA USA
It may be more work to get the attached object encrypted than to just
FW: and encrypt inline.
Before you do any of this, be sure to make a safe copy of both your
public and private keys or you may lose all access to your emails
should your private key become lost.
J.T.F.,
After reading your post and your concerns that it may be "more work to get
the attached object encrypted", I decided to try it and see.
Using Outlook Express, I selected a hundred emails in my Inbox,
right-clicked on the group and then chose "Forward as Attachment"
...
Post by Neil - Salem, MA USA
So, this seems to be a good workable way for the original poster to
mass-encrypt his store of unencrypted emails, albeit with the issues I
mention above.
Thank you for your test. I find it especially interesting that all
mails were converted to PGP/MIME so attachments were encrypted, too.

Of course I want to keep those message on the IMAP server (otherwise I
could just download them and encrypt locally) so the procedure will be a
little different. And missing a license for the program you mentioned I
will see whether if works with claws or evolution or the like.

Given the amount of IMAP support for different programming languages I had
hope that there might exist a specialized for this purpose, though.

Vitus
--
Vitus Jensen, Hannover, Germany, Earth, Universe (current)
J.T.F.
2009-05-26 12:49:37 UTC
Permalink
Post by Neil - Salem, MA USA
Post by J.T.F.
Post by Vitus Jensen
Hej!
I keep all my mails on IMAP servers and most of those mails aren't
encrypted. Are there tools which allow to encrypt those mails but keep
the header intact? Just rewrite the body, so that reply-linking etc is
still correct.
I could forward every message to myself but that would create a new mail
header.
Any hints?
Vitus
--
Vitus Jensen, Hannover, Germany, Earth, Universe (current)
Perhaps the following might work? (Readers: please feel free to comment.)
What if you were to forward the email to yourself *as an attachment*,
choosing PGP Partioned protocol for the encryption when sending? If when
you receive the email you do not decrypt it, then the original email will
appear as an encrypted attachment on the forwarded email. You could save
the attachment to a folder or directory on your system.
Neil - Salem, MA USA
It may be more work to get the attached object encrypted than to just
FW: and encrypt inline.
Before you do any of this, be sure to make a safe copy of both your
public and private keys or you may lose all access to your emails
should your private key become lost.
J.T.F.,
After reading your post and your concerns that it may be "more work to get
the attached object encrypted", I decided to try it and see.
Using Outlook Express, I selected a hundred emails in my Inbox,
right-clicked on the group and then chose "Forward as Attachment", selecting
myself as the recipient.  The new "container" email being created showed the
selected emails as attachments, each with the Outlook Express email
extension of ".eml".  I entered a Subject of "[pgp-e-p]" which on my
installation of PGP 9.9 (with my personally created PGP policies) invokes a
policy that causes the email to be encrypted with PGP Partitioned protocol.
Then I sent the encrypted email.  All of this took no more than 60 seconds.
Then I received the email with the PGP 9.9 email proxy disabled.  (I
disabled the proxy because I did not want PGP to automatically decrypt the
email.)  Voila,  I had an email with 100 attachments: my 100 encrypted
emails!  This took no more than another 60 seconds.
Then I right-clicked on the attachments and did a "Save All" to a new folder
that I had previously created.  This took 30 seconds.
To see how much work would be involved in decrypting these saved emails I
used Windows Explorer and selected all 100 encrypted emails in the new
folder.  I then right-clicked on them and selected "PGP Desktop - Decrypt
and Verify 100 Items".  I was prompted for my passphrase.  Voila!  All 100
emails were decrypted and fully intact, each of them with their original
names and each with an extension of ".eml".
Problem #1:  The encrypted emails were called "Attachment1.pgp",
"Attachment2.pgp", etc.  It's impossible to tell which email is which until
you decrypt them.
Problem #2:  If even one of the original emails is either encrypted or
signed using S/MIME, PGP 9.x will not use PGP Partioned protocol when
encrypting but will instead use PGP/MIME.  It does this even when the policy
being invoked explicitly specifies to use PGP Partitioned protocol.  The end
result of this is that upon receipt of the undecrypted email you have but
one encypted attachment called "Message.pgp".  This is not necessarily a
huge problem though.  The original emails can be recovered this way:  Save
"Message.pgp" to a folder.  Using Windows Explorer select the file,
right-click on it, select "PGP Desktop - Decrypt and Verify Message.pgp".
This yields a file called "Message".  Since Outlook Express uses the
extension ".eml" for individual emails, if you are using OE, rename
"Message" to "Message.eml".  (Other email programs may use other extensions.
Use whatever extension applies.)  Open the email and you will see the email
you sent with all of the emails of interest attached and decypted.  The
From, To and Subject fields of this one container email will probably be
empty and the Date field may be the date and time of when you open the
email, but the attachments will all have their original (correct)
information in their From, To, Subject and Date fields.
There is a good side to Problem #2.  Any email that was originally S/MIME
signed or was encrypted with S/MIME will still retain its S/MIME signature
or will still be S/MIME encrypted after it is recovered from the attachment
called "Message.pgp".
So, this seems to be a good workable way for the original poster to
mass-encrypt his store of unencrypted emails, albeit with the issues I
mention above.
Neil - Salem, MA USA
Great test. What I meant by more work than it would be worth, you
would do a FW on each individual mail item or like you found out, they
become attachments and are unidentifiable.

Loading...