Last Comment Bug 280588 - Encrypted email messages should be stored decrypted in the local folders
: Encrypted email messages should be stored decrypted in the local folders
Status: NEW
:
Product: Thunderbird
Classification: Client Software
Component: General (show other bugs)
: unspecified
: All All
: -- enhancement with 17 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
: 247562 (view as bug list)
Depends on:
Blocks: 644723
  Show dependency treegraph
 
Reported: 2005-01-31 15:35 PST by Wan-Teh Chang
Modified: 2016-04-26 09:09 PDT (History)
35 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Wan-Teh Chang 2005-01-31 15:35:23 PST
If a user saves an encrypted email message in a
local folder, the email message should be stored
in the clear (decrypted), with any signatures
intact.

Email encryption should only be used for email
transport, not for storage.  If the locally stored
messages need to be encrypted, they should be
encrypted using a different method.  (Perhaps
local mail folder encryption should be a related
enhancement request.)

This will reduce the need to keep many old private
keys around to decrypt old encrypted email messages.
Comment 1 Christoph Dwertmann 2005-11-08 10:20:07 PST
This would also solve the issue of searching the body of encrypted mails, which is not possible as of now. See https://bugzilla.mozilla.org/show_bug.cgi?id=188988
and
https://bugzilla.mozilla.org/show_bug.cgi?id=260665
Comment 2 David :Bienvenu 2005-11-08 10:27:37 PST
Nelson, thoughts on this? Are we going to get an equal number of complaints if we stop encrypting the local store?
Comment 3 Christoph Dwertmann 2005-11-08 10:45:17 PST
In my opinion, S/MIME and PGP are mechanisms to encrypt the email transmission over the public Internet, and not to encrypt the local user's mailbox. There are other ways to do that (put your Maildir in a cryptoloop, secure your system). 

An email archive that cannot be searched is useless to me. If I lose one of my old private keys, the corresponding archived messages are lost forever.

BTW mutt has a feature to search encrypted messages and another feature to save a decrypted copy to the mail folder.
Comment 4 Robert Relyea 2005-11-08 10:47:49 PST
I think the answer is 'yes'.

This bug really should be 'figure out how to manage encrypted messages better'.

The problem isn't necessarily that the email is stored in the local folder encrypted, the problem is under certain conditions the user may loose access to old email if he looses his private key. Changing the subject to the real problem, however, will get it closed with the statement "of course, that is the way it is supposed to work".

This bug is really a place holder for figuring out when and how we deal with encrypted email. For some use, encrypted email is encrypted for transport reasons (that is they are sent through untrusted channels). Once that email arrives there is no further reason for maintaining encryption. In this case we should decrypt the message immediately.

Some usage cases are such that the message itself must be protected, in perpetuity, no matter how much it's is 'copied'.

We need to work out each scenario and determine the correct semantic without resorting to a ton of user options. The proposal is a pretty good first cut compromise for an IMAP based email system.

Comment 5 David :Bienvenu 2005-11-08 10:58:51 PST
Oh, so the proposal is that if an encrypted imap message is copied to a local folder, it should be decrypted. I see...and that should be an OK default. Seems reasonable. 
Comment 6 Nelson Bolyard (seldom reads bugmail) 2005-11-08 13:46:53 PST
I think it would be fine to give the user the *option* of storing messages in
decrypted form, but I certainly would not take away the capability of 
working as it does now, preserving the original message intact in the folder.

Since we have no encryption/password protection for our local mail folders,
I very much want encrypted mails to remain encrypted in my folders at all 
times.  

Question about the original proposal.  If the objective is to improve searchability of messages, then in addition to decryption, should we also 
decode base64 and quoted printable, and store the results?
Comment 7 Christoph Dwertmann 2005-11-08 14:09:59 PST
There is no doubt that encrypted messages in an IMAP folder should stay encrypted as they are.

Securing data in the local mail folders is neither PGP's or S/MIME's task, nor is it Thunderbird's task. It can simply be done by setting the right file permissions, choosing a good login password and all other means we do to keep others from accessing our data. The paranoid of us can still use an encrypted file system, or put their mail folders on a USB stick.

