17. Use ZenMail and ZenPop to Turn Email Messages into Zenoss Events

ZenMail and ZenPop allow network administrators to turn email messages into events in Zenoss. This can be useful in situations where embedded systems (WAPs, NAS devices, RAID controllers) rely on email notification for events.

17.1. ZenMail

ZenMail serves as an SMTP server that you can bind to a specific TCP port. You can then configure your embedded system to send mail to the Zenoss server explicitly by using the Zenoss's server's IP address as the relay. Alternatively, ZenPop allows you to retrieve event emails from a POP server.

ZenMail supports the following configuration directives:

${ZENHOME}/bin/zenmail (no arguments): default operation. Binds to port 25 on all ports and listens for email messags to arrive. Ignores the TO field in the email and uses the FROM address as the device IP address.

${ZENHOME}/bin/zenmail --listenPort: Bind to the port provided. Useful in situations where an smtp server is already running on the Zenoss server and you don't wish to interfere with the existing mail delivery system. Semantics are the same as the no-argument version (FROM address used as the device IP).

17.2. ZenPop

ZenPOP supports the following configuration directives:

--usessl: Issue the STARTTLS command to the POP server and attempt to transfer email messages using SSL encryption. This is required if retrieving mail from Google.

--nodelete: Do not issue the DELE command after retrieving all messages. This is typically used during initial testing so that you don't have to resend test messages to the POP account. Note that some email systems (most notably Google) do not actually delete messages when the DELE command is issued.

--pophost: The hostname or IP address of the POP server to retrieve messages from.

--popport: The tcp port the POP server listens on. Defaults to 110. Used in situations where the POP provider listens on another port (e.g. Google on port 995)

--popuser: The username that contains email messages to retrieve

--poppass: The password to use for the username provided

--cycletime: The time to sleep between polls. All emails are retrieved and then ZenPOP sleeps for this amount of time before waking up and attempting to pull new emails.

17.3. How Zenoss Translates Various Message Elements to the Event

17.3.1. How Zenoss uses the FROM field

If the FROM field is an IP address Zenoss associates the event with the device that has the same IP address. If the FROM field is a FQDN Zenoss resolves it to an IP address and performs the device association using the resolved IP address. The resolution of hostname uses A records and not MX records.

17.3.2. How Zenoss uses the TO Field

Zenoss completely ignores the TO field in the email message. ZenMail accepts email to any user and domain name combination. ZenPOP also drops the TO field and only pays attention to the FROM field.

17.3.3. How Zenoss uses the SUBJECT Field

ZenMail and ZenPOP use the SUBJECT as the summary for the event

17.3.4. How Zenoss uses the Message Body

ZenMail and ZenPOP use the first mime attachment as the event details. Secondary message bodies (typically HTML encoded versions of the message) are ignored, as are any additional attachments (typically files).