Hmm, PREAUTH is cool. But all Perl CPAN modules for IMAP can work only throw UNIX local sockets (or usual internet connection). May be there is an ability to create a socket when launchind 'dovecot --exec-mail imap' instead of working directly with STDIN/STDOUT?