Emails don't appear in webmail searches

Emails don't appear in webmail searches

When you search for an email in Roundcube (cPanel) and it doesn't appear in the results even though it exists in your mailbox, the problem almost always stems from the server not having properly indexed the messages. For example, if you try to locate an email with the subject "Invoice" and can't find it in the search, but when checking manually it is indeed in the inbox, it means the email indexes are corrupted or incomplete.

The main cause is corrupted or outdated FTS (Full Text Search) indexes in Dovecot's search engine. This can occur due to:

  • Service interruptions during indexing
  • Permission issues with system files
  • High processing load during indexing processes

Step-by-step solution

Step 1: Access the server via SSH

Connect to the server as root user:

ssh root@your-server.com

Step 2: Run reindexing commands

For a specific account with few folders, execute:

# Rescan FTS indexes
doveadm fts rescan -u user@example.com

# Reindex inbox
doveadm index -u user@example.com -q INBOX

# Reindex sent mail
doveadm index -u user@example.com Sent

For accounts with multiple folders

If the account has many custom folders, use this command to index everything:

# Index ALL folders at once
doveadm index -u user@example.com -q "*"

What does each command do?

  • doveadm fts rescan: Marks all emails for reindexing
  • doveadm index -q INBOX: Rebuilds inbox index
  • doveadm index Sent: Rebuilds sent mail index
  • doveadm index -q "*": Indexes all folders automatically

To confirm the solution worked:

  1. Access the webmail of the affected account
  2. Perform a search for a term you know exists
  3. Verify that all expected results appear
  4. Test searches in different folders

Need additional help? Contact our technical support team for personalized assistance with your server.

    • Related Articles

    • How to install and configure Nginx as a reverse proxy in cPanel/WHM 🚀

      What is Nginx and why use it with cPanel? Nginx is a high-performance web server that can function as a reverse proxy in front of Apache on cPanel servers. This configuration allows Nginx to handle static files (images, CSS, JavaScript) while Apache ...
    • 'Never Finished' error in JetBackup 5

      The "Never Finished" error in JetBackup happens when a backup job doesn’t complete properly, leaving the process stuck in a "never finished" state. This issue can pop up for a bunch of reasons, like JetBackup services acting up, cache problems, or ...
    • Basic SSH commands

      FILE MANAGEMENT Copy file cp -a archivo.zip archivocopia.zip Create a 404.html file touch /home/usuario/public_html/404.html Compress directory zip -r archivo.zip /home/usuario/public_html/directorio Extract file unzip archivo.zip View contents of a ...