• Post Reply Bookmark Topic Watch Topic
  • New Topic

where does JavaMail stores received messages?  RSS feed

 
Sergey Kargopolov
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good day!
I am interested in where does JavaMail stores messages when they are read from Mail Server?

Thank you!
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where ever you choose to put them. You connect to your POP3 server, read the messages (which might pull them off the server depending on how its configured) then its up to you where you want to store them. Most MUAs store messages locally on the file system.
 
Sergey Kargopolov
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for your reply Paul!

How do I find where in FileSystem messages are stored? How can I set another directory for messages if I need to do it?


Thank you.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How do I find where in FileSystem messages are stored?

Messages are not stored by JavaMail. All JavaMail gives you is access to messages in a mail box (i.e. on your POP3 server). If you need to store messages locally, and you don't want to write the storage code yourself, you need to use a "local store provider". See the JavaMail third party downloads page for one.
 
Sergey Kargopolov
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul, thank you very much for your reply!

I am still alittle bit confused. My Desktop Email client has a check box which is if selected does not leave a copy of messages on Mail Server. So after recieving messages using my Desktop Email Client if I try to access my email account from different Desktop Email client or even another web client I will recieve no messages. Because I have already recieved them and they are on my local hard drive and no longer on Email Server Machine. But where? in a database of my Desktop Email Client?

So now I have codded a simple Web Email Client using JavaMail that recieves emails from POP3. And I am still very interested where are the messages stored on my local hard drive because they are displayed in my Web Email Client Inbox even though they are no londer on Mail Server Machine.

can you advise me?
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sergey Kargopolov:
Because I have already recieved them and they are on my local hard drive and no longer on Email Server Machine. But where? in a database of my Desktop Email Client?
Yes, exactly. If you want to know exactly where, consult the documentation for your e-mail client. Or contact their help desk or whatever support they provide.

As for the rest of your question, it just raises more confusion. Not only do you have a desktop e-mail client, you also have web e-mail. Does it access the same mail server as the desktop client, or is it different?

However I think you are confusing those programs with magic. They are e-mail clients that were written by people. Presumably the desktop client was designed to store copies of the messages locally on your disk. If you want to write an e-mail client using JavaMail, you could also design it to store copies of the messages locally. So don't ask "Where are they stored?" because that is up to the designer of the program. Namely you.
 
Sergey Kargopolov
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Paul for your reply.
I am sorry for confusing you. You did not get me right.

I totaly understand that my desktop email client stores emails localy. Because they are with me for 5 years already and I can back up them and even import into another Email Client from FireFox for example...

My question is... why, when I recieve messages from local email account localhost@localhost or myself@localhost using my own Web Client codded using JavaMail(WEB INTERFACE) these messages are still always inside my INBOX even when I restart Web application and restart Servlet Container (Tomcat)...

1. My Web Email client accesses local email service POP3(localhost) and reads emails from Folder.
2. I dispay these messages on web page (Inbox .jsp page).
3. I check POP3 account on server machine to see if there are any other messages left.. and there are non. zero messages left...
4. I restart Tomcat or Web application, then access it again and I see emails in my INBOX ... how come?

so my question is where do they come from? where are they stored? they do not longer come from POP3 because I have recieved them from there already and my POP3 account says that I have 0 messages.

that is why I was asking where are these messages stored on my local Hard dirive? in what form? where to look for them?
This is a very strange situation.
...

Paul, thank you for your links.. I have visited couple of those sites and it is very interesting and helpful information.

Thank you.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!