June 2000
Intermediate to advanced
556 pages
8h 45m
English
To process a Linux-style mailbox into individual messages, a different control structure is required. Note, however, that the processing of each individual e-mail is handled by ProcessMessage, which is common to both Linux and Eudora converters.
CD-ROM reference=14006.txt DoLinuxMailBox(f): # f is a file object. L = f.readline()[:-1] if string.find(L,"From ")!=0: print 'Expected mailbox "%s" to start with "From "' % MailBox return Message = [] L = f.readline() while L: if string.find(L,"From ")==0: # Full message accumulated in the Message # list, so process it to XML ProcessMessage(Message,out) Message = [] else: # Accumulate e-mail contents line by line in # Message list. Message.append (L) L = f.readline() ...
Read now
Unlock full access