![]() |
|
|
|||||||
| Directory | Register | FAQ | Members List | Calendar | Mark Forums Read | 中文 |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
At my company we used to have some sort of legacy email system (long before my time), which when they sunset it they exported all of the messages (1MM+) to plain text files. What I would like to do would be to find some way to convert these text files to some sort of MAPI compliant form that can be imported into our compliance archive. Since these are simply text files we would have to parse senders/recipients, subject, dates, and body out of the text and input it (with lots of predefined defaults) into a message template (msg format?). Any ideas how/if this could be done in some sort of automated fashion?Here is a sample:Message-ID: <18782231.1075855354110.JavaMail.odds@rosmary>Date : Mon, 14 May 2001 14:39:00 -0700 (PDT)From: phillip.Morris@company.comTo: tim.doe@company.comSubject: Financial ReportingMime-Version: 1.0Content-Type: text/plain; charset=us-asciiContent-Transfer-Encoding: 7bitX-From: Phillip MorrisX-To: Tim Doe <Tim Doe/Company@CompanyXGate>X-cc: X-bcc: X-Folder: \Phillip_Morris_Jan2002_1\Allen, Morris\'Sent MailX-Origin: Morris-PX-FileName: EmailArchive.MB001Please find the important numbers below
|
|
|
|
|
|
#2
|
|||
|
|||
|
If there was any sort of delimiter between the messages, such as some asterisks or something, you could parse it in a php script, if you try using explode().Suppose this is what your text file looks like<header1><subject1><message1><header2><subject 2><message2><header3><subject3><message3>If the delimiter was there, it would look sort of like...<header1>***<subject1>***<message1>***<head er2>***<subject2>***<message2>***<header3>***<subj ect3>***<message3>***Then if you were to $message = explode ("***", <messages>);Then you can do whatever you want with the array. $message[0] will contain <header1>. $message[1] will contain <subject1>, and so on.
|
|
#3
|
|||
|
|||
|
You could do it with any old scripting language. However, we'd need to see samples of the messages, get a description of the platform on which they are stored and where you plan to store the messages, to tell you how to do it.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|