Verified Commit e0d82135 authored by Eli Schwartz's avatar Eli Schwartz
Browse files

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's avatarEli Schwartz <eschwartz@archlinux.org>
parent 44af2b43
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment