Recently I decided to upgrade courier (mta and imap) on one of my mail
servers. It was a disaster. The quality of these packages is abysmal and
dangerous. This is one of the many serious, grave, and critical bugs I
ran into during that process.
Our problem is in postinst, line 30, "makeimapaccess".
makeimapaccess is just a shell script.
/usr/lib/courier/makeimapaccess
This is all new to me.
makeimapaccess is looking for configuration directive "IMAPACCESSFILE"
in /etc/courier/imapd (and imapd-ssl). But this does not exist.
This looks important:
https://sourceforge.net/p/courier/mailman/message/34734150/
If we google for IMAPACCESSFILE we get almost nothing. Search the
courier-mta.org documentation website for "IMAPACCESSFILE" and there is
nothing at all.
I assume our local man pages have nothing on this.
I checked the changelogs... almost nothing:
/usr/share/doc/courier-imap/changelog.gz
2015-02-24 Sam Varshavchik <mr...@courier-mta.com>
* Add the makeimapaccess script.
No mention that this config parameter is now mandatory.
Our only hint is that this probably works just like makesmtpaccess does.
http://www.courier-mta.org/makesmtpaccess.html
Here is what that line in my esmtpd file looks like:
ACCESSFILE=${sysconfdir}/smtpaccess
It looks like the package scripts already added me a imapaccess
directory at some point. It's empty but that's fine.
Okay so I'll just add this to my /etc/courier/imapd:
IMAPACCESSFILE=${sysconfdir}/imapaccess
Problem solved. Packages install fine now.
As for what to do about this, I don't know. Feels like stupid all the
way uphill. I don't think IMAPACCESSFILE is supposed to be
mandatory-required in a config. That makeimapaccess should be smart
enough to not die horribly when run against a valid config. And/or it
should provide a tiny hint about what went wrong. The whole thing needs
to be documented.