Roundcube’s user interface refreshes every now and then in a configured time interval. This is what many imap clients do (or did historically) and what most users understand and accept. I’m not going into details how it’s implemented internally right now, but it’s based on existing IMAP standards (and their limitations). The question is: can we have instant updates instead?
Short answer is: yes, we can.
The old set of IMAP standards, including IDLE extension, is not a perfect set to achieve that. Fortunately nowadays IMAP servers provide more capabilities, from which we can built a working solution. I already created a ticket about this. Let’s see what it is about.
Dovecot or Cyrus IMAP provide notification systems that can send notifications about some actions/events that imap client could be interested in. To utilize such notifications in Roundcube we’d need a http service that receives these notifications and (using websocket connections) sends them to web browsers (logged-in users). This would happen live, which means user would be notified immediately, by new-message notification, update of unseen messages count, update of messages list, etc.
Sounds simple and indeed there is already technology that makes it easily possible, even using PHP. I created a proof-of-concept already. Of course, there’s many things not implemented and some general questions about that implementation to be answered.
- Is PHP/Swoole reliable enough for this use-case?
- What is performance of such solution and how to scale it?
- Are there other IMAP servers that support some kind of notification systems?
There are also many implementation details to consider. For example, recognizing the event is caused by current user session (don’t need to refresh something that does not need to), recognizing that specific event is relevant at all, handling events on shared folders, etc.
Any help will be appreciated and will help to make it happen sooner than later. I’m especially interested in some help with deployment and reliability testing, right now.