1

我正在使用 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);

任何建议都有帮助

提前致谢..

4

1 回答 1

3
//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);
于 2012-07-15T21:50:46.070 回答