dovecot: imap-login: Disconnected auth failed user=<>,

NOT A BUG: This problem happens when one does not run the post-config wizard. In this case, the file /etc/usermin/mailbox/config is left at the default configuration mail_system=4. Changing this to mail_system=1, fixes the problem.

Original Message: I have to report a problem with Dovecot & Usermin.
The problem affects ONLY domain users (main virtual server users) - all additional users created, can login to Usermin and access emails ok.

So when I create a new virtual server called test.com, I click the 'login to usermin' button from 'edit user'.
Immediately you will see this in syslog and mail.log:
Jul 7 00:49:17 ns1 dovecot: imap-login: Disconnected (auth failed, 1 attempts in 6 secs): user=<>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured, session=<abVjLgqNer1/AAAB>
Jul 7 00:49:17 ns1 dovecot: imap-login: Disconnected (auth failed, 1 attempts in 8 secs): user=<>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured, session=<eapMLgqNeL1/AAAB>
Jul 7 00:49:28 ns1 dovecot: imap-login: Disconnected (auth failed, 1 attempts in 10 secs): user=<>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured, session=<4ynZLgqNfL1/AAAB>
Jul 7 00:49:45 ns1 dovecot: imap-login: Disconnected (auth failed, 1 attempts in 27 secs): user=<>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured, session=<sKHZLgqNfr1/AAAB>
Jul 7 00:49:45 ns1 dovecot: imap-login: Disconnected (auth failed, 1 attempts in 17 secs): user=<>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured, session=<t5RqLwqNgL1/AAAB>

auth.log:
Jul 7 00:49:06 ns1 perl: pam_unix(usermin:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost= user=root

I found similar issues here:
https://www.virtualmin.com/node/38732
The difference is that my user is shown blank in the log. Also, I have no inbox.imap file in /home/test/.usermin/mailbox
and here:
https://www.virtualmin.com/node/64389

dovecot -n

2.2.33.2 (d6601f4ec): /etc/dovecot/dovecot.conf
Pigeonhole version 0.4.21 (92477967)
OS: Linux 4.15.0-54-generic x86_64 Ubuntu 18.04.2 LTS

auth_mechanisms = plain login
disable_plaintext_auth = no
mail_location = maildir:~/Maildir
mail_privileged_group = mail
namespace inbox {
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
passdb {
driver = pam
}
protocols = imap pop3 pop3
ssl_ca = </dovecot.key.ca
ssl_cert = </etc/dovecot/private/dovecot.pem
ssl_cipher_list = ECDHE-RSA-AES256-SHA384:AES256-SHA256:AES256-SHA256:RC4:HIGH:MEDIUM:+TLSv1:+TLSv1.1:+TLSv1.2:!MD5:!ADH:!aNULL:!eNULL:!NULL:!DH:!ADH:!EDH:!AESGCM
ssl_client_ca_dir = /etc/ssl/certs
ssl_key = # hidden, use -P to show it
userdb {
driver = passwd
}
local_name test.com {
ssl_cert = </home/test/ssl.cert
ssl_key = # hidden, use -P to show it
}
local_name www.test.com {
ssl_cert = </home/test/ssl.cert
ssl_key = # hidden, use -P to show it
}
local_name mail.test.com {
ssl_cert = </home/test/ssl.cert
ssl_key = # hidden, use -P to show it
}

Status: 
Active

Comments

UPDATE: I can confirm that this does not happen before SSL certificates are requested from Let's Encrypt. I will run some tests and let you know at which stage this issue appears.

NOT A BUG: This problem happens when one does not run the post-config wizard. In this case, the file /etc/usermin/mailbox/config is left at the default configuration mail_system=4. Changing this to mail_system=1, fixes the problem.