在Windows上使用Java处理MailDir格式的问题 [英] Issue processing MailDir format with Java on Windows

查看:65
本文介绍了在Windows上使用Java处理MailDir格式的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这确实是两个问题,但它们之间有着密切的联系.

This is really two questions, but they are very closely related.

我正在开发一个Java应用程序,它将处理以UNIX样式MailDir格式存储的电子邮件.我正在使用JavaMail API,发现 JavaMailDir 应该可以用作能够读取我的电子邮件格式的提供程序在里面.

I am developing a Java application that will process emails stored in the UNIX style MailDir format. I am using the JavaMail API, and found JavaMailDir that should work as a provider capable of reading the format my email will be in.

我遇到的问题是JavaMailDir似乎总是希望您的邮件文件夹(传递到store.getFolder()的邮件文件夹)以点开头.我只能使用Windows计算机进行开发和初始测试.因此,为了测试,我从Linux系统复制了一些示例电子邮件和文件夹结构.当我尝试读取消息时,出现异常,因为无法读取文件.我可以通过API调用看到消息,因此这些消息存在于文件夹中.似乎以点号作为文件夹名称的第一个字符似乎中断了在Windows上打开文件的过程.

The issue I am running into is that JavaMailDir seems to always expect your mail folder (the one passed into store.getFolder()) to begin with a dot. I only have access to a Windows machine for my development and initial testing. So, to test I copied some sample emails and the folder structure from a Linux system. When I try to read messages I get an exception because the file cannot be read. I can see through the API calls that messages so exist in the folders. It seems having the dot as the first character of a folder name seems to break opening the files on Windows.

我的问题是是否有任何解决方法可以使它在Windows上运行,或者可能是另一个提供相同功能并在Windows上运行得更好的提供商?

My question would be is there any work around to get this working on Windows, or perhaps another provider that would provide the same capability and perhaps work better on Windows?

推荐答案

因此,在Windows上进行开发时,似乎没有使用JavaMailDir的好方法.最终,我能够构建 Plexus Maildir 我在另一篇文章中提到了.至少这将使我能够在Windows机器上进行开发,直到我开始在真实的Linux环境中进行测试为止.

So, it seems like there is no really good work around to use JavaMailDir while doing my development on Windows. Ultimately I was able to build a version of Plexus Maildir that I saw referenced in another post. This will at least allow me to do development on a Windows machine until I move to testing in a real Linux environment.

这篇关于在Windows上使用Java处理MailDir格式的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