Zend certified PHP/Magento developer

Dovecot and two types of password ecryption in virtual users DB field

I need to migrate from courier imap to dovecot imap

Can Dovecot IMAP use two types of encrypted passwords on virtual users DB pw field?

I have DB with password field that is encrypted in mysql format encrypt (MD5) so its limited to 8 chars and sha512. Courier is working with that and user can login using old enryption method and sha512 encrypted passwords.

Some users have old enryption and some users have new sha512 encryption.

is Dovecot will work too?

courier imapd has

MYSQL_CRYPT_PWFIELD    password

What Dovecot should have?

dovecot-sql.conf

default_pass_scheme = SHA512-CRYPT

dovecot.conf

auth default {
  mechanisms = digest-md5
  passdb sql {
    args = /etc/dovecot/dovecot-sql.conf
  }

will this work as courier?