diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2017-04-09 20:43:59 +0200 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2017-04-09 20:43:59 +0200 |
commit | 46c8f3081f8193303ae187cc4c872a38103a19ec (patch) | |
tree | 92d6194750438cb6ce24e2b9eb288bba1a7b8501 | |
parent | 2f256fe553d7d556a0d8948a940be0a0214ea5ea (diff) | |
download | dmarcpipe-46c8f3081f8193303ae187cc4c872a38103a19ec.tar.gz dmarcpipe-46c8f3081f8193303ae187cc4c872a38103a19ec.tar.xz dmarcpipe-46c8f3081f8193303ae187cc4c872a38103a19ec.zip |
dmarcpipe: cleanup
-rwxr-xr-x | dmarcpipe.py | 6 |
1 files 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: |