Problem with Dovecot restore on new install

SYSTEM INFORMATION
OS type and version Debian 12
Webmin version 2.520
Virtualmin version 7.40.1 pro
Webserver version Apache 2.4.65
Related packages SUGGESTED

I performed a hardware generation change under virtualmin.
Then I created a new clean installation of virtualmin and restored the domains from the backup. The certificate on the default domain was changed to one of the domains, which I did not want. And my Dovecot configuration broke and I cannot connect to accounts from client mail programs like Thunderbird. Apparently there is something with the certificates, but I cannot quickly identify it. The problem probably occurred because the configuration of the new installation was different from the configuration of the backed up domains. But this is what we wanted to achieve - restore the old configuration files according to the new server configuration. It did not work. However, I would need to generate completely new configuration files for Dovecot and Apache according to the current configuration, including the configurations of individual domains, which are already restored on the server. How to do that? Is there a debugged procedure for this?

Hello,

We have a bug in Virtualmin 7.40.1. We just released Virtualmin 7.50.0 last night. Later, probably today, @Joe will push it to Virtualmin repositories and make it available for everyone.

Meanwhile, you should look into manually fixing /etc/dovecot/dovecot.conf file.

Sorry about that!

And what does the correct fix look like?
In 10-ssl.conf there was no

ssl_cert = </etc/dovecot/private/dovecot.pem
ssl_cert = </etc/dovecot/private/dovecot.key

For .pem and .key I used a certificate from the default domain.
Without this entry, dovecot reported an error:

imap-login: Error: Failed to initialize SSL server context: Can't load SSL certificate (ssl_cert setting): The certificate is empty: user =<>, rip=109.193.222.30, lip=62.168.116.188, session=<82eRAHZB28Jtwd4e>

I filled in the records and it reports an error:

imap-login: Error: Failed to initialize SSL server context: Can't load SSL certificate (ssl_cert setting): The file contains a private key (you've mixed settings): user=<>, rip=109.193.222.30, lip=62.168.116.188, session=<SuGrFXZBG8Ntwd4e>

And I don’t know what the correct correction is.

And of course I fixed the broken local_name section in the dovecot.conf file. But since the error with dovecot persisted, see the post above, I commented out the entire section. However, the error mentioned in the previous post persists.Login do server without starttls and with plain password working.

Fixed. Incorrectly entered configuration option.
Incorrect:

ssl_cert = </etc/dovecot/private/dovecot.pem
ssl_cert = </etc/dovecot/private/dovecot.key

This mistake is the source of the error

imap-login: Error: Failed to initialize SSL server context: Can't load SSL certificate (ssl_cert setting): The file contains a private key (you've mixed settings): user=<>, rip=109.193.222.30, lip=62.168.116.188, session=<SuGrFXZBG8Ntwd4e>

Correct:

ssl_cert = </etc/dovecot/private/dovecot.pem
ssl_key = </etc/dovecot/private/dovecot.key

I didn’t notice it in the rush.

Alright, so all good now?

By the way, Virtualmin 7.50.0 is out, and it won’t break Dovecot configs anymore.

2 Likes

Yes, everything is OK for me now. And I apologize for the mix-up in the thread After server Virtualmin restore, email aliases are invalid . I absolutely did not realize that I mixed up the threads.

1 Like