st3fan/dovecot-xaps-plugin

Not working for some reason?

Closed this issue · 11 comments

Greetings!

I just set this up on my dovecot server. I have the certificate, and could do the openssl test just fine. I can see where my mailbox has the INBOX and notes folder show up in the json file, and I can see lines like this in the mail.log file :

2014-10-18 21:54:20-0500 [XAPSProtocol,57,] lineReceived: REGISTER aps-account-id="0A7C4DFD-3FC4-418D-B4FC-F6EE59603731" aps-device-token="3A1E4FBA6214E9DB210D15BAF10D5EE85ED217437B9BAC4AFACB8416AAD6E46D" aps-subtopic="com.apple.mobilemail" dovecot-username="ledoktre@meanie.us" dovecot-mailboxes=("INBOX","Notes")
2014-10-18 21:54:20-0500 [XAPSProtocol,57,] Command(name='REGISTER', args={'aps-account-id': '0A7C4DFD-3FC4-418D-B4FC-F6EE59603731', 'aps-device-token': '3A1E4FBA6214E9DB210D15BAF10D5EE85ED217437B9BAC4AFACB8416AAD6E46D', 'dovecot-mailboxes': ['INBOX', 'Notes'], 'dovecot-username': 'ledoktre@meanie.us', 'aps-subtopic': 'com.apple.mobilemail'})
2014-10-18 21:54:20-0500 [XAPSProtocol,57,] handleRegister: Command(name='REGISTER', args={'aps-account-id': '0A7C4DFD-3FC4-418D-B4FC-F6EE59603731', 'aps-device-token': '3A1E4FBA6214E9DB210D15BAF10D5EE85ED217437B9BAC4AFACB8416AAD6E46D', 'dovecot-mailboxes': ['INBOX', 'Notes'], 'dovecot-username': 'ledoktre@meanie.us', 'aps-subtopic': 'com.apple.mobilemail'})
2014-10-18 21:55:04-0500 [XAPSProtocol,58,] lineReceived: REGISTER aps-account-id="0A7C4DFD-3FC4-418D-B4FC-F6EE59603731" aps-device-token="3A1E4FBA6214E9DB210D15BAF10D5EE85ED217437B9BAC4AFACB8416AAD6E46D" aps-subtopic="com.apple.mobilemail" dovecot-username="ledoktre@meanie.us" dovecot-mailboxes=("INBOX","Notes")
2014-10-18 21:55:04-0500 [XAPSProtocol,58,] Command(name='REGISTER', args={'aps-account-id': '0A7C4DFD-3FC4-418D-B4FC-F6EE59603731', 'aps-device-token': '3A1E4FBA6214E9DB210D15BAF10D5EE85ED217437B9BAC4AFACB8416AAD6E46D', 'dovecot-mailboxes': ['INBOX', 'Notes'], 'dovecot-username': 'ledoktre@meanie.us', 'aps-subtopic': 'com.apple.mobilemail'})
2014-10-18 21:55:04-0500 [XAPSProtocol,58,] handleRegister: Command(name='REGISTER', args={'aps-account-id': '0A7C4DFD-3FC4-418D-B4FC-F6EE59603731', 'aps-device-token': '3A1E4FBA6214E9DB210D15BAF10D5EE85ED217437B9BAC4AFACB8416AAD6E46D', 'dovecot-mailboxes': ['INBOX', 'Notes'], 'dovecot-username': 'ledoktre@meanie.us', 'aps-subtopic': 'com.apple.mobilemail'})
2014-10-18 21:55:53-0500 [XAPSProtocol,59,] lineReceived: REGISTER aps-account-id="0A7C4DFD-3FC4-418D-B4FC-F6EE59603731" aps-device-token="3A1E4FBA6214E9DB210D15BAF10D5EE85ED217437B9BAC4AFACB8416AAD6E46D" aps-subtopic="com.apple.mobilemail" dovecot-username="ledoktre@meanie.us" dovecot-mailboxes=("INBOX","Notes")
2014-10-18 21:55:53-0500 [XAPSProtocol,59,] Command(name='REGISTER', args={'aps-account-id': '0A7C4DFD-3FC4-418D-B4FC-F6EE59603731', 'aps-device-token': '3A1E4FBA6214E9DB210D15BAF10D5EE85ED217437B9BAC4AFACB8416AAD6E46D', 'dovecot-mailboxes': ['INBOX', 'Notes'], 'dovecot-username': 'ledoktre@meanie.us', 'aps-subtopic': 'com.apple.mobilemail'})
2014-10-18 21:55:53-0500 [XAPSProtocol,59,] handleRegister: Command(name='REGISTER', args={'aps-account-id': '0A7C4DFD-3FC4-418D-B4FC-F6EE59603731', 'aps-device-token': '3A1E4FBA6214E9DB210D15BAF10D5EE85ED217437B9BAC4AFACB8416AAD6E46D', 'dovecot-mailboxes': ['INBOX', 'Notes'], 'dovecot-username': 'ledoktre@meanie.us', 'aps-subtopic': 'com.apple.mobilemail'})

