In IMAP authentication with Dovecot, Postfix is stripping the domain name from virtual users who share a name with a local user, causing them to fail authentication. Virtual users without local accounts don't have this problem.
How can I prevent this? Failing an answer, how can I debug Postfix to see what's going on? I've turned on every debugging option I can get, and I'm not seeing anything helpful in the logs.
UPDATE:
The problem seems to be an overlap between my local delivery domains and my virtual_mailbox_domains. It's probably resolved easily by simply keeping virtual domain names distinct from the mail server's FQDN.
The Details.
Dovecot is not getting the domain name from Postfix for virtual/local users. (Established by revising the Dovecot SQL to create the email name with '%n@%d'. Virtual/local users appear in logged queries as 'someuser@', while virtual/not-local appear as 'anotheruser@grumpy.maildomain.net'.) Apparently Postfix experts find this behavior unsurprising for domains in both mydestination and the virtual_mailbox_domains.
postfix/main.cf:
mydestination = grumpy, localhost.maildomain.net, , localhost
virtual_mailbox_domains goes to an SQL table including "grumpy.maildomain.net".
I don't understand how the mydestination values resolve to 'grumpy.maildomain.net', but that's my poor understanding of host name construction/resolution.
In any case, I think I have this figured out.