mysql – different password for Roundcube and external IMAP / SMTP

Is it possible that the Roundcube password and the password used for IMAP and SMTP connections (for example, when using an e-mail application), are different?
I would like to do this because I have configured 2-factor authentication via a plugin on round cube, but this is essentially useless for the moment. But since the Roundcube password is the same as the IMAP / SMTP password, someone with this password could still access email through a third-party email application and bypass Roundcube.
Are there any instructions available on how to proceed?
Thank you!