When I send a message to this account, I see this in the log file :

2014-10-18 21:57:46-0500 [XAPSProtocol,60,] lineReceived: NOTIFY dovecot-username="ledoktre@meanie.us" dovecot-mailbox="INBOX"
2014-10-18 21:57:46-0500 [XAPSProtocol,60,] Command(name='NOTIFY', args={'dovecot-username': 'ledoktre@meanie.us', 'dovecot-mailbox': 'INBOX'})
2014-10-18 21:57:46-0500 [XAPSProtocol,60,] handleNotify: Command(name='NOTIFY', args={'dovecot-username': 'ledoktre@meanie.us', 'dovecot-mailbox': 'INBOX'})
2014-10-18 21:57:46-0500 [XAPSProtocol,60,] APNSClientFactory.queueNotification
2014-10-18 21:57:48-0500 [-] APNSProtocol.sendNotifications (1)

The "sendNotifications" line just above makes me think it should be working, yet I receive no notification on my iPhone. iPhone is set for push - not for fetch or manual.

Please help..

Thanks,

Tim

Also, worth noting, another account I have is setup as activesync, and it is alerting me just fine. Everything on the phone should be okay? Where do you start in figuring this out?

Thanks,

Here is from mail.log :

2014-10-18 22:11:31-0500 [XAPSProtocol,66,] lineReceived: NOTIFY dovecot-username="ledoktre@meanie.us" dovecot-mailbox="INBOX"
2014-10-18 22:11:31-0500 [XAPSProtocol,66,] Command(name='NOTIFY', args={'dovecot-username': 'ledoktre@meanie.us', 'dovecot-mailbox': 'INBOX'})
2014-10-18 22:11:31-0500 [XAPSProtocol,66,] handleNotify: Command(name='NOTIFY', args={'dovecot-username': 'ledoktre@meanie.us', 'dovecot-mailbox': 'INBOX'})
2014-10-18 22:11:31-0500 [XAPSProtocol,66,] APNSClientFactory.queueNotification
2014-10-18 22:11:33-0500 [-] APNSProtocol.sendNotifications (1)

Everything looks good. Are you sure your phone is configured to actually display the notifications?

If in doubt about the phone side of things, you can also temporarily disable and enable the email account in the settings. That seems to trigger a refresh of the phone's configuration.

Do you think this happened after upgrading to iOS 8?

Stefan,

I've only had iOS 8 since using this plugin. Myself, my wife, and a friend testing it out- all on 8...

The odd thing is after I submitted the request, some time later it started working. I was confused but happy.

Now, a few days later, it stopped again and on all 3 devices. Very confused!!

I have not yet tried restarting daemon, but if I did and it started working, that would concern me because I like to know "why". If I can't figure out why something started or stopped working, it makes my cynical assume it will happen again.

