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

Cannot connect to the crypto provider #3420

Closed
freeroute opened this issue May 31, 2018 · 30 comments
Closed

Cannot connect to the crypto provider #3420

freeroute opened this issue May 31, 2018 · 30 comments
Labels
type: bug Something is causing incorrect behavior or errors type: third-party integration Integration with external services or platforms.

Comments

@freeroute
Copy link

freeroute commented May 31, 2018

Expected behavior

Email should be sent successfully with using crypto provider (encrypted mail).

Actual behavior

When I try to send (encrypted or not encrpyted) a message I got a warning:
"Cannot connect to crypto provider, check your settings or click crypto icon to retry!"
Few weeks ago it was successfully installed and tested. Maybe a system update has broken it.
If encryption switched off on K-9 mail settings, mail sending works.

Steps to reproduce

  1. K-9 installed
  2. OpenKeyChain Easy PGP installed, keys tested

Environment

K-9 Mail version: 5.403
OpenKeyChain: Easy PGP: 5.0.2
Android version: 7.0
Account type (IMAP, POP3, WebDAV/Exchange): IMAP
mail service provider: gmail

@Dietmar01
Copy link

Same problem, have it since I switched to a newer smartphone. Android 7.0, K-9 & openkeychain latest versions each. Received encrypted emails are not shown, without any notice.

@violoncelloCH
Copy link

violoncelloCH commented Jun 2, 2018

Workaround is to manually start the cryptoprovider (OpenKeyChain), then reopen k9 and tap on the lock sign, then sending works for me...
The problem is the operating system preventing openkeychain to start automatically or being startet by k9

@freeroute
Copy link
Author

This workaround not working for me. Are there any solution to send/read encrypted mails?

@ntruchsess
Copy link

cannot use the workaround either.
using latest K9 Version 5.600, OpenKeyChain Version 5.2
regardless of whether OKC is running or not when clicking on the lock I get same error.
Also in in configuration I cannot select a Key - I can configure OpenKeyChain as Crypto-provieder in global settings but when klicking on the select-key in account crypto-setting it just does nothing.
Android Version is 7.1.1

on my other phone (Android 6.0.1, same version of K9 and OKC) all works fine.

@mikelygee
Copy link

I have the same experience as ntruchsess.

Phone: Meizu M6 Note (model M721H)
Android Version: 7.1.2
Android Security Patch Date: 1 October 2018
Build number: Flyme 7.1.0.0G

I followed the instructions for generating a debug log, but it comes up empty--happy to try again if anyone wants to help me troubleshoot that process (I can get a log file, but no k9 entries appear).

@cketti cketti added type: bug Something is causing incorrect behavior or errors type: third-party integration Integration with external services or platforms. labels Mar 8, 2019
@xurizaemon
Copy link

xurizaemon commented Jun 9, 2019

I'm seeing this also. Logs below.

  • Android 9 (OnePlus 5, OxygenOS 9.0.5)
  • K9 Mail 5.600 via fDroid
  • OpenKeychain 5.2 also via fDroid
  • Happy to try Google Play versions if you want a cross-check (but I was seeing this issue with them also, and switched to fDroid to see if it helped).
  • I used instructions at https://k9mail.github.io/documentation/debugging.html to obtain logs below.
  • After capturing the below logs, I confirmed behaviour after rebooting and repeating; it seems if I start K9 mail first, it can't find the crypto provider, but if I then start OpenKeychain then return to K9 and compose a new email, encryption now works.

Here's logs of trying and failing to have K9 initiate OpenKeychain service:

