Michael wrote:
Hello.
I was looking at the header and structure objects that are stored in the database. It doesn't seem like the message body is stored in the object. IMAP connections are really expensive for web-based mail clients since they have to be re-established every time a php page is executed. If the message body was stored in the database you could avoid making the IMAP connection and probably shave a second or two off the time it takes to (re)read a message. You could even take is a step further and store the whole body in a blob so attachments could be read without making an imap connection. This would only really start to help when you revisit the message, the first time would take the most time.
This will probably bloat the database like hell. Consider thousands of users having thousands of messages with attachments. If the size of the database grows, it takes even longer to load data because of a higher seeking time. Also opening a single message is less expensive than listing hundred of headers. This is why we just cache headers.
The second reason are multipart messages. RoundCube is currently not able to parse a mulipart message and extract its parts. This is all done by the IMAP server, RoundCube just requests the structure and then loads one single part of the message on demand.
Parsing mime messages isn't that simple because most mails are malformed. IMAP servers implement that because it's part of the specification. So why re-invent the wheel?
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/