Having the option to decrypt messages when saving them to a local folder would provide searchability without further implementation. Searching in encrypted messages could be a problem: on every first search the user will have to enter the passphrases for all the keys he/she uses (e.g. one key per email address) and all encrypted messages need to be decrypted and searched in the background in a secure manner. This may be slow and annoying.
Comment 8 Julien Pierre 2005-11-08 14:50:31 PST
Christoph,

The user will only need to enter one password for each token that stores keys. If the user stored all his private keys in the NSS database (internal softoken), then he will only need to enter a single password at the time the search function finds the first encrypted e-mail. Under most circumstances, the program stays logged in to the token, so it is only a one-time password prompt.

If the user has multiple private keys that aren't all stored in the same token, and not all the tokens can be connected to the machine at the same time (eg. the user has 10 USB keys with one key each, but only 2 USB ports - or 2 smartcards but only one smartcard reader), then the search function wouldn't work, unless it asked the user to plug in the token that may contain the missing key for each message. This would be much more annoying than just a password prompt, and I don't think anybody would want that behavior ;)
Comment 9 R. Landfill 2009-02-15 08:30:22 PST
One possible user-interface: If a user right-clicks on the mail message, one of the options would be to "Create decrypted copy". If this option is chosen a decrypted copy is stored in the same folder as the encrypted folder. 

It would be important to ensure that the new mail message have a clear indication that it is a copy of an encrypted e-mail message and perhaps when it was created (e.g., "This decrypted copy of an encrypted email message was made on MM/DD/YYYY"). Otherwise, the user might come back to the message at a later date and, forgetting that he had created a decrypted version, think that the original message was sent in the clear and start to panic.
Comment 10 roy.shishido 2009-03-25 14:37:40 PDT
This topic or issue has come to a dead end - 

It appears that there are only two options - 

1. leave as is - messages remain encrypted
2. provide means to save messages in a decrypted form

So obviously, allowing the user interface that provides for the option to choose option 2 is all that is needed.

There are probably many reasons for and against, but allowing the user an option appear to be the way forward.  Anyone disagree?

So how do we energize this to move in that direction?

We chose to use Thunderbird over Outlook, but not having this option to save messages in an unencrypted state is a very big issue that may force us to abandon Thunderbird and migrate to Outlook instead.

There are work arounds to circumvent this, but it really taints Thunderbird as being "kludgy" when we know that it is far from that :-)

Let's get energized and FIX this!

Please let me know if there is anything that we can do to assist.

Thanks!
Comment 11 Eddy Nigg (StartCom) 2009-03-25 14:45:38 PDT
I would support such an option. Not sure if there are takers to work on this bug however. Copying David Bienvenu since he might do some related stuff.
Comment 12 mthibert 2009-03-25 15:43:17 PDT
I would really like to see an option to be able to save encrypted emails in an unencrypted format.  I believe Eudora had this feature.  Unfortunately, I am not a programmer, but if there is any way I can help let me know.
Comment 13 Nelson Bolyard (seldom reads bugmail) 2009-03-25 20:27:15 PDT
3.5 years after writing comment 6, I will add this perspective in reply to 
comment 10:
> This topic or issue has come to a dead end - 

All significant development on the S/MIME signed and/or encrypted email
capabilities in Mozilla email clients (including Thunderbird) came to a 
dead end years ago.  In the years 2000-2002 there was a big effort to 
bring the SMIME capabilities in (then Mozilla 1.x) up to the then-current
standards, S/MIME 3.0 and Cryptographic Message Syntax (CMS) 1.0.  
Support was added to NSS for CMS 1, defined in RFC 2630 dated June 1999.
Support was added to Mozilla for S/MIME 3.0 RFC 2633.   Worked stopped
just short of implementing "Enhanced Security Services for S/MIME", 
defined in RFC 2634 also in June 1999.  I believe NSS is capable of 
doing it, but the Mozilla mailnews software does not do it.

Then it all stopped,  Since then, efforts have been made to fix a bug or
two here or there, and to keep it working as well as it did when changes
to the underlying code base have necessitated maintenance to this code,
but it hasn't moved forward.  

Since then, the standards for S/MIME have continue to advance, including:
1999/06 - ESS   - RFC 2634
2002/08 - CMS 2 - RFC 3369
2004/07 - CMS 3 - RFC 3852, used in S/MIME v 3.1, RFC 3851.

but none of these newer standards have been picked up in Mozilla mailnews
clients, AFAIK.  I know of no new features that have been added to Mozilla's
SMIME support since then.  

2-3 years ago, the government of France employed a team to develop 
enhancements to Mozilla's email capabilities.  They developed two 
significant patches to implement two components of ESS, attached to 
Bug 380624 - ESS: Triple Wrapping (RFC2634 - 1.1)
Bug 386313 - ESS: Signed Receipts (RFC2634 - 2)

Those patches have been sitting, awaiting review, for over 18 months now.
This says to me that, even if someone with the significant resources of a 
western nation applies those resources to enhancing the SMIME capabilities
in Mozilla mailnews, they cannot be assured that those enhancements will 
get into the product.  

I do not wish to be critical here of any particular group of Mozilla mailnews
contributors, but I will offer some observations about the current situation.

I observe that there is something of a "stalemate" between the mailnews 
developers and the PSM developers over all matters having to do with crypto
in Mozilla mailnews.  It appears to me (I can back this up by citing 
specific bugs, if necessary) that members of both groups are (or have been)
waiting for members of the other group to move forward on this.  I believe 
the PSM folks have been told pretty clearly that they are to give all 
priority to browser issues, not to mailnews issues.  I believe the mailnews
guys do not give a high priority to SMIME issues, but even if they did, they
(some of them) perceive that PSM code (and crypto code in general) is all 
rather foreign to them, and perhaps that they are not welcome to change PSM.

Even getting issues regarding the use of SSL in mailnews fixed has been very
slow and painful, witness the huge recent arguments over the utility of SSL
client authentication with mail servers, and the numerous bugs on that subject.  

I wish I could see a way out of this, but I do not.  I invite the management 
of Mozilla's mail/news company (is it called "mailco" now?) to participate 
in this discussion if they can see a way forward.  Another venue for this 
discussion would be OK, IF and only IF the mailco managers will commit to 
engaging in discussion there.  

Perhaps if someone was to fund one or more developers to work at mailco for 
the exclusive purposes of moving S/MIME forward, it would move forward again.  
To succeed, that person, or group of persons, would need the authority to 
make the changes that the French contributors did not have.
Comment 14 David :Bienvenu 2009-03-25 22:27:38 PDT
afaik, the s/mime changes are awaiting Kaie's review, and that has not gone anywhere. Perhaps we need some peers in s/mime so we're not blocked on Kaie.
Comment 15 David Ascher (:davida) 2009-03-25 23:18:57 PDT
Nelson - I'm happy to talk about MoMo (that's the new cool name for Mozilla Messaging) anywhere, but as you suspected this bug feels like the wrong place.  If it's to be in a bug, maybe we could have a bug that's about _that_ topic, and leave this bug to the topic in the subject?

(Aside: I've met several times with many individuals in the French government driving the Milimail project, and from what I can tell they're actually pretty happy with where Thunderbird is at.  I don't recall whether we talked about those paches in particular, but in general their needs are better met by developing a comprehensive add-on which does a lot more -- used to be called milimail, now called trustedbird).

I think I share part of the assessment that there's not the right level of code evolution in the security-related code that impacts Thunderbird, either in PSM or NSS, from what I can tell.  I suspect part of that is because NSS is used in lots of products (and so many of the interfaces aren't XPCOM, IIRC), and neither NSS nor PSM have enough people working on them given the complexity of the issues.  Another big reason I suspect is that changing security-related code is scary, so it's hard to get new people into it.  

I've done a little digging into PSM/NSS to try and provide interfaces to cert errors that are more user-friendly in an email context than the current browser-centric scenarios, and that code is no fun.  Also, figuring out how to evolve new interfaces to that code while not introducing security risk for products (like Firefox) that may not need them will take serious module ownership, planning, architecture, etc.

A different problem is how to assess the value of pushing s/mime forward relative to all the other things we could/should be doing from a Thunderbird specific POV.  At this point, I can't see having an s/mime specific engineer, given that we have a handful of people, and lots of areas to improve that affect large percentages of our user base, unlike s/mime (which, AFAICT, is important for a small % of users).  I am super motivated to do what I can to get good contributions from qualified third parties, though!
Comment 16 Eddy Nigg (StartCom) 2009-03-25 23:42:33 PDT
[Off-Topic]

David A., there has been also some discussion at m.d.t.crypto and m.d.s.policy on how to advance S/MIME. I suggest to read recent threads and join for some initial discussion. The goals are to make it relevant for many % of users ;-)

