Skip to main content

You can use Momentum to send push notifications to an application running on an Apple device. As prerequisites you must have an app registered with Apple and also the SSL certificate provided by Apple. You must be licensed by Message Systems to use Momentum's push notification capabilities; if you do not have a license contact your Sales Engineer or Account Manager to acquire one. If you do not have a license or it has expired, messages will be permanently failed. If these prerequisites are met, you can configure Momentum to send Apple push notifications by following these steps:

  1. If you are not configuring push notifications in a global scope, determine which domains you will be using. Configuring a domain is described at domain. Note that the Momentum configuration options listed at “APNs-specific Configuration Option” are valid within the global and the domain scope but are not valid within the binding::domain scope.

  2. Configure the TLS options shown at “TLS”. Configure these options in the scope appropriate to your circumstances.

  3. Configure the routes, delivery_method and delivery_response_timeout options as described at routes and Related Options”.

  4. Set the max_outbound_connections option if appropriate.

  5. Set MCMT_Reception to allow within the ESMTP_Listener scope.

  6. Add the apn module to the ecelerity.conf file. In a test environment you can set the apn module debug_level option to debug the application.

  7. If you wish to log notifications, add the apn_logger module to the ecelerity.conf file.

  8. After making these changes to the configuration file you must restart the ecelerity process; running the console command config reload will not suffice. For information on starting the ecelerity process see ec_ctl.

  9. Create a notification for injection as described at “Message Injection and the APNs Payload” and The Multi-Channel Message Type.

A sample configuration follows:

1esmtp_listener {
2  listen ":25"{
3    mcmt_reception = "allow"
4  }
6domain "" {
7  # TLS
8  # Currently the "tls" option is ignored by APN
9  # but explicitly configure it anyway
10  tls = "required"
11  # Set other TLS options
12  tls_verify = "no"
13  tls_certificate = "/path/to/cert"
14  tls_key = "/path/to/key"
15  tls_ciphers = "DEFAULT"
16  max_outbound_connections = 20
17  delivery_response_timeout = 1000
18  delivery_method = "apn"
19  routes = ("apn://")
20  # set any other options here
21  ...
24# The APN server
25apn {}
26# optional apn_logger module
27apn_logger "apn_logger1" {
28  logmode = 0644
29  logfile = "/var/log/ecelerity/"
30  heartbeat = 60

APNs requires that you identify the APNs server so you must configure the routes option and, to configure it for a production environment, it must be set to The routes option is used in conjunction with delivery_method and this must be set to apn. If you wish to log APNs notifications, add the apn_logger module to your configuration file. Use of this module is optional.

Since push notifications require an SSL certificate (supplied by Apple) the Momentum TLS options must be configured to reference these credentials.


Using Lua, you can convert and reroute messages upon failure. See “generic_delivery_msg_dispose”.

After configuring ecelerity.conf, you can send push notifications as a MCMT MIME payload.

Message Injection and the APNs Payload

The apn module recognizes the "push" part of an MCMT message. In the 3.5.4 release there is support for MCMT injection of APNs messages. Similar to existing transmission channels such as SMTP, SMS, MMS and XMPP, APNs Notifications can be created or modified based on the following scheme:

2  Content-Type: message/vnd.msys.apn
4  X-Device-Token: 123acb90ffa0978cbade354ddffee76665a
6  {
7    "aps" : {
8      "alert" : "You have mail",
9      "badge" : 9,
10      "sound" : "dingdong.aiff"
11     },
12     "app-key" : "bar",
13  }


The extra newline just before the X-Device-Token header is required.

Push notifications are sent as regular MIME payloads. The Content-Type for an Apple notification should be set to message/vnd.msys.apn. The actual message is a set of key/value pairs encoded in JSON. APNs has specific key names such as alert, badge etc. that must be present. See Apple Push Notification Service for more information. For more detail about the MCMT message format see The Multi-Channel Message Type (MCMT).

The following MIME headers for a MCMT push part are handled:

  • X-Device-Token – The destination device token in hex format. When sending notifications via APNs, you must provide this identifier. It is typically stored in the backend and retrieved when a notification is injected. If it is not specified as a header, the module will look for it in the DLV_Dest_ID context variable.


    X-Device-Token corresponds to Device Token.

  • Return-Path – The email address that will be used for "bounces" (permanent failures). This defaults to the Mail-From.


    There are no bounces in Apple Push notifications, but because the code used in the apn module is the same code that handles permanently failed email messages, the "bounce" behavior is the same as failed emails.

  • Content-Transfer-Encoding – This defaults to "7bit" for an ASCII payload. Otherwise, set it to "base64" for non-US-ASCII characters or binary date. The payload has to be encoded accordingly.

Was this page helpful?