if uid_name == "": sponsored = 1
else:
sponsored = 1
+ if daklib.utils.is_email_alias(uid_email):
+ changes["sponsoremail"] = uid_email
if sponsored and not may_sponsor:
reject("%s is not authorised to sponsor uploads" % (uid))
Subst["__MAINTAINER_FROM__"] = changes["changedby2047"]
Subst["__MAINTAINER_TO__"] = "%s, %s" % (changes["changedby2047"],
changes["maintainer2047"])
+ if "sponsoremail" in changes:
+ Subst["__MAINTAINER_TO__"] += ", %s"%changes["sponsoremail"]
Subst["__MAINTAINER__"] = changes.get("changed-by", "Unknown")
else:
Subst["__MAINTAINER_FROM__"] = changes["maintainer2047"]
else:
return default_apt_config
+def which_alias_file():
+ hostname = socket.gethostbyaddr(socket.gethostname())[0]
+ aliasfn = '/var/lib/misc/'+hostname+'/forward-alias'
+ if os.path.exists(aliasfn):
+ return aliasfn
+ else:
+ return None
+
################################################################################
# Escape characters which have meaning to SQL's regex comparison operator ('~')
################################################################################
+# checks if the user part of the email is listed in the alias file
+
+def is_email_alias(email):
+ aliasfn = which_alias_file()
+ uid = email.split('@')[0]
+ if not aliasfn:
+ return False
+ for l in open(aliasfn):
+ if l.startswith(uid+': '):
+ return True
+ return False
+
+################################################################################
+
apt_pkg.init()
Cnf = apt_pkg.newConfiguration()