在C#中读取一个mbox文件 [英] Reading an mbox file in C#
问题描述
I我发现 SharpMimeTools 会分解一条消息,但不允许您重复一堆有一个mbox文件中的消息。
有没有人知道一个体面的解析器是开放的,而不必学习RFC写一个?
我不知道任何解析器,但是mbox真的是一个非常简单的格式。一个新的电子邮件从From(From + Space)开始的行开始,空行被附加到每个邮件的末尾。如果在电子邮件本身的一行开始发生From,则会被引用(通过前缀'>')。
另请参见维基百科的主题条目。
One of our staff members has lost his mailbox but luckily has a dump of his email in mbox format. I need to somehow get all the messages inside the mbox file and squirt them into our tech support database (as its a custom tool there are no import tools available).
I've found SharpMimeTools which breaks down a message but not allow you to iterate through a bunch of messages in a mbox file.
Does anyone know of a decent parser thats open without having to learn the RFC to write one out?
I don't know any parser, but mbox is really a very simple format. A new email begins on lines starting with "From " (From+Space) and an empty line is attached to the end of each mail. Should there be any occurence of "From " at the beginning of a line in the email itself, this is quoted out (by prepending a '>').
Also see Wikipedia's entry on the topic.
这篇关于在C#中读取一个mbox文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!