Cyrus 3.0.3 XAPPLEPUSH

Arnaldo Viegas de Lima arnaldo at viegasdelima.com
Wed Aug 23 07:27:04 EDT 2017


Hi Sebastian,

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!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: notifyd_apns
Type: application/octet-stream
Size: 8653 bytes
Desc: not available
URL: <http://lists.andrew.cmu.edu/pipermail/info-cyrus/attachments/20170823/08c70733/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: apns_mobilemail.sql
Type: application/octet-stream
Size: 1199 bytes
Desc: not available
URL: <http://lists.andrew.cmu.edu/pipermail/info-cyrus/attachments/20170823/08c70733/attachment-0001.obj>
-------------- next part --------------








More information about the Info-cyrus mailing list