I've configured Postfix and Dovecot with MySQL and I can successfully send and receive email using Thunderbird (or other applications) but I must configure using manual settings and not with the automatic configuration.
The example below shows trying to add the accounts to Thunderbird using the Automatic configuration. The Username field does not have the domain component as you can see in the image. I created a test user and when I try to connect the Dovecot logs show the mysql lookup only using test rather than the full email address.
I have the dovecot-sql.conf.ext file configured like this
password_query = SELECT username,domain,password FROM mailbox WHERE username='%u';
The dovecot 10-auth.conf file is configured with %u
auth_username_format = %u
Somewhere, the domain is being dropped and I cannot work out where.
The below is an example of the text from the dovecot debug log
Sep 01 20:00:59 auth: Debug: sql(test,[IP Address],<fheTBDemh3aZpZ2C>): Performing passdb lookup
Sep 01 20:00:59 auth-worker(14793): Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth
Sep 01 20:00:59 auth-worker(14793): Debug: Module loaded: /usr/lib/dovecot/modules/auth/lib20_auth_var_expand_crypt.so
Sep 01 20:00:59 auth-worker(14793): Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_mysql.so
Sep 01 20:00:59 auth-worker(14793): Debug: sqlpool(mysql): Creating new connection
Sep 01 20:00:59 auth-worker(14793): Debug: mysql(localhost): Connecting
Sep 01 20:00:59 auth-worker(14793): Debug: conn unix:auth-worker (pid=14792,uid=115): Server accepted connection (fd=14)
Sep 01 20:00:59 auth-worker(14793): Debug: conn unix:auth-worker (pid=14792,uid=115): Sending version handshake
Sep 01 20:00:59 auth-worker(14793): Debug: conn unix:auth-worker (pid=14792,uid=115): auth-worker<1>: Handling PASSV request
Sep 01 20:00:59 auth-worker(14793): Debug: conn unix:auth-worker (pid=14792,uid=115): auth-worker<1>: sql(test,[IP Address],<fheTBDemh3aZpZ2C>): Performing passdb lookup
Sep 01 20:00:59 auth-worker(14793): Debug: conn unix:auth-worker (pid=14792,uid=115): auth-worker<1>: sql(test,[IP Address],<fheTBDemh3aZpZ2C>): query: SELECT username AS user,password FROM mailbox WHERE username = 'test' AND active$
Sep 01 20:00:59 auth-worker(14793): Debug: mysql(localhost): Finished query 'SELECT username AS user,password FROM mailbox WHERE username = 'test' AND active='1'' in 0 msecs
Sep 01 20:00:59 auth-worker(14793): Debug: conn unix:auth-worker (pid=14792,uid=115): auth-worker<1>: sql(test,[IP Address],<fheTBDemh3aZpZ2C>): Finished passdb lookup
Sep 01 20:00:59 auth-worker(14793): Debug: conn unix:auth-worker (pid=14792,uid=115): auth-worker<1>: Finished: user_unknown
Sep 01 20:00:59 auth: Debug: sql(test,[IP Address],<fheTBDemh3aZpZ2C>): Finished passdb lookup
Sep 01 20:00:59 auth: Debug: auth(test,[IP Address],<fheTBDemh3aZpZ2C>): Auth request finished
Sep 01 20:01:01 auth: Debug: client passdb out: FAIL 1 user=test
You can see where it is performing the lookup without the domain component and as a result it fails. After adding the account manually, you can see in the same debug log where the lookup is performed using the full email address and passes successfully.