从 Exchange 中提取邮件并加载到 Mysql 中。 Perl Win32::OLE 或 Perl Net::POP3,或者在 Ruby 中尝试
我的问题是这样的:我需要确定邮件存在的每一天从 Exchange 帐户发送的第一封和最后一封电子邮件的时间戳。另外,每天我都需要对每封电子邮件中出现的单词进行排名,以便我可以报告每天的趋势单词。
我正在考虑两种方法,并且欢迎与这些方法或完全不同的方法相关的评论和建议。
我不打算将文件从 Outlook 导出为 CSV 文件,因为它在输出中包含时间戳字段,这对我来说是一个关键因素。
方法 #1 是:
使用 Perl 和 Net::POP3 将消息从收件箱,将它们捣碎,然后将它们插入 MySQL 数据库。
方法 #2 是:
使用 Win32:OLE 尝试充当正确的 Exchange客户,为了同一个目的。
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 welcome 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 Win32::OLE,则必须使用 Outlook 自动化或 CDO 库。前世我曾经做过这两种方法,而且有效,但有点痛苦。
我建议采用方法 #1,但我无法想象 Exchange 实际上会允许您通过 POP 获取已发送的邮件。相反,可以启用 Exchange 来公开 IMAP 接口,并且 IMAP 当然应该让您能够获取已发送的邮件,而不会遇到与 POP 相关的任何问题(例如,替换服务器上已删除的邮件)。我还没有使用过它,但 Mail::IMAPClient 似乎是推荐的模块为了这。
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.