diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1995-10-30 10:10:19 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1995-10-30 10:10:19 (GMT) |
commit | 4ec940ad047f6b75f533e87f0ea9f8b7c31a0be0 (patch) | |
tree | af1fbcb4b1c39cd1d3d5b41a2874123ff264a44f /Tools | |
parent | a8304b6bd160e4c7ede3afee4a845a54aa4f487c (diff) | |
download | cpython-4ec940ad047f6b75f533e87f0ea9f8b7c31a0be0.zip cpython-4ec940ad047f6b75f533e87f0ea9f8b7c31a0be0.tar.gz cpython-4ec940ad047f6b75f533e87f0ea9f8b7c31a0be0.tar.bz2 |
Added (limited) compuserve error parsing
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/scripts/mailerdaemon.py | 26 |
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) |