--------- beginning of main
06-09 18:50:05.806  6223  6223 E com.fsck.k9: Not starting debugger since process cannot load the jdwp agent.
06-09 18:50:05.852  6223  6243 I com.fsck.k9: The ClassLoaderContext is a special shared library.
06-09 18:50:05.862  6223  6243 I com.fsck.k9: The ClassLoaderContext is a special shared library.
06-09 18:50:05.940  6223  6223 D Embryo  : preload com.fsck.k9, 31ms, hwui=true, layout=true, decor=false
06-09 18:50:05.945  6223  6267 D OpenGLRenderer: Skia GL Pipeline
06-09 18:50:19.303  6223  6223 I Perf    : Connecting to perf service.
06-09 18:50:19.398  6223  6223 W ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@bb688be
06-09 18:50:19.419  6223  7470 D NetworkSecurityConfig: No Network Security Config specified, using platform default
06-09 18:50:19.450  6223  6267 I Adreno  : QUALCOMM build                   : 4c638fb, I557c585805
06-09 18:50:19.450  6223  6267 I Adreno  : Build Date                       : 10/06/18
06-09 18:50:19.450  6223  6267 I Adreno  : OpenGL ES Shader Compiler Version: EV031.25.03.01
06-09 18:50:19.450  6223  6267 I Adreno  : Local Branch                     : 
06-09 18:50:19.450  6223  6267 I Adreno  : Remote Branch                    : 
06-09 18:50:19.450  6223  6267 I Adreno  : Remote Branch                    : 
06-09 18:50:19.450  6223  6267 I Adreno  : Reconstruct Branch               : 
06-09 18:50:19.450  6223  6267 I Adreno  : Build Config                     : S L 6.0.7 AArch64
06-09 18:50:19.453  6223  6267 I Adreno  : PFP: 0x005ff112, ME: 0x005ff066
06-09 18:50:19.456  6223  6267 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
06-09 18:50:19.456  6223  6267 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
06-09 18:50:19.456  6223  6267 I OpenGLRenderer: Initialized EGL, version 1.4
06-09 18:50:19.456  6223  6267 D OpenGLRenderer: Swap behavior 2
06-09 18:50:21.081  6223  6223 W ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@5af889
06-09 18:50:24.966  6223  6223 W ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@723542a
06-09 18:50:38.180  6223  6223 I StorageEditor: Committing preference changes
06-09 18:50:38.193  6223  6223 I StorageEditor: Preferences commit took 13 ms
06-09 18:50:42.716  6223  6223 W InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed.
06-09 18:50:43.738  6223  6223 I StorageEditor: Committing preference changes
06-09 18:50:43.746  6223  6223 I StorageEditor: Preferences commit took 8 ms
06-09 18:50:45.970  6223  6223 W ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@6fc0533
06-09 18:50:45.993  6223  6223 I WebViewFactory: Loading com.android.chrome version 74.0.3729.157 (code 372915752)
06-09 18:50:46.021  6223  6223 I cr_LibraryLoader: Time to load native libraries: 3 ms (timestamps 2213-2216)
06-09 18:50:46.032  6223  6223 I chromium: [INFO:library_loader_hooks.cc(50)] Chromium logging enabled: level = 0, default verbosity = 0
06-09 18:50:46.032  6223  6223 I cr_LibraryLoader: Expected native library version number "74.0.3729.157", actual native library version number "74.0.3729.157"
06-09 18:50:46.040  6223  7719 W cr_ChildProcLH: Create a new ChildConnectionAllocator with package name = com.android.chrome, sandboxed = true
06-09 18:50:46.046  6223  6223 I cr_BrowserStartup: Initializing chromium process, singleProcess=false
06-09 18:50:46.116  6223  6223 E RecipientPresenter: error connecting to crypto provider!
06-09 18:50:46.116  6223  6223 E RecipientPresenter: java.lang.Exception: bindService() returned false!
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at org.openintents.openpgp.util.OpenPgpServiceConnection.bindToService(OpenPgpServiceConnection.java:105)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at com.fsck.k9.activity.compose.RecipientPresenter.cryptoProviderBindOrCheckPermission(RecipientPresenter.java:761)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at com.fsck.k9.activity.compose.RecipientPresenter.setupCryptoProvider(RecipientPresenter.java:748)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at com.fsck.k9.activity.compose.RecipientPresenter.onSwitchAccount(RecipientPresenter.java:314)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at com.fsck.k9.activity.compose.RecipientPresenter.<init>(RecipientPresenter.java:111)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at com.fsck.k9.activity.MessageCompose.onCreate(MessageCompose.java:288)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at android.app.Activity.performCreate(Activity.java:7149)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at android.app.Activity.performCreate(Activity.java:7140)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1288)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3017)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3172)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1906)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at android.os.Handler.dispatchMessage(Handler.java:106)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at android.os.Looper.loop(Looper.java:193)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at android.app.ActivityThread.main(ActivityThread.java:6863)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at java.lang.reflect.Method.invoke(Native Method)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
06-09 18:50:46.116  6223  6223 E RecipientPresenter: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
06-09 18:50:46.193  6223  6223 I AssistStructure: Flattened final assist data: 7656 bytes, containing 1 windows, 26 views
--------- beginning of system
06-09 18:50:57.694  6223  7765 E ActivityThread: Failed to find provider info for org.sufficientlysecure.keychain.provider.exported
06-09 18:50:57.696  6223  7765 E ActivityThread: Failed to find provider info for org.sufficientlysecure.keychain.provider.exported
06-09 18:50:57.909  6223  7764 E ActivityThread: Failed to find provider info for org.sufficientlysecure.keychain.provider.exported
06-09 18:50:57.911  6223  7764 E ActivityThread: Failed to find provider info for org.sufficientlysecure.keychain.provider.exported
06-09 18:50:58.092  6223  7478 E ActivityThread: Failed to find provider info for org.sufficientlysecure.keychain.provider.exported
06-09 18:50:58.093  6223  7478 E ActivityThread: Failed to find provider info for org.sufficientlysecure.keychain.provider.exported
06-09 18:50:58.334  6223  7492 E ActivityThread: Failed to find provider info for org.sufficientlysecure.keychain.provider.exported
06-09 18:50:58.335  6223  7492 E ActivityThread: Failed to find provider info for org.sufficientlysecure.keychain.provider.exported
06-09 18:51:00.292  6223  6223 I AssistStructure: Flattened final assist data: 7664 bytes, containing 1 windows, 26 views
06-09 18:51:02.747  6223  6223 I AssistStructure: Flattened final assist data: 7680 bytes, containing 1 windows, 26 views
06-09 18:51:05.281  6223  6223 E RecipientPresenter: error connecting to crypto provider!
06-09 18:51:05.281  6223  6223 E RecipientPresenter: java.lang.Exception: bindService() returned false!
06-09 18:51:05.281  6223  6223 E RecipientPresenter: 	at org.openintents.openpgp.util.OpenPgpServiceConnection.bindToService(OpenPgpServiceConnection.java:105)
06-09 18:51:05.281  6223  6223 E RecipientPresenter: 	at com.fsck.k9.activity.compose.RecipientPresenter.cryptoProviderBindOrCheckPermission(RecipientPresenter.java:761)
06-09 18:51:05.281  6223  6223 E RecipientPresenter: 	at com.fsck.k9.activity.compose.RecipientPresenter.onClickCryptoStatus(RecipientPresenter.java:662)
06-09 18:51:05.281  6223  6223 E RecipientPresenter: 	at com.fsck.k9.activity.compose.RecipientMvpView.onClick(RecipientMvpView.java:402)
06-09 18:51:05.281  6223  6223 E RecipientPresenter: 	at android.view.View.performClick(View.java:6669)
06-09 18:51:05.281  6223  6223 E RecipientPresenter: 	at android.view.View.performClickInternal(View.java:6638)
06-09 18:51:05.281  6223  6223 E RecipientPresenter: 	at android.view.View.access$3100(View.java:789)
06-09 18:51:05.281  6223  6223 E RecipientPresenter: 	at android.view.View$PerformClick.run(View.java:26145)
06-09 18:51:05.281  6223  6223 E RecipientPresenter: 	at android.os.Handler.handleCallback(Handler.java:873)
06-09 18:51:05.281  6223  6223 E RecipientPresenter: 	at android.os.Handler.dispatchMessage(Handler.java:99)
06-09 18:51:05.281  6223  6223 E RecipientPresenter: 	at android.os.Looper.loop(Looper.java:193)
06-09 18:51:05.281  6223  6223 E RecipientPresenter: 	at android.app.ActivityThread.main(ActivityThread.java:6863)
06-09 18:51:05.281  6223  6223 E RecipientPresenter: 	at java.lang.reflect.Method.invoke(Native Method)
06-09 18:51:05.281  6223  6223 E RecipientPresenter: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
06-09 18:51:05.281  6223  6223 E RecipientPresenter: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

If I manually open OpenKeychain and select my key before using K9 to compose a message, the crypto provider works (at least for this test).

06-09 19:05:01.648  9308  9308 W ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@6deb931
06-09 19:05:01.721  9308  9308 I AssistStructure: Flattened final assist data: 7440 bytes, containing 1 windows, 25 views
06-09 19:05:06.192  9308  9308 I AssistStructure: Flattened final assist data: 7664 bytes, containing 1 windows, 26 views
06-09 19:05:08.495  9308  9331 I MessagingController: Running command 'getFolderUnread:Chris Burgess:INBOX', seq = 11 (foreground priority)
06-09 19:05:08.498  9308  9331 I MessagingController:  Command 'getFolderUnread:Chris Burgess:INBOX' completed
06-09 19:05:08.529  9308  9502 V LockableDatabase: LockableDatabase: Transaction ended, took 1 ms / com.fsck.k9.mailstore.LocalFolder.appendMessages(LocalFolder.java:1285)
06-09 19:05:08.532  9308  9502 V LockableDatabase: LockableDatabase: Transaction ended, took 0 ms / com.fsck.k9.mailstore.LocalMessage.setFlag(LocalMessage.java:257)
06-09 19:05:08.540  9308  9331 I MessagingController: Running command 'sendPendingMessages', seq = 12 (background priority)
06-09 19:05:08.543  9308  9331 D LocalMessage: No headers available for this message!
06-09 19:05:08.543  9308  9331 D LocalMessage: No headers available for this message!
06-09 19:05:08.545  9308  9331 I MessagingController: Scanning folder 'K9MAIL_INTERNAL_OUTBOX' (11) for messages to send
06-09 19:05:08.545  9308  9331 I MessagingController: Send count for message K9LOCAL:12f0bd36-dc5f-4026-b097-a82e3f3bbf9c is 0
06-09 19:05:08.546  9308  9331 V LockableDatabase: LockableDatabase: Transaction ended, took 0 ms / com.fsck.k9.mailstore.LocalMessage.setFlag(LocalMessage.java:257)
06-09 19:05:08.548  9308  9331 I MessagingController: Sending message with UID K9LOCAL:12f0bd36-dc5f-4026-b097-a82e3f3bbf9c
06-09 19:05:08.548  9308  9331 D SmtpTransport: SMTP >>> QUIT
06-09 19:05:08.795  9308  9331 D SmtpTransport: SMTP <<< 220 prod-mail1.example.org ESMTP Postfix
06-09 19:05:08.817  9308  9331 D SmtpTransport: SMTP >>> EHLO [IPv6:f00f:f00f:f00f:f00f:f00f:f00f:f00f:f00f]
06-09 19:05:08.847  9308  9331 D SmtpTransport: SMTP <<< 250-prod-mail1.example.org
06-09 19:05:08.847  9308  9331 D SmtpTransport: SMTP <<< 250-PIPELINING
06-09 19:05:08.848  9308  9331 D SmtpTransport: SMTP <<< 250-SIZE 52428800
06-09 19:05:08.849  9308  9331 D SmtpTransport: SMTP <<< 250-VRFY
06-09 19:05:08.849  9308  9331 D SmtpTransport: SMTP <<< 250-ETRN
06-09 19:05:08.849  9308  9331 D SmtpTransport: SMTP <<< 250-AUTH PLAIN
06-09 19:05:08.849  9308  9331 D SmtpTransport: SMTP <<< 250-AUTH=PLAIN
06-09 19:05:08.850  9308  9331 D SmtpTransport: SMTP <<< 250-ENHANCEDSTATUSCODES
06-09 19:05:08.850  9308  9331 D SmtpTransport: SMTP <<< 250-8BITMIME
06-09 19:05:08.850  9308  9331 D SmtpTransport: SMTP <<< 250-DSN
06-09 19:05:08.850  9308  9331 D SmtpTransport: SMTP <<< 250 SMTPUTF8
06-09 19:05:08.851  9308  9331 D SmtpTransport: SMTP >>> *sensitive*
06-09 19:05:08.890  9308  9331 D SmtpTransport: SMTP <<< 235 2.7.0 Authentication successful
06-09 19:05:08.890  9308  9331 D SmtpTransport: SMTP >>> MAIL FROM:<chris.burgess@example.org> BODY=8BITMIME
06-09 19:05:08.891  9308  9331 D SmtpTransport: SMTP >>> RCPT TO:<chris.burgess@example.org>
06-09 19:05:08.892  9308  9331 D SmtpTransport: SMTP >>> DATA
06-09 19:05:08.919  9308  9331 D SmtpTransport: SMTP <<< 250 2.1.0 Ok
06-09 19:05:08.950  9308  9331 D SmtpTransport: SMTP <<< 250 2.1.5 Ok
06-09 19:05:09.014  9308  9331 D SmtpTransport: SMTP <<< 354 End data with <CR><LF>.<CR><LF>
06-09 19:05:09.017  9308  9331 D SmtpTransport: SMTP >>> .
06-09 19:05:09.147  9308  9331 D SmtpTransport: SMTP <<< 250 2.0.0 Ok: queued as D27498105C
06-09 19:05:09.147  9308  9331 D SmtpTransport: SMTP >>> QUIT
06-09 19:05:09.177  9308  9331 D SmtpTransport: SMTP <<< 221 2.0.0 Bye
06-09 19:05:09.178  9308  9331 V LockableDatabase: LockableDatabase: Transaction ended, took 0 ms / com.fsck.k9.mailstore.LocalMessage.setFlag(LocalMessage.java:257)
06-09 19:05:09.181  9308  9331 V LockableDatabase: LockableDatabase: Transaction ended, took 0 ms / com.fsck.k9.mailstore.LocalMessage.setFlag(LocalMessage.java:257)
06-09 19:05:09.183  9308  9331 I MessagingController: Moving sent message to folder 'Sent' (-1)
06-09 19:05:09.186  9308  9331 D LocalFolder: Updating folder_id to 8 for message with UID K9LOCAL:12f0bd36-dc5f-4026-b097-a82e3f3bbf9c, id 896 currently in folder K9MAIL_INTERNAL_OUTBOX
06-09 19:05:09.191  9308  9331 I MessagingController: Moved sent message to folder 'Sent' (8)
06-09 19:05:09.196  9308  9331 V LockableDatabase: LockableDatabase: Transaction ended, took 0 ms / com.fsck.k9.mailstore.LocalFolder.destroyMessage(LocalFolder.java:1874)
06-09 19:05:09.204  9308  9331 V LockableDatabase: LockableDatabase: Transaction ended, took 1 ms / com.fsck.k9.mailstore.LocalFolder.destroyMessage(LocalFolder.java:1874)
06-09 19:05:09.206  9308  9331 I MessagingController:  Command 'sendPendingMessages' completed