Fixing this bug would be also helpful for some users. However I'm not sure of Kai can take any more...Thanks.
Comment 17 Nelson Bolyard (seldom reads bugmail) 2009-03-26 00:21:13 PDT
In reply to comment 15:
MoMo, eh?  Cute.  I like it.
MoMe might fit the words better, but probably would be pronounced mommy :)

Regarding PSM staffing:  For a long time, PSM staff was Kai and Kai alone.  
Kai did (does) a good job but there is just too much to do.  So, back when 
MoCo announced it was putting its emphasis on Firefox, Kai's (then) boss 
told me that he had directed Kai to give all priority to FF, so that his 
efforts would be aligned with MoCo's.  I think that's more-or-less the same 
today.  Maybe MoMo should ask Kai's present boss at Red Hat if they're 
willing to contribute more to TB, now that MoMo is is business (so to speak). 

Recently, MoCo added Honza Bombas to the PSM team!  Honza is also very capable.  Maybe MoCo could lend some of his time to reviewing the bugs cited above, and/or other MoMo work for SMIME and/or mail-over-SSL/TLS.  

I think the milimail patches need some more work.  I think the Milimail folks
have long ago given up on trying to get their changes into Firefox, and so 
now they probably won't be quick to pick that back up, but they've done MOST
of the work, IMO, and what's left is some UI polishing and some new prefs, 
IMO.  It would be good if MoMo could lend a hand with that.  

The patch for triple wrapping is predominately in 
mozilla/mail/extensions
mozilla/mail/themes and
mozilla/mailnews/extensions/smime/resources/content,
and it's not immediately clear to me that any of that is rightfully PSM.  
Only two files, in mozilla/mailnews/extensions/smime/src, appear to be 
c++ code.  The rest is Xul, js, css and property strings.

IMO, the area where attention is MOST needed is straightening out the whole
mess of certificate preference selection on a per-account basis, so that the 
right cert (which may be NO cert) gets used consistently for IMAP or SMTP or 
POP over SSL/TLS, based on account prefs, without needing to pester the user 
constantly.  (Sorry, that's not good news for this bug, but it's gotten a 
WHOLE lot more attention from users than this one has, IMO.  Squeaky wheel
should get SOME grease.)

I will volunteer to help any MoMo developer with any scary stuff as best I can
including suggesting possible changes to the PSM components (or whatever they really are).  After 13 years, none of this stuff scares me any more. :)

In reply to comment 16:
The discussion in m.d.t.crypto is buried pretty deep in another thread, IIRC.
I would characterize it more as a discussion of how non-software developers
would redesign SMIME than how to advance it.  Considering how active the 
IETF SMIME WG is (quite), I think MoMo should try to keep up with the pack
rather than going off inventing something totally new.
Comment 18 Nelson Bolyard (seldom reads bugmail) 2009-03-26 00:47:25 PDT
IN the last 3.25 years, the NSS team has made these changes to the relevant
NSS code for SMIME:

http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=NSS&branch=&branchtype=match&dir=mozilla%2Fsecurity%2Fnss%2Flib%2Fsmime&file=&filetype=regexp&who=&whotype=regexp&sortby=Date&hours=2&date=explicit&mindate=2006-01-01&maxdate=2010-01-01&cvsroot=%2Fcvsroot

That's not a lot of code.  The highlights are:
a) Added support for AES encryption (bug 379753)
b) Added support for generalized PKCS#5 v2 Password Based Encryption 
   (Bug 401928)
c) Work around a flaw in messages received from KMail (Bug 379625)
Comment 19 Ludovic Hirlimann [:Usul] 2009-03-26 08:45:33 PDT
*** Bug 247562 has been marked as a duplicate of this bug. ***
Comment 20 iglee83 2009-03-27 10:06:12 PDT
It would be useful to allow saving an encrypted email message in the clear (on a local or network folder).  If a file needs to be protected once it is decrypted, there are other less problematic ways to do it.  

Anything we can do to push this project up to the top of the list of things to "fix"?
Comment 21 Jerry Ogaz 2009-03-27 15:16:17 PDT
I agree with the sediments in message #3 & #10. It would seem to be fairly easy to give the end user a prompt to save a message that was just decrypted and is currently displayed on the screen. Just give 'em the ability to save the message in a decrypted form since the difficult part of decrypting is already done. Now I just want to save the message so if my key changes I don't have to keep the old key around to decrypt the messages every time I want to view them. I want the messages encrypted for transmission I don't need them encrypted once they arrive. But by making it a prompt when you open/close the message or a check box item in the configuration you give the end user the choice as to how they want to store their email.
Comment 22 Ralf Hauser 2009-06-20 06:48:46 PDT
as stated in Bug 276786, I agree with nelson's comment 6 that secure by default (i.e. keep the local data encrypted if we get it that way from transport) is the right approach, but that one should offer options for different behaviour of one's mail client:
1) In a message-detail's "save as" add the option to save unencrypted
2) by default keep the subject/from decrypted (once there is smime-v3) to have at least in the inbox the overview who sent what (trigger the decryption by the first view by the user)
3) after first view, also keep the body decrypted (to allow for full-text searching)
4) after first view, keep the entire message decrypted (incl. attachments)
Comment 23 Konstantin Andreev 2011-02-18 03:58:33 PST
Worth to mention: 
    the right key management policy *mandates* you to securely destroy the expired private keys.

Indeed, do you keep expired "your certificates" in PSM? I believe, you don't. So, if you didn't manage to manually save your decrypted mail somewhere by copy-paste (sic!) from a mail window, it lost forever :( This is quite annoying and error-prone.
Comment 24 tlauck 2011-02-18 07:51:39 PST
I keep my expired certificates for the reason you suggest.  I also keep all of my email, but all the storage used by Firefox to hold the email, profiles, etc., is in encrypted O/S files.  (Windows XP Professional). 

IMO the fact that messages are stored encrypted is one of the main reasons why I do not use email routinely when communicating to other people with MIME keys. I would not recommend use of MIME to my friends for this reason.  If decryption were automatic when arriving at the user agent then email encryption could be automatic in these cases.  Users would have a once a year hassle updating their browser keys and would have to take care not to send a private message to a person who didn't have encryption, but otherwise operation would be automatic.

It continues to amaze me that after all of these years people are still handling email encryption incorrectly from the human factors standpoint, and hence the result is NO encryption and No security.
Comment 25 Nelson Bolyard (seldom reads bugmail) 2011-02-18 09:53:48 PST
PSM DOES NOT automatically delete expired certs in any category.  
It is always possible to read old encrypted emails because PSM 
does not delete either the old certs nor the old private keys.
Comment 26 Konstantin Andreev 2011-02-18 23:50:33 PST
(In reply to comment #25)
> PSM DOES NOT automatically delete expired certs in any category.  

That's rigth. But if you keep expired "your certs", that's wrong.

The true key management policy/rules, if you have one, obliges you to irreversibly erase expired private keys. 

This is important, because keys can be stolen. An adversary can use stolen keys to read enciphered messages, intercepted in the past. And, if cert key usage also allows signing (typical Verisign/Thawte/etc certs allow), an adversary can forge your signature post factum.
Comment 27 Nelson Bolyard (seldom reads bugmail) 2011-02-19 00:36:14 PST
It is MUCH easier for your adversary to steal messages that have been 
decrypted and stored as plaintext than to steal your private keys and 
re-decrypt your encrypted messages.
Comment 28 Konstantin Andreev 2011-02-19 01:06:42 PST
It depends.

Assume I do not keep highly sensitive mail at all. I receive sensitive mail, read, take into account, and erase immediately. But adversary - intercepts and saves. Doesn't delete.

So, my mailbox is really secure, there is no sensitive mail in. Impossible to steal. But, once upon a time a bunch of my expired private keys get stolen. Bingo! An adversary reads accumulated sensitive messages.

That's why the keys shall be deleted as soon as they expire.

At the same time, I can choose to keep not very sensitive, but for some reason encrypted messages in my mailbox. I do not want to loose access to these messages after erasing private keys.

Then, stealing from a mailbox and stealing private keys - are different tasks. There may be an opportunity to steal keys, but may not be an opportunity to steal from a mailbox.
Comment 29 [Baboo] 2011-02-19 06:59:34 PST
(In reply to comment #28)
> Assume I do not keep highly sensitive mail at all. I receive sensitive mail,
> read, take into account, and erase immediately. But adversary - intercepts and
> saves. Doesn't delete.
> 
> So, my mailbox is really secure, there is no sensitive mail in. Impossible to
> steal.
I guess you are assuming that no traces are left.

> That's why the keys shall be deleted as soon as they expire.
Implying that they can be reliable deleted.

> 
> Then, stealing from a mailbox and stealing private keys - are different tasks.
> There may be an opportunity to steal keys, but may not be an opportunity to
> steal from a mailbox.
And the other way round. You might want to protect both.
Generally speaking, if one wants to have a somewhat reliable protection of sensitive information on his machine he should use full disk encryption or such, ie. have most non-volatile memory encrypted, which in this case should at least include the private key storage, the mail storage and any swap partitions/files.

That's why I am not against saving mails unencrypted (unencrypted from TB's POV).
Comment 30 David.P 2012-05-02 08:56:00 PDT
Almost ten years and not the SLIGHTEST progress. Oh well...
Reminds me of Outlook Express and its forever unresolved bugs that used to drive everyone nuts (until everyone stopped using it of course).

Any hints for a replacement for Thunderbird that will allow me to actually WORK with my email archives are very welcome.
Comment 31 O. Furlong 2013-12-19 09:45:26 PST
I just wanted to bring this topic up again. I think that's one of the most needed feature at the moment.

In the pre-snowden-era people mostly used email encryption in single cases, e.g. if they had a secret information to send to someone else. Back then the argument to better have it stored encrypted made sense (see above). 

But now many people want to use encrypted emails on a daily basis. They want to encrypt not because they have a secret but to prevent someone, e.g. NSA, to build a lifetime archive of their communication. 

In this new use case searching emails and storing them decrypted is essential. Otherwise it would turn a nightmare! Think of just 5 months of email and you need to search for one. Think of ten years of emails - you will not even be able to remember all you different keys and passwords.
Comment 32 Tilo Freiwald 2013-12-19 13:17:13 PST
(In reply to O. Furlong from comment #31)
Dear developers, I agree fully with Mr Furlong, and hope sb finds the passion to prioritize this bug.

Recent developments show us how importent encryption is and its widespread use is dependant on easy usability.
Local encryption can be omitted without big losses in security but great improvements for the usability in this case. Anyway quite a few people use transparent full disc encryption anyway.
Comment 33 Konstantin Andreev 2013-12-23 01:23:16 PST
I guess, the lack of development resources is not the main obstacle to have this issue resolved. Look, even if I decrypt a message, I do not want to discard encrypted one, because it contains, in general, correspondent's signature and certificate, s/mime caps, etc. I want to keep encrypted message as long as decrypted one. That is, encrypted and decrypted messages are the pair.

How may this fit into the very common use case of [IMAP + server-side search] ? There must be some rule, how both parts of message pair are kept on the server. Possible choices include:

  1) advance IMAP standard :) to be able to track related versions of a message
  2) keep encrypted message as attachment to decrypted one
  3) replace encrypted message by decrypted one, but put encrypted into distinct IMAP subfolder
  4) keep both parts of pair in the same IMAP folder, but track relation by message headers
  ...

