Hello,
in addition to our mail system, we have some other systems which needs to know how many messages, and how many unread messages, a user has in his/her inbox (maildir).
Currently, we have a mod_perl script which takes a mail address as input, and then traverses the maildir, and outputs the number of unread messages.
Our challenge is that the maildirs are located on a SAN, and traversing a maildir is slow. We currently have more than 100 requests pr. second, which we handle with caching, and spreading the load across different servers.
I'm looking into the possibility of either using dovecots index files, or having dovecot update a database with total number of messages/number of unread messages.
Question:
- if I'm using perl, is there any way I can read in the information in the index files? Is the data formatted in some standarized way, so that I can parse it, or use a module which read in the data?
(if I can read the indexes in wrapper scripts to imap/pop/deliver, then I could probably update a database with the information)
- how would you proceed, if the aim is to end up with dovecot notifying a database regarding the number of messages, and unread messages?
-- Erland Nylend