import os
import datetime
+import re
import sys
import traceback
import apt_pkg
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)
cnf = Config()
maintainer_field = upload.changes.changedby or upload.changes.maintainer
- addresses = utils.mail_addresses_for_upload(upload.changes.maintainer, maintainer_field, upload.changes.fingerprint)
+ if upload.source is not None:
+ addresses = utils.mail_addresses_for_upload(upload.changes.maintainer, maintainer_field, upload.changes.fingerprint)
+ else:
+ addresses = utils.mail_addresses_for_upload(upload.changes.maintainer, upload.changes.maintainer, upload.changes.fingerprint)
changes_path = os.path.join(upload.policy_queue.path, upload.changes.changesname)
changes_contents = open(changes_path, 'r').read()