0

我正在创建一个工具,用于解析传入的 MIME 流并将电子邮件正文和电子邮件附件作为单独的文件流返回。

I am using mime4j for this purpose.

Following are the problems that I am stuck on:

  1. How can I test whether the email body file or email attachment file that I parsed out via mime4j from MIME stream is correct?

I have a large corpus of emails available in raw mime form that I want to run my tests on and need some automated way to determine which ones might be breaking the mime parsing by mime4j and tweak the code for that.

4

2 回答 2

1

您可以解码附件,然后重新编码。如果重新编码的流与原始流匹配(逐字节),那么这是 mime4j 正确处理它们的好兆头。

于 2011-06-30T11:02:09.687 回答
0

我最初使用 mime4j 解析出一个样本语料库 *.eml 文件。我不得不手动检查它们是否存在解析错误,因为我没有其他好的选择。

现在,我使用早先解析出来的电子邮件作为测试平台,在上面迭代地检查解析出的结果。

于 2012-07-11T07:31:49.410 回答