What syntax are the parameters passed to a Mailbox Delivery Event?


This article describes the command line parameters passed to Mailbox Delivery Events.


A Mailbox Delivery Event is optionally triggered immediately after the postoffice connector delivers a message to a mailbox. This is also after any postoffice and mailbox filters have executed. So it is not possible to execute an external program and then action a filter.

The postoffice connector will check whether a delivery event is configured for the mailbox and will run the specified executable. The original message will remain in the postoffice outbound queue until the message has been delivered to all target mailboxes.

This means that if Mailbox Delivery Event intends to modify the contents of a mail message, it needs to edit the message that has already been delivered to the mailbox.

This message is located as follows:


Where [Folder] is normally INBOX, but may be a different location if the message has been marked with a Deliver to Junk Header. The message store location can be read from the Windows registry, and it will be located in the following registry path:

For 32bit Windows:

"Mail Root"="C:\\Program Files\\Mail Enable\\POSTOFFICES"

For 64bit Windows:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mail Enable\Mail Enable]
"Mail Root"="C:\\Program Files (x86)\\Mail Enable\\POSTOFFICES"

When the delivery event is triggered, the following parameters are passed on the command line to the specified executable (they are delimited by a space):

PostofficeName Mailbox MessageID

Note that Mailbox Delivery Events generate different parameters to Mail Transfer Agent Pickup Events. It is therefore not possible to run code designed for a Pickup Event as a Delivery Event (although it should be quite simple to modify the parameter list expected by the target executable).

By default Mailbox delivery events will not execute on messages with the following properties. This is due to needing to avoid looping caused by automated messages:

  • Messages with [AUTORESPONSE] in subject
  • Messages with Precedence header of "bulk"
  • Messages with Precedence header of "junk"
  • Messages with Precedence header of "list"
  • Messages with a "multipart/report" content type

If you do need to run the delivery event on all messages you can set this option in the administration program. Expand the Servers->localhost->Services and Connectors branch, right click on the Postoffice icon and select Properties from the popup menu. In the window that appears, select the checkbox "Execute delivery event on bulk/system messages".


More information on Mailbox Delivery Events can be found in the MailEnable API as published at: http://www.mailenable.com/developers

Product:MailEnable (All Versions)
Class:INF: Product Information
Revised:Tuesday, May 31, 2016