Page 1 of 2

K-9 Mail Received Trigger Not Working

Posted: 06 Feb 2016 00:45
by lueq
I am trying to create a flow with the trigger K-9 Mail Received, but the trigger doesn't work at all.
The trigger itself doesn't have any conditions. I added a debug condition after it, but nothing gets triggered when K-9 receives a new email.

Device: Galaxy S5 on Lollipop 5.1.1, LMY47X, rooted.
Newest version of AM Premium.
I do have the XPosed network and XPrivacy installed, but I didn't find anything blocked, neither for Automagic, nor for K-9, nor for anything else that could be related. Are there any other system components that could prevent this from functioning even though nothing shows up as blocked in the XPrivacy log?
Of course nothing shows up in the AM log as the flow doesn't get triggered.

Does it matter that the email accounts in K-9 are IMAP and not POP3? The new mail indicator in Android works normally.

I was able to create some flows with different functionality, so AM in general does work.

Thanks for any help you can provide with this.

Re: K-9 Mail Received Trigger Not Working

Posted: 07 Feb 2016 19:35
by Martin
Hi,

The trigger still works on my test device but I only tested with imap. I would be surprised if imap/pop makes a difference.
Please ensure that all All are selected in the trigger. If it still fails, enable Debug Log in the preferences of Automagic, send a mail to yourself, wait a few minutes until K-9 synced the mails and then send the log to me (menu->Manage->Log, menu->Send log).

Thanks & Regards,
Martin

Re: K-9 Mail Received Trigger Not Working

Posted: 08 Feb 2016 05:10
by lueq
Hi Martin,

thanks for the response.
I use imap for my accounts, too, so that can't be the issue.

I had tried your suggestion several times before and tried it again now, including the logging.
Nothing shows up in the log, so the trigger is not triggered when K-9 receives an email.
Both Account List and Sender List are set to All. The device shows new mail notifications.

I also checked my XPrivacy logs and couldn't see anything related blocked in there.
Does the trigger functionality depend on any other modules besides K-9 Mail and Automagic which could be affected by XPrivacy?

Thanks!

Re: K-9 Mail Received Trigger Not Working

Posted: 08 Feb 2016 20:06
by Martin
Hi,

I'm out of ideas. To my knowledge there's no setting within k-9 that affects this feature. Maybe try to uninstall/reinstall K-9 to see if this helps.
Are you using the official K-9 app and Automagic app from Google Play or are you using some modified versions or beta versions?

I'm not using XPrivacy on my own but such apps can have strange side effects. Please search the settings of XPrivacy if there's a setting that could prevent broadcasts from working between apps.

If you don't find any setting, you could try to switch to trigger Notification on Statusbar displayed to detect the new mail in K-9, however it will be less comfortable to extract the subject etc.

Regards,
Martin

Re: K-9 Mail Received Trigger Not Working

Posted: 08 Feb 2016 22:54
by lueq
Thanks, Martin!

I am using the official K-9 and Automagic from Google Play, no modified versions.

You mentioned something about broadcasts, can you explain that a bit more, as I am not familiar with the internal workings of Android?
Does K-9 send a broadcast when it receives new mails and Automagic receives it?
Are there any other system components involved in the process?
Is there any place where I could read up on the details involved?

I wouldn't be surprised if XPrivacy blocks it in some kind of way (even though I don't find any hints in its logs), but I am not ready to give up on it, I would rather try to find the specific setting that might cause it.

Re: K-9 Mail Received Trigger Not Working

Posted: 09 Feb 2016 19:57
by Martin
Sending a broadcast intent is one of the ways to let components of an app communicate with other components (of the same app or of different apps). A broadcast is usually used by an app or the system to let multiple receivers know that something happened or changed. Android uses this method very often internally, for example to let know apps when the battery percentage changed or when the WiFi signal strength changes etc.
K-9 sends such a broadcast to let all interested apps know about a new mail. Automagic registers itself in the system to be informed when such a broadcast is sent. XPrivacy or Xposed modules could intercept or block such broadcasts

Please enable Enable debug logging in K-9->Menu->Settings->Global Settings->Debugging, send a mail to your account and watch the Android system log for a text like this:
Broadcasted: action=com.fsck.k9.intent.action.EMAIL_RECEIVED
Do you see this text?

You can also use system settings->Developer options->Take bug report and send the generated report to me so I can check if I see anything suspicious.

Re: K-9 Mail Received Trigger Not Working

Posted: 10 Feb 2016 07:12
by MURTUMA
Xprivacy doesn't block broadcasts as far as I know. There are some Xposed mods which do just that, so check those if you have any.