@cmaion
Copy link

cmaion commented Jun 14, 2019

Hey,

Same issue on my OnePlus too (both on Android 8 & 9), I have to start OpenKeyChain manually before being able to open/write an encrypted email.

It looks like I have just solved by... turning battery optimisation for OpenKeyChain OFF!

@xurizaemon
Copy link

That seems to work for me too!

Settings > Apps & Notifications > Special App Access > Battery Optimisation > OpenKeychain > "Don't Optimize"

Nice find :)

@LunaticTazz
Copy link

Battery optimization does not do the trick for me on my Lenovo Tab P10.
It could have something to do with the Update to Android 9 recently, but I just can't select a key from K9Mail. Clicking on "My Key" just doesn't forward to OpenKeyChain, even after opening OpenKeyChain in the background and turning battery optimization off.

@dsgiigh
Copy link

dsgiigh commented Dec 2, 2019

Battery optimization doesn't work for me, either. (Pixel 3aXL, Android 10.

@rol1
Copy link

rol1 commented Jan 7, 2020

I changed the battery/energy settings as described above, which didn't do the job. I also set openkeychain to autostart.
Then I started the "Security" App on my Xiaomi Redmi Note 8 Pro (Miui global 11.0.3/Android 9) and had a look at the "additional" permissions. After enabling "show popups while running in Background" the problem was solved. Now connection to the encryption service is available, and I can choose which key I want to use for my accounts.

