summaryrefslogtreecommitdiffstats
path: root/dmarcpipe.py
diff options
context:
space:
mode:
Diffstat (limited to 'dmarcpipe.py')
-rwxr-xr-xdmarcpipe.py6
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: