0

Can anybody tell me how to use mstor to read mbox mail messages on windows

Thanks in advance...

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
user972590
  • 251
  • 1
  • 5
  • 13

2 Answers2

1
//Remember to add the properties in above code.

 this.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.mbox.bufferStrategy", "mapped");
            this.properties.setProperty("mstor.metadata", "disabled");
            this.properties.setProperty("mstor.mozillaCompatibility", "enbled")
Animesh Raj Jha
  • 2,704
  • 1
  • 21
  • 25
1

An example url for accessing an mstor mailbox might be:

mstor:c:/mail on a Microsoft Windows machine

Reading messages from a local store:

Session session = Session.getDefaultInstance(new Properties());

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

// read messages from Inbox..
Folder inbox = store.getDefaultFolder().getFolder("Inbox");
inbox.open(Folder.READ_ONLY);

Message[] messages = inbox.getMessages();
Alon Adler
  • 3,984
  • 4
  • 32
  • 44
  • Hi Alon, when i say store.connect(), its not connecting to the store which is specified in the url name, its connecting to some thing like mstor://username@ (System username). – user972590 Oct 05 '11 at 09:26
  • i copied the mstor jars to classpath, DO i need to make any other configurations? – user972590 Oct 05 '11 at 09:31
  • You need to include the mstor, commons-logging and jdom JARs in your classpath. – Alon Adler Oct 05 '11 at 09:35
  • yes I done the same thing, but i am not able to connect to the url which i specified. connecting to some thing else which i mentioned above. – user972590 Oct 05 '11 at 09:39
  • Did you also include the JavaMail requirements (i.e. mail.jar, activation.jar) ? – Alon Adler Oct 05 '11 at 09:50
  • try using store.connect(host, username, password); with your username info, maybe it will help. Put host as 127.0.0.1 or localhost. – Alon Adler Oct 05 '11 at 09:59
  • yes, i included mail.jar and activation.jar also, and tried with providing username and password, its giving, mstor://username@localhost – user972590 Oct 05 '11 at 10:17
  • Hi Alon, Do we need to create the repository using mastor JCR, before going to connect to the store to read mbox email message? – user972590 Oct 10 '11 at 08:53