Help...

Thanks,


Tim Streit
Sent from my iPhone

On Oct 28, 2014, at 7:06 PM, Stefan Arentz notifications@github.com wrote:

Everything looks good. Are you sure your phone is configured to actually display the notifications?

If in doubt about the phone side of things, you can also temporarily disable and enable the email account in the settings. That seems to trigger a refresh of the phone's configuration.

Do you think this happened after upgrading to iOS 8?


Reply to this email directly or view it on GitHub.

I have two accounts on the same server. Both now work with Push on my iPad, but one of them still was on Load on my iPhone, and disabling/reenabling didn't fix it. It wouldn't offer Push, only Load and Manual.

I then tried deleting the account and recreating it, and now this one has Push, too. I think there may simply be a bug in iOS (one among many).

Yeah, switching existing accounts to Push will confuse iOS. I think I ran unto the same issue.

Regarding restarting the daemon ... I will add more diagnostic logging to the daemon and the plugin so that it is easier to find out why it fails for you. There may still be an issue.

Hi. It seems like I have a similar problem. I'm running iOS 8 on both my iPad and iPhone. It works flawlessly on the iPad, but I can't get it working on the iPhone.

According to the log it notifies both devices but only the iPad receives the notification (I have triple checked the notification settings on my iPhone):

2014-11-03 12:03:47+0100 [XAPSProtocol,98,] APNSClientFactory.queueNotification
2014-11-03 12:03:47+0100 [XAPSProtocol,98,] APNSClientFactory.queueNotification
2014-11-03 12:03:48+0100 [-] APNSProtocol.sendNotifications (2)

One thing that I noticed regarding the plugin, it doesn't announce the capability of XAPPLEPUSHSERVICE like the dovecot server on OS X dose.

Dovecot OS X:

  • OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE XAPPLEPUSHSERVICE AUTH=...] Dovecot ready.

Dovecot with xaps-plugin:

  • OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=....] Dovecot ready.

However i don't think this is the main problem since i forced added the capability XAPPLEPUSHSERVICE in the dovecot configuration with the option 'imap_capability', and still no luck.

[edit]: Just realized that the capability is announced as the plugin gets initialized.

Also I suffer from the "Error: write(/path to file/xapsd.sock) failed: Broken pipe" problem reported in another issue, I don't know if that could cause these kind of problems. I'm running dovecot 2.2.4.

[edit]: Got rid of these messages by using the standard C library for socket communications instead of dovecot's network library, I guess it wouldn't be a problem fixing it with dovecots network functions, but since I'm more familiar with the standard C library I went with that.
And as I suspected that did not change anything.

The only thing I can think of now is that there is a problem when setting up the account in the iPhone since I only use imaps on my server. The initial adding of the account fails, Then I have to save the account and manually change the settings to SSL to be able to connect. And perhaps the iphone won't check for push capabilities after it has failed initially. But that dosen't explain why the iPad is working. It should be the same problem there.

I did update just today (I know, it took me a while- been busy) and whether it was the latest pull or the act of restarting the daemon, Im not sure. Either way, push seems to be, well, pushing. I will monitor it and post back if it quits.

Thanks all

So I've got the latest version pulled down, but my original issue still persists. The APN works.. for a while. Then it seems to randomly stop. All the logs indicate it should be working, yet the phone receives nothing. If I restart the daemon, it starts working again.

I've done this process 3 or 4 times in my own mind thinking that I maybe didn't do something quite right. To no avail.

The only thing that may play into this is that on the particular system that I am using I have Debian Testing (Jessie). It was a foray into the bleeding edge that I've since decided I will return to the safety and security of whence I came - 'stable' (wheezy). Do you think that running like this could be contributing to the APN's just randomly not making it to the devices (not jut mine but all)?

Thanks,

@ledoktre Would you please provide the xapsd daemon logs? Thanks

If anyone is affected by this again please reopen.
Thanks