summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/mailerdaemon.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/scripts/mailerdaemon.py')
-rwxr-xr-xTools/scripts/mailerdaemon.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Tools/scripts/mailerdaemon.py b/Tools/scripts/mailerdaemon.py
index ee4199e..4934b92 100755
--- a/Tools/scripts/mailerdaemon.py
+++ b/Tools/scripts/mailerdaemon.py
@@ -1,16 +1,16 @@
"""mailerdaemon - classes to parse mailer-daemon messages"""
-import rfc822
import calendar
+import email.message
import re
import os
import sys
Unparseable = 'mailerdaemon.Unparseable'
-class ErrorMessage(rfc822.Message):
- def __init__(self, fp):
- rfc822.Message.__init__(self, fp)
+class ErrorMessage(email.message.Message):
+ def __init__(self):
+ email.message.Message.__init__(self)
self.sub = ''
def is_warning(self):
@@ -169,7 +169,7 @@ def parsedir(dir, modify):
for fn in files:
# Lets try to parse the file.
fp = open(fn)
- m = ErrorMessage(fp)
+ m = email.message_from_file(fp, _class=ErrorMessage)
sender = m.getaddr('From')
print('%s\t%-40s\t'%(fn, sender[1]), end=' ')