Event Notification System Configuration
Here are the steps to follow when configuring the Event Notification System:
-
If you’re using Studio, then start logging the desired Studio events.
-
If you’re sending any non-Studio mail, then start logging the desired non-Studio events. You can control which types of events get logged by creating one or more of the following configuration files within the
/var/hvmail/control/
directory:-
record_events.simplemh.scomp
- SimpleMH and Raw Injectionscomp
(spam complaint) events -
record_events.simplemh.bounce_all
- SimpleMH and Raw Injectionbounce_all
events -
record_events.simplemh.bounce_bad_address
- SimpleMH and Raw Injectionbounce_bad_address
events -
record_events.simplemh.unsub
- SimpleMHengine_unsub
(unsubscribe) events -
record_events.simplemh.open
- SimpleMHopen
events -
record_events.simplemh.click
- SimpleMHclick
events
See the Types of Events page for more details on any of the above event types.
Each file should have its contents set equal to
1
if you wish to log its event type. For example, to log all non-Studio event types, run:cd /var/hvmail/control/ echo 1 > record_events.simplemh.scomp echo 1 > record_events.simplemh.bounce_all echo 1 > record_events.simplemh.bounce_bad_address echo 1 > record_events.simplemh.unsub echo 1 > record_events.simplemh.open echo 1 > record_events.simplemh.click
Each file should have its contents set equal to
0
if you do not wish to log its event type. For example, to stop logging all non-Studio event types, run:cd /var/hvmail/control/ echo 0 > record_events.simplemh.scomp echo 0 > record_events.simplemh.bounce_all echo 0 > record_events.simplemh.bounce_bad_address echo 0 > record_events.simplemh.unsub echo 0 > record_events.simplemh.open echo 0 > record_events.simplemh.click
-
-
The creation of Delivery Attempt events is disabled by default. If you would like to keep these events disabled, then move onto the next step.
If you would like to enable Delivery Attempt events, then edit the
/var/hvmail/control/record_events.delivery_attempt.json
configuration file. The file consists of a JSON object which defines the desired configuration. Here are the default settings:{ "enabled": false, "include_status": { "success": true, "deferral": false, "failure": true, "failure_toolong": true, "connmaxout": false }, "include_first_attempt_regardless_of_status": true, "include_local_channel": false }
Here’s the meaning of each setting:
-
enabled
- iftrue
, then delivery attempt event creation is enabled. -
include_status
- a JSON object containing a series of boolean keys that specify which types of delivery attempts should create events.deferral
andconnmaxout
delivery attempts do not trigger events by default because it is possible for there to be manydeferral
andconnmaxout
delivery attempts for each message due to delivery retries. Creating events for each of these could consume significant server resources and slow down message processing. With the default settings, each message will have a singlesuccess
,failure
orfailure_toolong
event. -
include_first_attempt_regardless_of_status
- iftrue
then the first delivery attempt for a message (whereis_retry
is0
) should always have an event created regardless of the status. This is useful because the first delivery informs that a new message has been created. -
include_local_channel
- iftrue
then delivery attempts to local domain names (incoming email domains) will have events created. Iffalse
, they will be excluded. Most of the deliveries to local domains are bounce messages received through SMTP and internally created bounce messages.
When you’re finished making your changes, run the following command to verify that there are no syntax errors:
/var/hvmail/bin/hvmail_logwriter --check-config-event
The configuration file is automatically re-read every few seconds, so there is no need to restart any services in order to apply changes to it.
-
-
Run
greenarrow_config reload
to apply the event generation changes above. -
Configure the receiving end of your desired Event Delivery Method(s).
-
Turn off the Event Processor:
svc -d /service/hvmail-event-processor
-
Configure the Event Processor to use your desired Event Delivery Method(s).
-
Turn on the Event Processor:
svc -u /service/hvmail-event-processor
-
Review the Event Processor’s log for errors:
tail -F /var/hvmail/log/event-processor/current | tai64nlocal