How to make dovecot not ask passwords from localhost?

Solution 1:

Three options come to my mind:

  • First, if you are on the same machine, you could just use the underlying mail store directly, without going thru IMAP. Depending on the store and client used, this may result in some troubles reflecting changes back to IMAP, though.

  • Second, use Dovecot's mechanism for pre-authenticated sessions, together with an inetd or ucspi-tcp's tcpserver if you need to listen on a TCP port for you client of choice.

  • Finally, you could setup Kerberos ticket authentication and use that with Dovecot via GSSAPI. But that's probably overkill for your scenario.

Solution 2:

The comment from @grawity on the other answer, although now outdated, led me to the solution I needed. It deserves an answer of its own. This answer to a closely related question provided the missing link.

Pre-authenticated sessions can be obtained by piping through a Dovecot command. Recent (>= 2.0) versions of Dovecot provide the imap command, which on Debian and Ubuntu is located at /usr/lib/dovecot/imap. On older versions you'd instead run dovecot --exec-mail imap (located in /usr/sbin).

For my mutt, the required .muttrc setting would thus be

tunnel=/usr/lib/dovecot/imap

Tags:

Pam

Dovecot