Battery settings was not enough on my device, if the autostart is really necessary, I don't know.

@axel22
Copy link

axel22 commented Mar 14, 2020

I was able to solve this problem in Unihertz Titan phone by going into Settings -> Intelligent Assistance -> App Blocker, and selecting OpenKeychain, and disabling the Start blocker option. This apparently enabled K9 mail to launch OpenKeychain, and I can now encrypt.

It's possible that phone-specific app blockers may be preventing K9 mail from launching other apps such as OpenKeychain, or may be preventing OpenKeychain from being launched by other apps such as K9 mail.

@luisriverag
Copy link

Battery optimization doesn't work for me, either. (Pixel 3aXL, Android 10.

Doesn't work for me either on Xiaomi Poco F1 MIU 11.0.4 Android 10 QKQ1

@luisriverag
Copy link

I changed the battery/energy settings as described above, which didn't do the job. I also set openkeychain to autostart.
Then I started the "Security" App on my Xiaomi Redmi Note 8 Pro (Miui global 11.0.3/Android 9) and had a look at the "additional" permissions. After enabling "show popups while running in Background" the problem was solved. Now connection to the encryption service is available, and I can choose which key I want to use for my accounts.

Battery settings was not enough on my device, if the autostart is really necessary, I don't know.

Autostart didnt work for me, but "show popups while running in Background" did. Xiaomi PF1 MIUI 11.0.4

