/usr/lib/dovecot/imap exits with an error if stderr closed

Josh Triplett josh at joshtriplett.org
Thu Oct 1 18:41:03 UTC 2015


At the end of a direct IMAP conversation with the imap binary, it writes
an informative message like "imap(josh): Info: Connection closed in=0
out=365" to stderr.  With stderr closed, the imap binary will exit with
exit code 81 after it gets EBADF from that write.  While it makes sense
to fail on failure to write an error message, I don't think it makes
sense to fail if writing an info message fails.

I encountered this when using /usr/lib/dovecot/imap with mutt's "tunnel"
option.  Mutt seems to run the configured tunnel program with stderr
closed, which triggers this error.

- Josh Triplett


More information about the dovecot mailing list