Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv12424/spambayes
Modified Files:
mboxutils.py
Log Message:
Handle Apple Mail's emlx format.
Index: mboxutils.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/mboxutils.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** mboxutils.py 5 Nov 2004 03:03:00 -0000 1.9
--- mboxutils.py 27 Mar 2007 10:59:24 -0000 1.10
***************
*** 31,37 ****
class DirOfTxtFileMailbox:
-
"""Directory of files each assumed to contain an RFC-822 message.
Subdirectories are traversed recursively.
"""
--- 31,43 ----
class DirOfTxtFileMailbox:
"""Directory of files each assumed to contain an RFC-822 message.
+ If the filename ends with ".emlx", assumes that the file is an
+ RFC-822 message wrapped in Apple Mail's proprietory .emlx format.
+ The emlx format is simply the length of the message (as a string
+ on the first line, then the raw message text, then the contents of
+ a plist (XML) file that contains data that Mail uses (subject,
+ flags, sender, and so forth). We ignore this plist data).
+
Subdirectories are traversed recursively.
"""
***************
*** 47,50 ****
--- 53,61 ----
for mbox in DirOfTxtFileMailbox(name, self.factory):
yield mbox
+ elif os.path.splitext(name)[1] == ".emlx":
+ f = open(name)
+ length = int(f.readline().rstrip())
+ yield self.factory(f.read(length))
+ f.close()
else:
try:
_______________________________________________
Spambayes-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/spambayes-checkins