summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/mailerdaemon.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/Tools/scripts/mailerdaemon.py b/Tools/scripts/mailerdaemon.py
index b39760e4..1240ff4 100755
--- a/Tools/scripts/mailerdaemon.py
+++ b/Tools/scripts/mailerdaemon.py
@@ -131,10 +131,34 @@ def emparse_aol(fp):
else:
raise Unparseable
return errors
+
+def emparse_compuserve(fp):
+ while 1:
+ line = fp.readline()
+ if not line:
+ raise Unparseable
+ line = line[:-1]
+ if line:
+ break
+ exp = 'Your message could not be delivered for the following reason:'
+ if line[:len(exp)] != exp:
+ raise Unparseable
+ errors = []
+ while 1:
+ line = fp.readline()
+ if not line: break
+ if line[:3] == '---': break
+ line = line[:-1]
+ if not line: continue
+ if line == 'Please resend your message at a later time.':
+ continue
+ line = 'Compuserve: ' + line
+ errors.append(line)
+ return errors
-EMPARSERS = [emparse_sendmail, emparse_aol, emparse_cts]
+EMPARSERS = [emparse_sendmail, emparse_aol, emparse_cts, emparse_compuserve]
def parsedir(dir, modify):
os.chdir(dir)