(1) is hopeless choice, (2-...) aren't interoperable. An individual developer wouldn't take a risk to implement any of non-interoperable choices, because of high probability of being not approved by Mozilla team. The broad discussion is required before some progress could be made in this issue.
Comment 34 O. Furlong 2013-12-23 03:14:34 PST
I understand the issues with IMAP and appreciate your ideas of keeping a encrypted copy. So my suggestion:

1. First make a option to overwrite encrypted email with decrypted one using POP3. Implement feature to keep a encrypted copy in a specified folder 
2. Then try to solve the issues with IMAP. Here I suggest to start with an option to store decrypted emails locally, then implement one of the ideas for changing them on the server (comment #33).
Comment 35 O. Furlong 2013-12-26 14:28:21 PST
Ok, I will not give up until this this bug is solved. So I will do a crowdfunding. But I need your help:
1. Is there a thunderbird developer who can estimate the costs of the simplest solution (= pop3 mode and overwrite existing mails with decrypted content)
2. Is there a freelance developer willing to do that for money in the next months?
3. Ideas for a suitable crowdfunding platform? 
4. Are there any other wishes/ideas?
Comment 36 David.P 2013-12-27 00:48:09 PST
This is a great initiative. Thank you.
Comment 37 Evaldas Jocys 2014-01-18 06:46:27 PST
This is how this can be implemented:

New check box on: Tools -> Account Settings -> <account@name> -> Security 

   [x] Create decrypted copy

and button:

   [Remove decrypted copies]

If option is checked then (as soon as you decrypt mail) Thunderbird will:

   a) Put original encrypted mail into separate field for backup purposes.
   b) Replace current encrypted mail with decrypted copy.

