Dovecot Error Fatal: Multiple files for module var_expand_crypt

The error on dovecot service "Fatal: Multiple files for module var_expand_crypt" indicates that the Dovecot mail server configuration has ran into a problem where the var_expand_crypt plugin is loaded or referenced multiple times, which is not allowed for the service.
During startup, Dovecot loads its modules from: /usr/lib64/dovecot/
If more than one module exists for the same feature, Dovecot cannot determine which one to load and stops the login services with a fatal error.
Potential Causes
Common reasons this issue occurs:
- Multiple Dovecot versions installed
Two different package versions for the service may exist on the server.
rpm -qa | grep dovecot
Example Output:
$ rpm -qa | grep dovecot
cpanel-dovecot-2.3.21.1
cpanel-dovecot-2.4.2
- Partial package upgrade
A package upgrade may install a new version without fully removing the older version.
- Leftover module files
Old modules may remain inside /usr/lib64/dovecot/ after an upgrade.
Steps to Resolve
Step 1: Check installed Dovecot packages
rpm -qa | grep dovecot
If multiple versions are installed, remove the older one.
Step 2: Remove the older Dovecot package
dnf remove cpanel-dovecot-2.3.21.1-2.cp108~el9.x86_64
This removes the outdated package and prevents duplicate modules from loading while the service is running.
Step 3: Verify remaining packages
rpm -qa | grep dovecot
Expected output:
$ rpm -qa | grep dovecot
cpanel-dovecot-2.4.2
cpanel-dovecot-pigeonhole-2.4.2
Only one version files should remain.
Step 4: Restart Dovecot
systemctl restart dovecot
Or on cPanel servers:
/scripts/restartsrv_dovecot
Check the service status:
systemctl status dovecot
Verify listening ports:
ss -ltnp | egrep ':(110|143|993|995)\s'
Summary
Issue:
Fatal: Multiple files for module var_expand_crypt
Cause:
Multiple Dovecot versions installed, causing duplicate module files.
Fix:
Remove the older package and restart the Dovecot service.

