From 81299f10f780655085bbceb9182d69f74802c7cf Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 30 Oct 1995 10:23:10 +0000 Subject: Added providence mailer support --- Tools/scripts/mailerdaemon.py | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/Tools/scripts/mailerdaemon.py b/Tools/scripts/mailerdaemon.py index 1240ff4..075df1f 100755 --- a/Tools/scripts/mailerdaemon.py +++ b/Tools/scripts/mailerdaemon.py @@ -156,9 +156,41 @@ def emparse_compuserve(fp): errors.append(line) return errors +prov_pattern = regex.compile('.* | \(.*\)') +def emparse_providence(fp): + while 1: + line = fp.readline() + if not line: + raise Unparseable + line = line[:-1] + + # Check that we're not in the returned message yet + if string.lower(line)[:5] == 'from:': + raise Unparseable + exp = 'The following errors occurred' + if line[:len(exp)] == exp: + break + + errors = [] + while 1: + line = fp.readline() + if not line: + break + line = line[:-1] + if not line: + continue + if line[:4] == '----': + break + if prov_pattern.match(line) > 0: + errors.append(prov_pattern.group(1)) + + if not errors: + raise Unparseable + return errors -EMPARSERS = [emparse_sendmail, emparse_aol, emparse_cts, emparse_compuserve] +EMPARSERS = [emparse_sendmail, emparse_aol, emparse_cts, emparse_compuserve, + emparse_providence] def parsedir(dir, modify): os.chdir(dir) -- cgit v0.12