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 cPanel on Your Server or VPS: Updated Guide by Distribution

      cPanel & WHM is the most widely used control panel in the web hosting industry. If you have a dedicated server or VPS with Webzi (or any other provider), this guide shows you how to install cPanel from scratch on the currently supported operating ...
    • 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 ...
    • How to Manually Move a cPanel Account to Another Partition

      cPanel includes a native feature called rearrange that allows moving accounts between partitions from WHM. However, this process requires enough free space on the source partition to create a temporary copy, and when the partition is nearly full, the ...
    • How to List All CronJobs for Every cPanel User

      Cron jobs are scheduled tasks that run automatically on the server at specific times. These tasks can include updates, backups, sending scheduled emails, among others. Knowing the active cron jobs for each user gives you a clear view of the automated ...
    • Fix MySQL Stored Procedures Import Error in cPanel

      When working with MySQL databases that include stored procedures, it's common to encounter errors during import in shared hosting environments with cPanel. These errors are usually related to the DEFINER parameter, which specifies the owner of the ...