Can I use Redis with Roundcube?
Will it help with fast email search i handel inbox with 1M+ email inbox at tempmail.im ?
Yes — you can use Redis with Roundcube, but it won’t speed up email search the way you’re probably hoping. Let’s break this down carefully:
✅ What Redis can do for Roundcube
Roundcube itself is a webmail client; it connects to your IMAP server (like Dovecot or Cyrus) and does not store or index emails itself. Redis can be used in Roundcube primarily for:
- Caching sessions (faster login/session handling)
- Caching address books, configuration, and metadata (faster UI)
- Caching plugin data (e.g. for the global address book or autocomplete)
Roundcube has a memcache and redis cache backend you can enable in config.inc.php:
$config['cache'] = true;
$config['cache_driver'] = 'redis';
$config['redis_host'] = '127.0.0.1';
$config['redis_port'] = 6379;
That will make Roundcube feel a bit snappier, but it won’t help with full-text search or listing large mailboxes.
Where email search performance actually comes from
The IMAP server (e.g. Dovecot) is what handles searching, sorting, and indexing your 3M+ messages. If searches are slow, you’ll get more benefit from optimizing the IMAP side rather than Roundcube.
For large-scale mailboxes:
🧭 Dovecot full-text search options
If you use Dovecot, enable its Fts (Full Text Search) plugin:
- fts_lucene
- fts_solr
- fts_elastic (recommended for very large mailboxes)
- fts_xapian
Example config (Dovecot 10-fts.conf):
mail_plugins = $mail_plugins fts fts_xapian
plugin {
fts = xapian
fts_xapian = partial=3 full=20 verbose=1
}
This builds a fast index, allowing instant full-text search from Roundcube.
Best practice setup for your scale (3M+ emails)
| Component | Purpose | Recommended |
|---|---|---|
| Dovecot | IMAP server | Enable FTS (Xapian or Elastic) |
| Roundcube | Webmail frontend | Use Redis for session/cache |
| Redis | Cache | Speeds up UI, not search |
| Storage | Maildir or object storage | Optimize I/O performance |
| DB | MySQL/PostgreSQL | Tune indexes for Roundcube tables |
💡 Summary
- ✅ You can use Redis with Roundcube for caching and sessions.
- ⚠️ It will not make email search faster — IMAP handles that.
- 🚀 To make search fast, enable Dovecot’s full-text indexing (fts_xapian or fts_elastic).