Hi, I faced the same bug on a similar install yesterday.
After some investigation I have found that file /usr/lib/courier/imapd contains a bad command /usr/bin/mkdir -p `dirname $PIDFILE` ; \ whereas the same file in Stretch contains /bin/mkdir -p `dirname $PIDFILE` ; \ Of course executing a postinst with /usr/bin/mkdir fails. One could circumvent this by creating a temporary symlink but solving this bug by correcting the file is certainly better. Thanks.

