Author Topic: Question about how roundcube operates  (Read 4717 times)

Offline gbainbridge

  • Jr. Member
  • **
  • Posts: 10
Question about how roundcube operates
« on: May 14, 2008, 11:08:34 AM »
When a mail is read in roundcube, is the email text stored within the server running roundcube, or is it read from the imap server every time that the email is accessed? If that read mail is then deleted from the imap server is it still stored within roundcube?

Gary.

Offline bpat1434

  • Administrator
  • Hero Member
  • *****
  • Posts: 673
Question about how roundcube operates
« Reply #1 on: May 17, 2008, 10:30:56 AM »
Depends on how you have it set up ;)

Messages should stored in the database, and if deleted, deleted from the database.  If you have caching enabled, messages will be stored for the max length of the time as defined in main.inc.php.
 
  

Offline gbainbridge

  • Jr. Member
  • **
  • Posts: 10
Stored messages
« Reply #2 on: May 19, 2008, 06:06:16 AM »
O.K. thanks.

I have caching turned on in the config file, and have set the max length of time to a period longer than the time that my email is held on my Imap server (4 weeks as opposed to 3 days*). I cannot see the text of the messages in the messages database (using phpMyAdmin), so where is it stored?

Gary.

*My normal PC based email client is set to delete all read mail from the server after 3 days.
« Last Edit: May 19, 2008, 06:44:55 AM by gbainbridge »

Offline bpat1434

  • Administrator
  • Hero Member
  • *****
  • Posts: 673
Question about how roundcube operates
« Reply #3 on: May 19, 2008, 12:56:16 PM »
I'm not sure text of messages is stored, but headers should be.

The point of caching is so that there are fewer trips to the IMAP server.  So if you have say 400 messages, and they're all cached, when you return to your inbox, a quicker and faster query to the IMAP server for just "new" mail is run, instead of the longer and more intensive "all" mail.  When reading a message, I believe that it still has to fetch the entire message, just the headers are cached.
 
  

Offline gbainbridge

  • Jr. Member
  • **
  • Posts: 10
Question about how roundcube operates
« Reply #4 on: May 19, 2008, 06:33:51 PM »
Looking at the the database, that's what appears to be the case. Headings and structure are stored, but not the message itself.
I feel that's a pity as apart from anything else it would speed up message display. I wonder how difficult it would be to implement?

As an example, I'm thinking in terms of my mobile phone which stores the actual messages the first time they are read so that it doesn't need to contact the server if you want to review the mail later.

Incidentaly, on the same subject, I can't help but notice that if you preview an email, then double click to open it fully, it appears to be fetched from the imap server again.  

Gary.
« Last Edit: May 19, 2008, 06:36:48 PM by gbainbridge »

Offline bpat1434

  • Administrator
  • Hero Member
  • *****
  • Posts: 673
Question about how roundcube operates
« Reply #5 on: May 19, 2008, 06:40:08 PM »
Well, then the issue becomes speed and space.  It's much cheaper to store just the headers (like many mail clients (i.e. Thunderbird, Outlook)) and retrieve the messages at request.

If you download all the messages you read and store them in the database, the size of the database could really explode (depending upon number of users) and then what do you do with attachments?  Store them in the filesystem, or in the database?  Get them from the IMAP server at request?

You see where issues come in ;)  It wouldn't be too difficult to implement, a new column in the messages table, and the addition of the caching in the proper rcube_*.inc file.
 
  

Offline gbainbridge

  • Jr. Member
  • **
  • Posts: 10
I take your point but...
« Reply #6 on: May 28, 2008, 10:59:29 AM »
Hmm. My reply here has disappeared, but what I basically said was that the same logic could be used as a reason to not hold mail on the IMAP server.

In my case as I'm simply running RoundCube on a personal server for the convenience of my family and myself when away from home, I would like to see the actual messages cached, as I often go back and view messages days, weeks or even months later. My ISP removes messages from the IMAP server after 45 days, whether read or not, so I will lose these messages via RoundCube if they are not cached.

As my server has a 500 Gbyte hard drive, the amount of memory required is not really an issue and I won't, unlike the IMAP server, be reading and consequently storing spam.

Also the size of the header is often larger than the message, except when attachments are involved. I can see the logic of leaving the attachments on the IMAP server, as in most cases I would only download these once, but I can see that attachments complicate the necessary code.

Gary.