My problem is this: I need determine the timestamp of the first and last email sent from an Exchange account for every day that mail exists for. Also, for each day I need to rank the words that appear in each email so that I can report trend words for each day.
I have two approaches to this I'm considering, and would welco开发者_Go百科me comments and suggestions relating to either these approaches or something entirely different.
I've discounted exporting the file from Outlook as a CSV file as it does include the time stamp fields in the output, which is a crucial factor for me.
Approach #1 is:
Use Perl and Net::POP3 to pull the messages out of the inbox, mung them and then insert them into a MySQL database.
Approach #2 is:
Use Win32:OLE to attempt to act like a proper Exchange client, to the same end.
If you use Win32::OLE you'll have to either use Outlook automation or the CDO libraries. I've done both in a previous life, and it works, but it's a bit painful.
I'd suggest approach #1 except that I can't imagine that Exchange would actually allow you to fetch sent mail through POP. Rather, though, Exchange can be enabled to expose an IMAP interface, and IMAP should certainly let you get at the Sent mail without running into any of the problems associated with POP (for example, replacing deleted messages on the server). I haven't used it but Mail::IMAPClient appears to be the recommended module for this.
精彩评论