Add extension support for dovecot+virtual users

Redid PR #10 in the way discussed there.

Tested on Debian wheezy, but looks noninvasive enough.