Openfire can be enabled to pass authentication to underlying database.
This might be useful if passwords stored by mysql PASSWORD function or some other way inaccesible from openfire directly.
There is a library available to enable such behaviour.
It will pass authentication process to database.
Remember to build from source, attached file is just a nothing but a recent snapshot (working though).
See linked wiki for configuration and Dovecot example