summaryrefslogtreecommitdiffstats
path: root/aurweb/scripts
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2018-09-27 17:32:26 +0200
committerEli Schwartz <eschwartz@archlinux.org>2019-02-08 17:19:16 +0100
commite0d821352fbe38b3629044396d1ed23132d2c0d4 (patch)
treeb24842f836845423b8e6eecc06ac1180c602ca6e /aurweb/scripts
parent44af2b430f4d676b8498b726e50c969fa37955db (diff)
downloadaur-e0d821352fbe38b3629044396d1ed23132d2c0d4.tar.gz
aur-e0d821352fbe38b3629044396d1ed23132d2c0d4.tar.xz
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 <eschwartz@archlinux.org>
Diffstat (limited to 'aurweb/scripts')
-rwxr-xr-xaurweb/scripts/notify.py4
1 files changed, 4 insertions, 0 deletions
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