From e0d821352fbe38b3629044396d1ed23132d2c0d4 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 27 Sep 2018 11:32:26 -0400 Subject: notify: add X-AUR-Reason header to allow conveniently filtering emails Because filtering by matching the sender && regular expressions on the subject is awkward. Signed-off-by: Eli Schwartz --- aurweb/scripts/notify.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'aurweb') diff --git a/aurweb/scripts/notify.py b/aurweb/scripts/notify.py index 44eec84c..d9750862 100755 --- a/aurweb/scripts/notify.py +++ b/aurweb/scripts/notify.py @@ -63,6 +63,9 @@ class Notification: sendmail = aurweb.config.get('notifications', 'sendmail') sender = aurweb.config.get('notifications', 'sender') reply_to = aurweb.config.get('notifications', 'reply-to') + reason = self.__class__.__name__ + if reason.endswith('Notification'): + reason = reason[:-len('Notification')] for recipient in self.get_recipients(): to, lang = recipient @@ -72,6 +75,7 @@ class Notification: msg['From'] = sender msg['Reply-to'] = reply_to msg['To'] = to + msg['X-AUR-Reason'] = reason for key, value in self.get_headers().items(): msg[key] = value -- cgit v1.2.3-24-g4f1b