Re: Cyrus 3.0.3 XAPPLEPUSH

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Arnaldo,

thank you very much! This has been very enlightening. I think I understand most of it and have already set up a testing environment with a certificate from our OS X Server. What I have not yet understood completely is how you populate the database. Where do I find the "APNS Account Id" and the "APNS Device Token" for the devices table, and what do I put in the mailboxes table?

Thanks,
Sebastian

--On 23. August 2017 um 08:27:04 -0300 Arnaldo Viegas de Lima <arnaldo@xxxxxxxxxxxxxxxx> wrote:

A few notes:

- You need a valid push certificate. You can get one from macOS Server,
but I do not know the limitations on the usage. My shop is really small,
so I think it’s not a problem.

- There is close to nothing documenting how this work, so much of it is
based on looking at the source code (Cyrus), from info on a similar
Dovecot plugin and on the actual Apple source code (based on Dovecot).
Also a lot of debugging and trial and error.

- Contrary to the existing (and minimal) reference in the docs, there is
no “—enable-apple-push-service” configure flag. The code in imapd
is so simple and harmless that it’s always compiled.

- XAPPLEPUSH requires TLS, so if TLS is not configured it will not be
advertised.

- XAPPLEPUSH is only advertised with the proper notifications settings
(see bellow).

- I used MySQL because it’s already running on the same server as Cyrus
and I have a nice set of functions to make scripts like this a breeze.
For the same reasons, it’s in PHP.


This is what needs to be added to imapd.conf:

# Apple Push Service Events
event_notifier: external
event_groups: applepushservice message flags
event_extra_params: timestamp vnd.cmu.unseenMessages
notify_external: /usr/local/bin/notifyd_apns
aps_topic: com.apple.mail.XServer.xxxxxxxxxxxxxxx

aps_topic is the common name take from the certificate. It’s sent to
the mobile device so that it will match the source of the push
notification when it arrives.


The MySQL database configuration is also attached.

For the certificate you need to enable mail services and export the
“mobilemail” certificate and key (as pkcs12) from the keychain. Then
use openssl to remove key and certificate as well as to unencrypt the
key. Combine both in a single PEM file.

Enjoy!

Attachment: pgpmHIR7Rp_wE.pgp
Description: PGP signature

----
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux