Skip to content

Email Notifier#

The email notifier will send emails via SMTP.

Configuration#

event:
  notifiers:
    email:
      # enable mail notifications
      enable: true
      # mail server setup
      smtp:
        host: mailin.example.net
      # from address
      from: noreply+ixpect@example.net
      channels:
        # send important events to the NOC
        - to:
            - alert@example.net
          events:
            - ARP_NEIGHBOR_UNKNOWN
            - IPV6_NEIGHBOR_UNKNOWN
        # catch-all
        - to:
            - bulk@example.net
event:
  notifiers:
    email:
      # enable mail notifications
      enable: true
      # mail server setup
      smtp:
        host: mailin.example.net
        encryption: START_TLS
      # from address
      from: noreply+ixpect@example.net
      channels:
        # send important events to the NOC
        - to: alert@example.net
          events:
            - ARP_NEIGHBOR_UNKNOWN
            - IPV6_NEIGHBOR_UNKNOWN
        # catch-all
        - to: 
            - bulk@example.net
event:
  notifiers:
    email:
      # enable mail notifications
      enable: true
      # mail server setup
      smtp:
        host: mailout.example.net
        port: 465
        encryption: TLS
        auth:
          mechanism: PLAIN
          user: ixp-user
          pass:
            file: /run/secrets/smtp_password_file
      # from address
      from: noreply+ixpect@example.net
      channels:
        # send important events to the NOC
        - to: alert@example.net
          events:
            - ARP_NEIGHBOR_UNKNOWN
            - IPV6_NEIGHBOR_UNKNOWN
        # catch-all
        - to: 
            - bulk@example.net

The SMTP configuration includes the connection details for the mail server in the host and port fields. The encryption is per default set to NONE, it should be changed to START_TLS or TLS when doing mail submission. Authentication can be set in the auth section, with the mechanism field you can choose between NONE (default), PLAIN and LOGIN authentication. For PLAIN and LOGIN the user and pass fields must be specified. The pass can either be an in-place password or alternatively be read from a file.

See also: schema description

Template#

The notifier will format the email body using the email.html.j2 template file:

<!doctype html>
<html>

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>[IXpect] {{name}} triggered in {{batch_count}} batches</title>
</head>

<body>
  <h1>{{name}} triggered in {{batch_count}} batches</h1>

  <table border="1">
    <thead>
      <tr>
        <th>Events</th>
        <th>Timestamp</th>
        <th>ID</th>
        <th>Data</th>
      </tr>
    </thead>

    <tbody>
      {% for batch in batches %}
      <tr>
        <td>{{batch.size}}</td>
        <td>{{batch.timestamp}}</td>
        <td>{{batch.id}}</td>
        <td>
          <pre>{{batch.data}}</pre>
        </td>
      </tr>
      {% endfor %}
    </tbody>
  </table>
</body>

</html>