Troubleshooting Dovecot in DirectAdmin – Fixing IMAP Errors, Authentication Issues, and SSL Certificate Checks

Dovecot is the IMAP/POP3 server used by DirectAdmin. Sometimes users encounter errors such as “Connection dropped by IMAP server” or “unknown user” during authentication. This guide explains how to fix corrupted Dovecot indexes, understand authentication logs, hide unnecessary warnings, and manually inspect SSL certificates on IMAP ports 143 and 993.

Dovecot in DirectAdmin

~2 min read · Updated Mar 1, 2026

1. ERROR: Connection dropped by imap server – Query: SELECT "INBOX"


If your webmail or email client shows this error:


ERROR: Connection dropped by imap server
Query: SELECT "INBOX"

First, check the mail log for clues:


/var/log/maillog

Common cause: Corrupted Dovecot index files

This often happens after Dovecot upgrades. The fix is simple: delete the index files so Dovecot can rebuild them.

Steps:


cd /home/username/imap/domain.com/user/Maildir
rm -f dovecot*

After the user logs in again (webmail or email client), Dovecot will recreate the indexes and the issue should be resolved.

---

2. Why do I see: shadow([email protected],127.0.0.1): unknown user?


Dovecot uses two separate authentication databases:

  • System accounts/etc/shadow
  • Virtual email accounts/etc/virtual/domain.com/passwd

A valid email account exists in only one of these databases. Dovecot checks both, so if the user is not found in the first database, you will see:


shadow([email protected],127.0.0.1): unknown user
passwd([email protected],127.0.0.1): unknown user

This is normal and does NOT indicate a problem.

Hide these messages:

Edit /etc/dovecot/dovecot.conf in the “Authentication processes” section:


auth_verbose = no
auth_debug = no
---

3. How to Manually Check the IMAP SSL Certificate (Ports 143 & 993)


Many email clients now require valid SSL certificates. You can manually inspect the certificate used by Dovecot.

Check port 143 (STARTTLS):


openssl s_client -connect server.hostname.com:143 -starttls imap -servername server.hostname.com

Check port 993 (IMAPS):


openssl s_client -connect server.hostname.com:993 -servername server.hostname.com

What to look for:

  • CN (Common Name) must match the server hostname
  • Check the subject= field in the certificate output

Example:


-----END CERTIFICATE-----
subject=/OU=Domain Control Validated/CN=*.directadmin.com

Exit the IMAP session:


01 logout

If the certificate is self signed:

You will see:


Verify return code: 18 (self signed certificate)

Note: The -servername parameter enables SNI, allowing Dovecot to present the correct certificate when multiple certificates are configured.

Written & researched by Dr. Shahin Siami

Related Articles

Email Client Configuration & Dovecot Quota/Monitoring Guide for DirectAdmin Users

This guide explains how to configure popular email clients (iPhone Mail, Thunderbird, Gmail POP/SMTP), enable Dovecot LMTP quota warnings, and check the last login time for all email accounts on a DirectAdmin server. It includes step by step instructions, recommended IMAP/SMTP settings, and useful administrative scripts.

Continue

DNS Troubleshooting in DirectAdmin – When named is Running but Domains Do Not Resolve

Sometimes the named (BIND) service runs normally, yet DNS queries fail or domains do not resolve from outside. This guide provides a complete troubleshooting workflow for checking named listeners, firewall rules, named.conf configuration, DNS propagation issues, subdomain problems, resolv.conf errors, and common Apache/Nginx misconfigurations.

Continue

Managing DNS Records in DirectAdmin – Complete Practical Guide for Administrators

DirectAdmin provides a powerful DNS management system that allows administrators to control TTL values, create SRV records, enable DNSSEC, manage subdomain delegation, automate TLSA records, and perform mass DNS updates. This guide explains all essential DNS operations in DirectAdmin with real-world examples and best practices.

Continue

DNS and Nameservers in DirectAdmin – Complete, Practical, and Professional Guide

DNS is the backbone of the internet, responsible for translating domain names into IP addresses. DirectAdmin allows you to create private nameservers (ns1/ns2), manage DNS zones, configure DNS clustering, use external DNS, and troubleshoot common issues. This guide provides a complete, clear, and practical explanation of DNS concepts and their implementation in DirectAdmin.

Continue

CustomBuild in DirectAdmin – Complete Guide to Installation, Updates, Configuration, and Advanced Customization

CustomBuild is DirectAdmin’s primary software management system. It installs, updates, configures, and rebuilds essential services such as Apache, Nginx, PHP, MariaDB/MySQL, Exim, Dovecot, FTP servers, and more. Because most components are compiled from source, CustomBuild offers exceptional flexibility, fast access to new versions, and optimized performance.

Continue

The Evolution Skin in DirectAdmin – Complete Guide, Features, Customization, and Professional Tips

Evolution is DirectAdmin’s modern, responsive, and fully JSON powered interface. It is not just a visual redesign—it introduces a new communication layer, advanced customization options, plugin friendly architecture, and a significantly improved user experience. This guide explains how Evolution works, how to enable it, how to customize it, and how to manage translations and legacy skins.

Continue