From 46c8f3081f8193303ae187cc4c872a38103a19ec Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Sun, 9 Apr 2017 20:43:59 +0200 Subject: dmarcpipe: cleanup --- dmarcpipe.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dmarcpipe.py b/dmarcpipe.py index 8f759d8..a408e71 100755 --- a/dmarcpipe.py +++ b/dmarcpipe.py @@ -10,8 +10,6 @@ from sys import stdin, stdout, argv from zipfile import ZipFile import email -default_enc = 'US-ASCII' -policy_domain = 'the-tk.com' re_valid_filename = re_compile('^[^\\s!]+![^\\s!]+![0-9]+![0-9]+(![^\\s!]+)?.(xml(.gz)?|zip)$') logfile = None dbfile = 'dmarc.db' @@ -55,7 +53,7 @@ def process_message(m): continue if part.get_content_type() not in decoders.keys(): continue - if part.get('Content-Disposition') is None: + if part.get_content_disposition() is None: continue if not is_valid_filename(part.get_filename()): inv_fn = True @@ -78,8 +76,8 @@ def main(): logfile = o[1] if len(args) == 2: dbfile = args[1] - m = email.message_from_file(stdin) try: + m = email.message_from_file(stdin) process_message(m) m['X-DMARC-Report'] = 'True' except Exception as e: -- cgit v1.2.3-54-g00ecf