If you press [Remove decrypted copies] button then Thunderbird simply restores encrypted mail from the backup. Note: Before restoring encrypted copy, Thunderbird can warn users about missing private certificates - emails which could not be decrypted any more.

I agree that main thing is to protect e-mail while it is travelling trough the Internet. As soon as e-mail safely arrives into protected environment, it can be stored in plain format.
Comment 38 O. Furlong 2014-01-18 09:26:54 PST
Here is a first draft of the feature request. I tried to keep it as minimal as possible: 
http://pastebin.com/3P8uXfFs

Feel free to comment! We will start a crowdfunding for it soon. 

- Imap support was skipped, could be done in a second funding though
- Added request for keeping encrypted copy, so original headers and/or digital signatures are preserved
- Removing button is not needed, as user can delete decrypted mails by himself and still has copy in encryption folder
- We're trying to enable enigmail programer Patrick Brunschwig to implement GnuPG option with this request also
Comment 39 David.P 2014-01-20 05:55:26 PST
Again, great initiative.

In my view, support for permanenet LOCAL decryption and storage would be perfectly sufficient, for a start.

If needed, one could always set up a filter action that moves decrypted copies back to the IMAP server.
Comment 40 David.P 2014-01-20 06:05:03 PST
Addendum: 

A first solution should not be limited to POP _retrieval_. For example in Thunderbird, I only use IMAP access with all mail accounts, but then have Thunderbird copy new mail to local mail folders (based on automatic filter actions). 

Thus the following scenario should be covered as well:

- retrieve mails in Thunderbird via IMAP,
- decrypt them locally (leaving the copy on the IMAP server untouched/encrypted)
- move decrypted copy to local Thunderbird mail folder (e.g. using mail filters)

Cheers David.P
Comment 41 O. Furlong 2014-01-20 08:30:24 PST
#40: Just tried it: You can create an IMAP and POP3 account for the same mailbox - so you can easily use the POP3 decrypting solution parallel to an IMAP account.
Comment 42 David.P 2014-01-20 08:49:15 PST
I know (and have done that for years) but it is much more complicated to fetch mail using both IMAP and POP, and can have unwanted side-effects, depending on the IMAP service.

I'd rather use only IMAP everywhere, and then handle and store (only) those encrypted messages locally.

The local (client) handling, decryption and storage *after* the transfer is the crucial issue in my opinion.

Thus, the solution should not be limited to one of POP and IMAP access (since this again only _transfers_ the mail from the server to the client), but instead should be independent of that transfer mode.
Comment 43 O. Furlong 2014-01-20 09:31:34 PST
Ok, I just had a nice idea from your suggestion: Probably it's even easier and more powerful to implement a decryption action for the filter dialog. 

"decrypt message"

You can combine that with copy and move:
"copy message to" "encrypted"
"decrypt message"

What do you others think?
Comment 44 David.P 2014-01-20 09:37:32 PST
YESSSSS.

A great idea, for its clarity, simplicity, and flexibility.

This would be THE ideal starting point for a first (and possible even final) solution regarding the present issue, in my view.
Comment 45 Thomas Peters 2014-01-26 00:41:49 PST
I do have an encrypted hard drive with pretty catholic file system permissions. Anyway, I prefer my encrypted mail to stay as it is. Why? Glad you ask. Once adversaries get wind of Thunderbird's storing encrypted mail decrypted they will switch from intercepting transport to scanning your mail folders with malware. Bam! Precautions subverted. And while we're at it, why not abandon the master password and store all login data in the clear?

Long story short, a serious MUA must be capable of searching encrypted mail without storing the cleartext.

