Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PGP/Mime support in K-9 #4

Closed
wants to merge 8 commits into from
Closed

Conversation

mpasch
Copy link

@mpasch mpasch commented Mar 8, 2011

Hey guys,

I'm working on PGP/Mime support in K-9 based on APG for the tarent company.

Since we'd like to see the code upstream, I wanted to ask for your opinion about this "patch".
You probably don't want to accept this request at this point, because of bugs 1) and 2) (see below).
I still would like to know what you think, cause I won't have much time to spend on this later.

I use the current version of APG in the android market. I'm working with an HTC Desire Z. (non-root android 2.2.1)

What's working (both send and receive)

  • encrypted mails, encrypted+signed mails (attachments are encrypted, too)

What's not working:

  • send/receive signed-only mails (you can still read them, but the signature is not checked)

Known Bugs:

  1. there is no warning that sending signed-only mails does not work (APG fails)

  2. because the whole email including attachments is sent to APG as an byte array, sending attachments >~500Kb fails (without error message). This needs to be replaced with passing it over using an Uri (content://), I would like to use the K-9 content-provider here, do you think that might work? (Is it saving the data as tempfile?, is that a security issue?)

  3. receiving attachments works with common attachment sizes you would except on a smartphone (so a 3-5MB file is no problem, my 16MB-testfile caused an endless loop)

  4. the PGP/Mime specification requires the following header:

Content-Type: multipart/encrypted; boundary="...."; protocol="application/pgp-encrypted"

due to the way K-9 stores messages in the local store the protocol value gets lost (I think this is a known problem in k-9)
Thunderbird, K-9, and Kontact do not care about the missing attribute, I haven't tested any other clients, so I hope this won't be a problem. (I think fixing this would require massive changes in K-9)

I think 5) and 6) are not related to my patch, if they are please let me know.

  1. if you're sending an attachment using OIFileManager, the full path is used as filename

  2. PGP/Inline sending does not work if you have HTML enabled, I think this is tracked in Issue 3051

Thank you very much for your thoughts!

I hope we can get PGP/Mime to work in K-9!!

Mattis Pasch

					(both with attachments)
		 receiving: PGP/Mime encrypted, encrypted+signed 
		 			(both with attachments)

not working: PGP/Mime signed only messages (both send and receive)
-toast-message that attachments are not supported ignored if
PGP/Mime-Checkbox is activated
-added toast-message for big encrypted messages (download first)
-moved pgp/mime-encryption check to Apg.java
private String mCharset = null;

// use UTF-8 as standard to prevent NullPointerExceptions
private String mCharset = "UTF-8";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were problems with NullPointerException and with german Umlauts in message titles (I know they're not allowed in the specifiation but they caused my K-9-Inbox to not work at all)

I don't know if this is related to PGP/Mime

@obra
Copy link
Contributor

obra commented Mar 8, 2011

Hi! I thing you're right that this isn't quite ready for merge yet. The best thing to do is to resend the text of your pull-request to the mailing list (signup at http://code.google.com/p/k9mail/ ) and we can chat about the right way forward from there. I'm going to be really happy to get this landed in K-9. All my GPG-using correspondents use pgp/mime :)

Unfortunately is requires a patched version of APG :(

Fixes:

- Sending of PGP/Mime encrpyted mails with sizes over 50Kb works
(7,5MB tested succesfully on HTC Desire Z)

-> this requried a new provider (SimpleFileProvider) and secure
tempfile deletion which is done in Apg.java (there are a few bugs in
APG which make this fail without patch)

- Deletion of temporary files in APG (unencrypted Data) (requires
APG-Patch, without the patch it just doesn't do it, everything still
works)

- added Toast if someone trys to send a PGP/Mime signed-only mail

- removed PGP/Mime verify button and added toast (cause verifying does
not work)


Known Bugs:

-there are no notification handling big encrypted mails (sizes over
the
tested 7,5MB)

-PGP/Mime encrypted messages sent by K9 miss the protocol attribute in
Content-Type header (which doesn't prevent any tested mail clients
from reading/decrypting it correctly)

- PGP/Mime signed-only mails do not work (send/receive) but there is a
message warning the user)
@mpasch
Copy link
Author

mpasch commented Mar 10, 2011

Sorry, I'm working with GitHub for the first time and I didn't realize the new commit would be added here...
The new commit will actually make things even more complicated, but resolves most of the problems.
It actually requires a small patch in APG
See APG-Issue on Google-Code:
http://code.google.com/p/android-privacy-guard/issues/detail?id=99

edit
The other APG-Patch is not required but fixes a problem with saving temporary files(they are never deleted)
http://code.google.com/p/android-privacy-guard/issues/detail?id=98

@mpasch
Copy link
Author

mpasch commented Mar 10, 2011

If you want to test the project:

https://evolvis.org/frs/?group_id=115

edit: english translation of release notes added

Forse-Close

- delete encrypted file in APG (if APG supports it...) 

- improved temp-file-deletion method (faster and more reliable)
@phoerious
Copy link

Sorry for digging this up, but what is the status of this? Having support for PGP/MIME in K-9 Mail would be very helpful. With the current version I'm not able to read PGP/MIME encrypted messages at all. It just says "no text" and shows the encrypted message as attachment (.asc) whose contents I have to copy to APG manually.

@obra obra mentioned this pull request Mar 23, 2012
@wridgers
Copy link

wridgers commented May 9, 2012

What is the status of this now?

@sesceu
Copy link

sesceu commented Jul 19, 2012

I'd be interested in the status as well? PGP/MIME would be really great!

@bbock
Copy link

bbock commented Jul 29, 2012

+1

@kiplingw
Copy link

kiplingw commented Nov 9, 2012

Thanks mpasch for the work you are doing.

@charlieamadeus
Copy link

Thank your for getting this project started, any updates?

@cyberpunkedu
Copy link

This is so great. Can't wait for PGP/MIME support. Thanks!

@cketti
Copy link
Member

cketti commented Mar 10, 2013

To be able to properly support PGP/MIME (and S/MIME) K-9 Mail has to change the way messages are stored in the local database. Currently information necessary to verify the integrity of a message is discarded. Until we change that every attempt at supporting PGP/MIME is a hack at best.

@h-2
Copy link

h-2 commented Jan 21, 2014

any news on this? PGP/Mime is, like, reeeally important!

Thanks!

@jhgg
Copy link

jhgg commented Feb 5, 2014

+1 on this too.

@webratte
Copy link

webratte commented May 4, 2014

There are News about PGP/MIME support?
I think i'ts a very important feature.

@cketti
Copy link
Member

cketti commented May 11, 2014

@Diapolo
Copy link

Diapolo commented May 19, 2015

What can be done to get this forward? We really need PGP/SMIME support for K9 to become perfectly usable!

@dschuermann
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.