634 |
lastline = contents.read().splitlines()[-1] |
lastline = contents.read().splitlines()[-1] |
635 |
# Remove things like "ERROR: " and so on from the last line |
# Remove things like "ERROR: " and so on from the last line |
636 |
lastline = re.sub(r'^(?:[^ :]+:\s+)+', '', lastline) |
lastline = re.sub(r'^(?:[^ :]+:\s+)+', '', lastline) |
637 |
subjecterrror = " (ERROR: %s)" % lastline if lastline else " (ERROR)" |
subjecterror = " (ERROR: %s)" % lastline if lastline else " (ERROR)" |
638 |
else: |
else: |
639 |
subjecterror = "" |
subjecterror = "" |
640 |
msg['Subject'] = "Re: %s%s" (orig_msg['Subject'], subjecterror) |
msg['Subject'] = "Re: %s%s" % (orig_msg['Subject'], subjecterror) |
641 |
msg['To'] = to |
msg['To'] = to |
642 |
msg["In-Reply-To"] = orig_msg["Message-ID"] |
msg["In-Reply-To"] = orig_msg["Message-ID"] |
643 |
msg["References"] = orig_msg["Message-ID"] |
msg["References"] = orig_msg["Message-ID"] |