Commit fff18482 authored by Jack Jansen's avatar Jack Jansen

Added providence mailer support

parent 0ccf13a5
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment