|
Lines 7-12
Link Here
|
| 7 |
'Message', |
7 |
'Message', |
| 8 |
] |
8 |
] |
| 9 |
|
9 |
|
|
|
10 |
import sys |
| 10 |
import os |
11 |
import os |
| 11 |
import time |
12 |
import time |
| 12 |
import cStringIO |
13 |
import cStringIO |
|
Lines 86-105
Link Here
|
| 86 |
# of filters, etc, which should be saner. |
87 |
# of filters, etc, which should be saner. |
| 87 |
if fromlines: |
88 |
if fromlines: |
| 88 |
try: |
89 |
try: |
| 89 |
self.__msg = email.message_from_string(os.linesep.join( |
90 |
if sys.version_info < (2, 4): |
| 90 |
fromlines), strict=False) |
91 |
self.__msg = email.message_from_string(os.linesep.join( |
|
|
92 |
fromlines), strict=False) |
| 93 |
else: |
| 94 |
self.__msg = email.message_from_string(os.linesep.join( |
| 95 |
fromlines)) |
| 91 |
except email.Errors.MessageError, o: |
96 |
except email.Errors.MessageError, o: |
| 92 |
self.__msg = corrupt_message(o, fromlines=fromlines) |
97 |
self.__msg = corrupt_message(o, fromlines=fromlines) |
| 93 |
self.__raw = os.linesep.join(fromlines) |
98 |
self.__raw = os.linesep.join(fromlines) |
| 94 |
elif fromstring: |
99 |
elif fromstring: |
| 95 |
try: |
100 |
try: |
| 96 |
self.__msg = email.message_from_string(fromstring, strict=False) |
101 |
if sys.version_info < (2, 4): |
|
|
102 |
self.__msg = email.message_from_string(fromstring, |
| 103 |
strict=False) |
| 104 |
else: |
| 105 |
self.__msg = email.message_from_string(fromstring) |
| 97 |
except email.Errors.MessageError, o: |
106 |
except email.Errors.MessageError, o: |
| 98 |
self.__msg = corrupt_message(o, fromstring=fromstring) |
107 |
self.__msg = corrupt_message(o, fromstring=fromstring) |
| 99 |
self.__raw = fromstring |
108 |
self.__raw = fromstring |
| 100 |
elif fromfile: |
109 |
elif fromfile: |
| 101 |
try: |
110 |
try: |
| 102 |
self.__msg = email.message_from_file(fromfile, strict=False) |
111 |
if sys.version_info < (2, 4): |
|
|
112 |
self.__msg = email.message_from_file(fromfile, |
| 113 |
strict=False) |
| 114 |
else: |
| 115 |
self.__msg = email.message_from_file(fromfile) |
| 103 |
except email.Errors.MessageError, o: |
116 |
except email.Errors.MessageError, o: |
| 104 |
# Shouldn't happen |
117 |
# Shouldn't happen |
| 105 |
self.__msg = corrupt_message(o, fromstring=fromfile.read()) |
118 |
self.__msg = corrupt_message(o, fromstring=fromfile.read()) |