X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fprocess_policy.py;h=695751c457de1e2bf46684fb6381fb866ca22b48;hb=b02d077cedb6089764004f1409eebdd89f2283de;hp=3945737f665cf44225f1b9433101f72ead410609;hpb=1059d7932685b236b7f734d00fa840d8294141be;p=dak.git diff --git a/dak/process_policy.py b/dak/process_policy.py index 3945737f..695751c4 100755 --- a/dak/process_policy.py +++ b/dak/process_policy.py @@ -33,6 +33,7 @@ import os import datetime +import re import sys import traceback import apt_pkg @@ -232,6 +233,14 @@ def real_comment_reject(upload, srcqueue, comments, transaction, notify=True): subst = subst_for_upload(upload) subst['__MANUAL_REJECT_MESSAGE__'] = '' subst['__REJECT_MESSAGE__'] = comments + + # Try to use From: from comment file if there is one. + # This is not very elegant... + match = re.match(r"\AFrom: ([^\n]+)\n\n", comments) + if match: + subst['__REJECTOR_ADDRESS__'] = match.group(1) + subst['__REJECT_MESSAGE__'] = '\n'.join(comments.splitlines()[2:]) + message = utils.TemplateSubst(subst, os.path.join(cnf['Dir::Templates'], 'queue.rejected')) utils.send_mail(message)