There are several Roundcube plugins that provide two-factor authentication. However, the issue I now see is that I can still simply log in via IMAP/SMTP, without 2-FA (obviously). 2-FA is (effectively) useless here.
I thought I could solve this problem by introducing application-specific passwords and doing something similar as Google is also doing with their 2-FA and applications that don't support it.
Now I thought I could automatically generate an app-specific password for Roundcube for each user, which is different to the one used to login to the Roundcube web interface. The result would be that the user can still have their own password + 2-FA for logging in to Roundcube but the same password can't be used for IMAP/SMTP directly. However, I cannot seem to find a way to configure Roundcube to use a different IMAP password to the one used to log into the web interface.
Both Roundcube and Dovecot are running on the same machine.
Am I missing something here? Is what I am doing sensible? This seems like a problem which could be solvable in a more elegant manner than what I'm attempting, so am I missing something there? All I really want is 2-FA authentication wherever possible and application-specific passwords everywhere else.
Thank you!