- # If passed -m/--mail, assume in REJECT/ and send appropriate mails
- if Cnf["Shania::Options::Mail"]:
- reason_filename = re_ischanges.sub('.reason', changes_filename);
- if not os.access(reason_filename, os.R_OK):
- sys.stderr.write("W: %s lacks a (readable) reason file ('%s').\n" % (changes_filename, reason_filename));
- continue;
-
- if os.stat(reason_filename)[stat.ST_MTIME] > delete_date:
- # Ensure the files aren't later deleted.
- for keys in (files.keys(), dsc_files.keys(), changes_filename, reason_filename):
- for i in keys:
- if all_files.has_key(i):
- del all_files[i];
-
- # Grab a copy of the .changes and .reason files for inclusion in the mail
- try:
- changes_contents = file_to_string(changes_filename);
- except utils.cant_open_exc:
- sys.stderr.write("W: %s lacks a (readable) changes file ('%s').\n" % (changes_filename, changes_filename));
- continue;
-
- reason_contents = file_to_string(reason_filename);
-
- # Fix the maintainer address to be RFC-822 compatible
- (changes["maintainer822"], changes["maintainername"], changes["maintaineremail"]) = utils.fix_maintainer (changes["maintainer"])
-
- if Cnf["Shania::Options::No-Action"]:
- print "Would send a reminder email to %s." % (changes["maintainer822"]);
- else: # FIXME: need msg to be configurable
- mail_message = """Return-Path: %s
-From: %s
-To: %s
-Bcc: troup@auric.debian.org
-Subject: Reminder: %s was rejected
-
-This is an automated reminder. Your Debian upload was rejected. Its
-files are in %s/REJECT on %s.
-
-If the upload has been superceded, please delete it. If not, please
-correct the error. You do not have to reupload good files; simply
-move them from incoming/REJECT to incoming. Do erase any bad files.
-This reminder is sent on Monday mornings. After two reminders, the
-upload is deleted.
-
-----------------------------------------------------------------------
-%s
-----------------------------------------------------------------------
-
-----------------------------------------------------------------------
-%s
-----------------------------------------------------------------------
-
---
-Debian distribution maintenance software
-""" % (Cnf["Dinstall::MyEmailAddress"], Cnf["Dinstall::MyEmailAddress"], changes["maintainer822"], changes_filename, Cnf["Dir::IncomingDir"], Cnf["Archive::%s::OriginServer" % (utils.where_am_i())], changes_contents, reason_contents)
- utils.send_mail(mail_message, "");
- if Cnf["Shania::Options::Verbose"]:
- print "Sent reminder email to %s." % (changes["maintainer822"]);
- else:
- # Ensure the files aren't deleted
- for keys in (files.keys(), dsc_files.keys(), changes_filename):
- for i in keys:
- if all_files.has_key(i):
- del all_files[i];
-
- # Anthing left at this stage is not referenced by a .changes or
- # .dsc and should be deleted if old enough.