Re: K-9 Mail Received Trigger Not Working

Posted: 17 Feb 2016 23:34
by lueq
I have finally had a look at the log.

There is no broadcast of something like com.fsck.k9.intent.action.EMAIL_RECEIVED

But there are some errors when emails are received which probably cause the issue. But I don't know how to interpret them.
Here is a relevant excerpt from the log:

Code: Select all

02-17 12:47:47.039 27868 27896 I k9      : Next check for package com.fsck.k9 scheduled for Wed Feb 17 12:51:22 MST 2016
02-17 12:47:47.039 27868 27896 I k9      : BootReceiver Got request to schedule alarmedIntent com.fsck.k9.intent.action.MAIL_SERVICE_WAKEUP
02-17 12:47:47.219  1082  1117 I Timeline: Timeline: Activity_windows_visible id: ActivityRecord{297c1a45 u0 com.fsck.k9/.activity.Accounts t269} time:200372977
02-17 12:47:47.269 27868 27868 I k9      : CoreReceiver.onReceiveIntent { act=com.fsck.k9.service.BroadcastReceiver.scheduleIntent flg=0x10 cmp=com.fsck.k9/.service.BootReceiver (has extras) }
02-17 12:47:47.269 27868 27868 I k9      : BootReceiver.onReceiveIntent { act=com.fsck.k9.service.BroadcastReceiver.scheduleIntent flg=0x10 cmp=com.fsck.k9/.service.BootReceiver (has extras) }
02-17 12:47:47.269 27868 27868 I k9      : BootReceiver Scheduling intent Intent { act=com.fsck.k9.intent.action.MAIL_SERVICE_WAKEUP cmp=com.fsck.k9/.service.MailService } for Wed Feb 17 12:51:22 MST 2016
02-17 12:47:47.279 27868 27868 I k9      : CoreService: com.fsck.k9.service.PushService.onCreate()
02-17 12:47:47.289 27868 27868 I k9      : CoreService: com.fsck.k9.service.PushService.onStart(Intent { act=com.fsck.k9.service.PushService.stopService cmp=com.fsck.k9/.service.PushService (has extras) }, 1)
02-17 12:47:47.289 27868 27868 I k9      : CoreService: com.fsck.k9.service.MailService.onDestroy()
02-17 12:47:47.339 27868 27868 I k9      : CoreService: com.fsck.k9.service.PushService.onDestroy()
02-17 12:47:52.819  1082  1115 I ActivityManager: Skip updateThumbnail for r=ActivityRecord{297c1a45 u0 com.fsck.k9/.activity.Accounts t269}
02-17 12:47:53.979  1403  1403 W PackageManager: Failure retrieving resources for com.fsck.k9: Resource ID #0x0
02-17 12:50:15.559  1627  1627 I Timeline: Timeline: Activity_launch_request id:com.fsck.k9 time:200521319
02-17 12:50:16.559  1082  1117 I Timeline: Timeline: Activity_windows_visible id: ActivityRecord{297c1a45 u0 com.fsck.k9/.activity.Accounts t269} time:200522318
02-17 12:50:18.939 27868 27868 I Timeline: Timeline: Activity_launch_request id:com.fsck.k9 time:200524697
02-17 12:50:18.969  1082  1455 E Parcel  : Class not found when unmarshalling: com.fsck.k9.search.LocalSearch
02-17 12:50:18.969  1082  1455 E Parcel  : java.lang.ClassNotFoundException: com.fsck.k9.search.LocalSearch
02-17 12:50:18.969  1082  1455 E Parcel  : Caused by: java.lang.ClassNotFoundException: Didn't find class "com.fsck.k9.search.LocalSearch" on path: DexPathList[[zip file "/system/framework/XposedBridge.jar"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
02-17 12:50:18.969  1082  1455 E Parcel  : 	Suppressed: java.lang.ClassNotFoundException: com.fsck.k9.search.LocalSearch
2-17 12:50:18.989  1082  1455 I ActivityManager: Skip updateThumbnail for r=ActivityRecord{297c1a45 u0 com.fsck.k9/.activity.Accounts t269}
02-17 12:50:19.729  1082  1117 I Timeline: Tim02-17 12:47:47.039 27868 27896 I k9      : Next check for package com.fsck.k9 scheduled for Wed Feb 17 12:51:22 MST 2016
02-17 12:47:47.039 27868 27896 I k9      : BootReceiver Got request to schedule alarmedIntent com.fsck.k9.intent.action.MAIL_SERVICE_WAKEUP
02-17 12:47:47.219  1082  1117 I Timeline: Timeline: Activity_windows_visible id: ActivityRecord{297c1a45 u0 com.fsck.k9/.activity.Accounts t269} time:200372977
02-17 12:47:47.269 27868 27868 I k9      : CoreReceiver.onReceiveIntent { act=com.fsck.k9.service.BroadcastReceiver.scheduleIntent flg=0x10 cmp=com.fsck.k9/.service.BootReceiver (has extras) }
02-17 12:47:47.269 27868 27868 I k9      : BootReceiver.onReceiveIntent { act=com.fsck.k9.service.BroadcastReceiver.scheduleIntent flg=0x10 cmp=com.fsck.k9/.service.BootReceiver (has extras) }
02-17 12:47:47.269 27868 27868 I k9      : BootReceiver Scheduling intent Intent { act=com.fsck.k9.intent.action.MAIL_SERVICE_WAKEUP cmp=com.fsck.k9/.service.MailService } for Wed Feb 17 12:51:22 MST 2016
02-17 12:47:47.279 27868 27868 I k9      : CoreService: com.fsck.k9.service.PushService.onCreate()
02-17 12:47:47.289 27868 27868 I k9      : CoreService: com.fsck.k9.service.PushService.onStart(Intent { act=com.fsck.k9.service.PushService.stopService cmp=com.fsck.k9/.service.PushService (has extras) }, 1)
02-17 12:47:47.289 27868 27868 I k9      : CoreService: com.fsck.k9.service.MailService.onDestroy()
02-17 12:47:47.339 27868 27868 I k9      : CoreService: com.fsck.k9.service.PushService.onDestroy()
02-17 12:47:52.819  1082  1115 I ActivityManager: Skip updateThumbnail for r=ActivityRecord{297c1a45 u0 com.fsck.k9/.activity.Accounts t269}
02-17 12:47:53.979  1403  1403 W PackageManager: Failure retrieving resources for com.fsck.k9: Resource ID #0x0
02-17 12:50:15.559  1627  1627 I Timeline: Timeline: Activity_launch_request id:com.fsck.k9 time:200521319
02-17 12:50:16.559  1082  1117 I Timeline: Timeline: Activity_windows_visible id: ActivityRecord{297c1a45 u0 com.fsck.k9/.activity.Accounts t269} time:200522318
02-17 12:50:18.939 27868 27868 I Timeline: Timeline: Activity_launch_request id:com.fsck.k9 time:200524697
02-17 12:50:18.969  1082  1455 E Parcel  : Class not found when unmarshalling: com.fsck.k9.search.LocalSearch
02-17 12:50:18.969  1082  1455 E Parcel  : java.lang.ClassNotFoundException: com.fsck.k9.search.LocalSearch
02-17 12:50:18.969  1082  1455 E Parcel  : Caused by: java.lang.ClassNotFoundException: Didn't find class "com.fsck.k9.search.LocalSearch" on path: DexPathList[[zip file "/system/framework/XposedBridge.jar"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
02-17 12:50:18.969  1082  1455 E Parcel  : 	Suppressed: java.lang.ClassNotFoundException: com.fsck.k9.search.LocalSearch
02-17 12:50:18.989  1082  1455 I ActivityManager: Skip updateThumbnail for r=ActivityRecord{297c1a45 u0 com.fsck.k9/.activity.Accounts t269}
02-17 12:50:19.729  1082  1117 I Timeline: Timeline: Activity_windows_visible id: ActivityRecord{13e43184 u0 com.fsck.k9/.activity.MessageList t269} time:200525480
02-17 12:50:22.069  1403  1403 W PackageManager: Failure retrieving resources for com.fsck.k9: Resource ID #0x0
02-17 12:50:22.109  1082  1499 I ActivityManager: Skip updateThumbnail for r=ActivityRecord{13e43184 u0 com.fsck.k9/.activity.MessageList t269}
02-17 12:50:23.159  1403  1403 W PackageManager: Failure retrieving resources for com.fsck.k9: Resource ID #0x0
Thanks!

Re: K-9 Mail Received Trigger Not Working

Posted: 18 Feb 2016 20:42
by Martin
Maybe the errors cause a problem within K-9 and so it never gets the chance to send the broadcast. But that's just a guess. You could try to contact the developer of K-9, maybe he can confirm the issue.

Regards,
Martin

Re: K-9 Mail Received Trigger Not Working

Posted: 19 Feb 2016 04:04
by lueq
Thank you, Martin, I'll see where I can get with this information.