如何使用 mstor 阅读 mbox 电子邮件

发布于 2024-12-09 00:59:00 字数 503 浏览 0 评论 0原文

我正在使用 mstor 读取 mbox 电子邮件消息,但我无法使用我传递的 urlName 名称连接到商店,默认情况下它连接到其他 我的 macbine 上的位置。在继续连接到商店之前,我需要使用 mstor JCR 创建商店吗?

    Session session = Session.getDefaultInstance(new Properties());
    Store  store = session.getStore(new URLName("mstor:C:/mailbox/MyStore/Inbox"));
    store.connect();
    Folder inbox = store.getDefaultFolder().getFolder("inbox");
    inbox.open(Folder.READ_ONLY);               
    Message m = inbox.getMessage(0);

任何建议都有帮助

提前致谢..

I am using mstor to read the mbox email messages, but i am not able to connect to the store using the urlName name which i m passing, by default its connecting to other
location on my macbine.Do i need to create the store using mstor JCR before proceed to connect to the store?

    Session session = Session.getDefaultInstance(new Properties());
    Store  store = session.getStore(new URLName("mstor:C:/mailbox/MyStore/Inbox"));
    store.connect();
    Folder inbox = store.getDefaultFolder().getFolder("inbox");
    inbox.open(Folder.READ_ONLY);               
    Message m = inbox.getMessage(0);

Any suggetions are helpful

Thanks in advance..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不念旧人 2024-12-16 00:59:00
//Set the Properties as shown below:



Properties properties = new Properties();
            this.properties.setProperty("mail.store.protocol", "mstor");
            this.properties.setProperty("mstor.mbox.metadataStrategy", "none");
            this.properties.setProperty("mstor.mbox.cacheBuffers", "disabled");
            this.properties.setProperty("mstor.cache.disabled", "true");
            this.properties.setProperty("mstor.mbox.bufferStrategy", "mapped");
            this.properties.setProperty("mstor.metadata", "disabled");


//Also mstor count for messages start from 1 and not 0. so change it to 1.


Store  store = session.getStore(new URLName("mstor:C:/mailbox/MyStore/Inbox"));

    store.connect();

    Folder inbox = store.getDefaultFolder().getFolder("inbox");
    inbox.open(Folder.READ_ONLY);               
    Message m = inbox.getMessage(1);
//Set the Properties as shown below:



Properties properties = new Properties();
            this.properties.setProperty("mail.store.protocol", "mstor");
            this.properties.setProperty("mstor.mbox.metadataStrategy", "none");
            this.properties.setProperty("mstor.mbox.cacheBuffers", "disabled");
            this.properties.setProperty("mstor.cache.disabled", "true");
            this.properties.setProperty("mstor.mbox.bufferStrategy", "mapped");
            this.properties.setProperty("mstor.metadata", "disabled");


//Also mstor count for messages start from 1 and not 0. so change it to 1.


Store  store = session.getStore(new URLName("mstor:C:/mailbox/MyStore/Inbox"));

    store.connect();

    Folder inbox = store.getDefaultFolder().getFolder("inbox");
    inbox.open(Folder.READ_ONLY);               
    Message m = inbox.getMessage(1);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文