@tjoriss
Copy link

tjoriss commented Jul 10, 2020

I changed the battery/energy settings as described above, which didn't do the job. I also set openkeychain to autostart.
Then I started the "Security" App on my Xiaomi Redmi Note 8 Pro (Miui global 11.0.3/Android 9) and had a look at the "additional" permissions. After enabling "show popups while running in Background" the problem was solved. Now connection to the encryption service is available, and I can choose which key I want to use for my accounts.
Battery settings was not enough on my device, if the autostart is really necessary, I don't know.

Autostart didnt work for me, but "show popups while running in Background" did. Xiaomi PF1 MIUI 11.0.4

it seems that the request for accessing the crypto-excange-part from within k9mail to open easy-key-chain is handled via a pop-up that needs to start in backround and then switches to foreground.

tested with redmi note4 , note 7 and note 9s. k9 mail works now on everyone of them.

@cketti
Copy link
Member

cketti commented Oct 6, 2020

This seems to be similar to #2601. Closing this one as duplicate.

@cketti cketti closed this as completed Oct 6, 2020
@RigacciOrg
Copy link

I have the same problem on my smartphone. Manually starting OpenKeyChain does solve the problem, at least for that time.
On this Android I found a settings called DuraSpeed, which should preserve battery. If I add an exceptionto for this setting, i.e. selectively disable DuraSpeed for OpenKeyChain, the problem is solved.

  • Phone: Oukitel WP12
  • O.S.: Android 11
  • K-9 Mail 5.804 from F-Droid
  • OpenKeyChain 5.7.5 from F-Droid

@life777eternal
Copy link

life777eternal commented Sep 25, 2021

@cketti This is happening now when I try to reply to an email, when I hit the send button. There isn't even any "crypto" icon. The same toast message appears when I try to save the message.

