Roundcube Community Forum

Release Support => Pending Issues => Topic started by: redhawk699 on August 09, 2016, 11:26:04 AM

Title: Reading cached message from database
Post by: redhawk699 on August 09, 2016, 11:26:04 AM
Hi all, i've integrated Roundcube 1.2.1 into a CRM application and enabled the message caching feature in config.inc.php.
Now, i need to read the mail subject from the db. I see the messages stored in "cache_messages" but i'm wondering how to read the "data" column to extract the informations. As you can see in the attachment, there is an encoded/serialized string and i don't know how to read it. Anyone can help?
Thanks in advance!
Title: Re: Reading cached message from database
Post by: JohnDoh on August 11, 2016, 02:09:53 AM
are you using the rondcube framework? you can get how it works from rcube_cache->read_record() but basically I think you need to call rcube_db::decode()
Title: Re: Reading cached message from database
Post by: redhawk699 on August 12, 2016, 06:10:10 AM
I managed to read the data in another way: in rcube_imap.php, in the "fetch_headers" function, it's possible to read the headers because they aren't serialized yet. Here i extract the subject, date, id and sender in every header and insert them in a new table i created on the db. Now i can read what i need from another application by doing a sql select on "headers" table. :)