As a side note, one popular mistake made by people who say there is "no sensitive mail in my mailbox" is that it's not themselves who decide what is sensitive, it's the adversaries.
Comment 46 Magnus Melin 2014-01-26 02:41:42 PST
Wrong, with malware on your system you already lost. (And the master password is just protecting against casual password reveal, it's no protection if someone puts any effort into it.)
Comment 47 O. Furlong 2014-01-26 09:27:50 PST
Finally! We just started a crowd funding for the filter action solution. Any programmers are welcome to work on it.
If everybody just gives a small amount we can fulfill this ten year old request! 

http://freedomsponsors.org/core/issue/434/encrypted-email-messages-should-be-stored-decrypted-in-the-local-folders
Comment 48 Stefan Meir 2014-01-26 10:57:01 PST
I'd love to push this initiative financially, but I'm confused of there being two crowdfunding campaigns (http://freedomsponsors.org/core/issue/435/decrypt-messages-permanently and http://freedomsponsors.org/core/issue/434/encrypted-email-messages-should-be-stored-decrypted-in-the-local-folders).

Are those two campaigns on competition and would each of them lead to a working solution, regardless of the other one? Or are both required and should I consequentially support both?

It would be great if somebody could clarify ...
Comment 49 O. Furlong 2014-01-26 16:55:18 PST
#48: Fine!

We had to split it, as there are mainly two encryption technologies in use: 
- The Thunderbird campaign (434, second link) implements it for the built-in S/MIME encryption 
- The Enigmail campaign (435, first link) implements it for the popular add-on which offers OpenPGP-encryption.

As they are written in different languages on different repositories, it didn't make sense to fund them together. So you only need one, depending which encryption you use currently.
Comment 50 Thomas Peters 2014-01-27 07:15:33 PST
Well, if it's democratically agreed to do it the wrong way I'm totally fine with that. Just don't blame me afterwards for not having informed you thusly when all falls to pieces.
Comment 51 tlauck 2014-01-27 08:05:21 PST
You will retain the option to keep encrypted mail encrypted on your hard drive.  However, if you don't enable this option, you need to remember that doing so means that you are probably likely to keep your old encryption keys lying around so you can read your own old mail. This will make things less secure for any messages that you decided to delete, since any wiretapper will be able to decode old stored messages should they overrun your computer.

I found that the lack of this feature made using encrypted email impractical. So much so, that I was one of the original people to request this feature. It wasn't until Snowden came along that people started taking this issue seriously.  (In my cynical moments I thought perhaps the NSA had contributed to the delay of this capability. For all I know they may still be contributing FUD to this very thread.)
Comment 52 Baturay Kaya 2014-05-07 14:10:02 PDT
Hello Everybody,

I have read this post and a couple related or similar bug posts and I thought maybe I can work on this bug. Before I start to work, I just wanted to ask if there is any progress?
Comment 53 Magnus Melin 2014-05-08 00:35:14 PDT
Feel free to work on it!
Comment 54 Baturay Kaya 2014-05-13 13:26:32 PDT
Guys I need help! Since we need to store mails decrypted, we need to find which function makes the decryption process. I've searched the source files of TB but I couldn't locate proper codes doing decryption. If you know something about this, then your help is needed!
Comment 55 Patrick Brunschwig 2014-05-18 11:31:49 PDT
Decryption is initiated by the MIME parser.

S/MIME:
See http://mxr.mozilla.org/comm-central/source/mailnews/mime/src/mimecryp.cpp  

PGP/MIME:
http://mxr.mozilla.org/comm-central/source/mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.cpp

Good luck!
Comment 56 Tilo Freiwald 2015-03-20 10:38:44 PDT
Thanks to Janosch Rux, Patrick Brunschwig and others a filter rule to decrypt messages permanently was added to Enigmail. Maybe that solves this bug here?

http://sourceforge.net/p/enigmail/bugs/1/
https://www.enigmail.net/download/changelog.php#enig1.8

Thank you so much!
Comment 57 Patrick Brunschwig 2015-03-21 03:06:52 PDT
Yes, I think so. The filter rules actually also work for S/MIME.
Comment 58 larrybird 2016-04-26 09:09:11 PDT
Late to comment on this.  I recently submitted a bug/request going the other way in regards copies of sent mail that are now saved in clear text (I feel that at the least there should be the option to save the local copy encrypted with the users smime cert) 

But I do agree with comments suggesting giving the user the option to save messages decrypted in a local folder is benefitial - it is their mail afterall. 

BTW - For those who use smartcards with pinpads, malware is not an issue (comments 45 and 46)

Note You need to log in before you can comment on or make changes to this bug.