K-9 Version 5.902
Android 10
OpenKeyChain Version 5.7.5 (57500)

obscura1632606820671

Also I just tried to download & install the latest version of K-9 Mail, though it's showing that the app was not installed.

obscura1632608232422_1

@life777eternal
Copy link

@cketti This is still happening on v. 5.904 and it's been getting annoying. I hit reply all on an email, write what I need to say to the person and remove a few things from my signature that I haven't changed yet in the settings and then I can't send the email, not even save it. I have to copy the text that I've entered, discard the new email, then hit reply all again and then paste in my text. Remove a few things from my signature and send it again.

obscura1637684872638

@cketti
Copy link
Member

cketti commented Nov 24, 2021

@life777eternal: Not being able to connect to OpenKeychain is not a bug in K-9 Mail. Your Android version is preventing K-9 Mail from talking to OpenKeychain. Often there's a way to prevent the OS from sending an app into a standby mode when it wasn't used for a while (see other comments in this thread).

We could change K-9 Mail to simply not use the configured crypto provider when the app can't connect to it. But that could lead to messages that usually would be encrypted to be sent unencrypted. So I'd rather not make this change.

Since the crypto provider isn't working for you anyway, you might as well disable OpenPGP support. That way you will avoid the error message and can reply to messages.

Our long-term goal is to integrate at least Autocrypt functionality in K-9 Mail. That will avoid this whole "not allowed to talk to other app" scenario.

@life777eternal
Copy link

life777eternal commented Jan 18, 2022

@cketti Thanks for your reply, I've been having that issue again recently, although it didn't appear after I opened OpenKeyChain manually. Also what is "Autocrypt" ? I hadn't heard of that one before. Thank you. Also there isn't actually any "crypto icon" as it mentions in the toast message.

@pchampin
Copy link

pchampin commented Feb 25, 2022

I have the same problem, and like @life777eternal I don''t have any 'crypto icon' .

Notice that I have several accounts with exactly the same crypto config (inc. same key) and switching to a different account usually solves the problem.

So the problem does not seem to be caused by OpenKeyChain...

@jcperil
Copy link

jcperil commented Jul 5, 2022

What is the update on this issue?

@entepe85
Copy link

entepe85 commented Aug 7, 2022

I'm having the same issue. Curiously, Fairmail (by M66B) doesn't show this behaviour, although it uses OpenKeychain (if installed) for encryption as well.

@nker150
Copy link

nker150 commented Oct 9, 2022

Same issue here, I don't even have OpenKeyChain installed. Encryption is turned off in the K-9 Mail settings. I currently have no way to send email through the app.

@pchampin
Copy link

quick update: the problem still occurs to me every once in a while (but much more rarely than before).

As I mentioned above, changing the 'sender' to a different account solves the problem. But what I discovered is that even selecting the current sender in the sender drop-down list does the trick!
(but I don't know how that works if you have only one account set up)

@rol1
Copy link

rol1 commented Jan 11, 2023

quick update: the problem still occurs to me every once in a while (but much more rarely than before).

As I mentioned above, changing the 'sender' to a different account solves the problem. But what I discovered is that even selecting the current sender in the sender drop-down list does the trick! (but I don't know how that works if you have only one account set up)

same for me

@Bapf
Copy link

Bapf commented Apr 13, 2023

Same for me.
Happens about once a month. (Android 12).

Workaround that always works is disabling encryption in Account Settings, the enabling and selecting my key again.
Caveat with this workaround is that you can't save the message you're composing as draft without the active encryption, means you have to copy it beforehand if you don't wan't to type it again.

@Oclair
Copy link

Oclair commented May 23, 2023

Please re open, this issue remain active with current versions of all formentioned apps. Have a nice day

@williamdes
Copy link

Please re open, this issue remain active with current versions of all formentioned apps. Have a nice day

Fix released in pre-release: https://github.com/thundernest/k-9/releases/tag/6.704

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something is causing incorrect behavior or errors type: third-party integration Integration with external services or platforms.
Projects
None yet
Development

No branches or pull requests