diff options
author | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2020-10-17 13:41:44 +0200 |
---|---|---|
committer | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2020-10-17 13:41:44 +0200 |
commit | fbea971f5b9aaf1a7b26f8b19dfde68ad27a40d3 (patch) | |
tree | ace59619485f2ac95e7df31abd3f5d23fdb4233a /hemiptera | |
parent | dd5c7ca837f39119e718dc3ca6918ea6fec70f61 (diff) | |
download | hemiptera-fbea971f5b9aaf1a7b26f8b19dfde68ad27a40d3.tar.gz hemiptera-fbea971f5b9aaf1a7b26f8b19dfde68ad27a40d3.tar.bz2 hemiptera-fbea971f5b9aaf1a7b26f8b19dfde68ad27a40d3.zip |
Preven mailer daemon messages from leaking in
handle messages without text/plain part.
Diffstat (limited to 'hemiptera')
-rwxr-xr-x | hemiptera | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -147,7 +147,10 @@ The TrustedDate Parameter indicates whether the date from the message """ m = email.message.EmailMessage() - m.set_payload(msg.get_body("plain").get_content(), charset="utf-8") + try : + m.set_payload(msg.get_body("plain").get_content(), charset="utf-8") + except : + m.set_payload("", charset="utf-8") m["From"] = get_from_addr(msg) m["To"] = get_to_addr(msg) m["Subject"] = msg["Subject"] @@ -291,6 +294,8 @@ def import_bugs() : os.remove(opj(inbox, i)) def process_message(m) : + if "MAILER-DAEMON" in get_from_addr(m) : + return toaddr = get_to_addr(m) os.makedirs(bugdir, exist_ok=True) dest = toaddr.split("@")[0] |