本文介绍了如何使用mstor阅读mbox电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用mstor读取mbox电子邮件,但是我无法使用传递的urlName名称连接到商店,默认情况下其连接到我的Macbine上的其他
位置。我是否需要在继续连接到商店之前使用mstor JCR创建商店?
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 otherlocation 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);
任何建议都是有帮助的
感谢
推荐答案
//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);
这篇关于如何使用mstor阅读mbox电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!