Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
; The recipient email addresses. Use comma separation for more reciepients.
;recipients = john.doe@example.com, jane.doe@example.com
+
+; Filter by severity
+; If set, only alerts of this severity or more severe will be emailed.
+; Otherwise all alerts will be emailed.
+; 1 = High Severity
+; 2 = Medium Severity
+; 3 = Low Severity
+; 4 = Informational
+;severity = 3
"""
Generates a new email with the alert
"""
+ # Allow to filter by severity (so that only more important
+ # alerts will be emailed)
+ severity = self.config.getint("email", "severity", fallback=None)
+ if severity and event.alert_severity > severity:
+ return
+
# Create a new message
msg = email.message.EmailMessage()