The courier-imap ebuilds appear to go to great lengths to use db3. If both gdbm and berkdb are USEd, then courier-imap forces berkdb. I actually have neither in my make.conf, but the Gentoo defaults somewhere define both. The maildrop ebuild doesn't do anything about db and looks for gdbm. The kicker is that both courier-imap and maildrop install the makeuserdb script (one in /usr/bin, one in /usr/sbin) which in turn uses makedatprog that actually makes the db/gdbm formatted database. Consequently with the default gentoo USE flags, you end up with incompatible userdb binary files, and this is REALLY hard to diagnose since the components do not give any error messages about wrongly formatted db/gdbm files. You basically just get authentication failures, but strace shows the appropriate files are being opened. Reproducible: Always Steps to Reproduce: (This can be done in either order) emerge courier-imap emerge maildrop Actual Results: # slocate makeuserb authuserdb makedatprog (I grepped out the doc) /usr/sbin/makeuserdb /usr/bin/makeuserdb /usr/share/maildrop/makeuserdb /usr/lib/courier-imap/authlib/authuserdb /usr/bin/makedatprog /usr/lib/courier-imap/makedatprog ; ldd on authuserdb, makedatprog | look for db/gdbm # ldd /usr/lib/courier-imap/authlib/authuserdb libdb-3.2.so => /usr/lib/libdb-3.2.so (0x4002d000) # ldd /usr/bin/makedatprog libgdbm.so.2 => /usr/lib/libgdbm.so.2 (0x4002d000) # ldd /usr/lib/courier-imap/makedatprog libdb-3.2.so => /usr/lib/libdb-3.2.so (0x4002d000) Expected Results: Gentoo should use one location for the courier authentication stuff. For example their webmail component sqwebmail also uses it. There should only be one copy of makeuserb, makedatprog etc. The courier software itself uses gdbm if both gdbm and kerbdb are present. Gentoo should do the same There should be some sort of formal policy on what ebuilds should do if both gdbm and berkdb are defined, and that should be followed up/checked for in all ebuilds. (My preference would be that gdbm is used). Portage 2.0.50-r7 (default-x86-2004.0, gcc-3.3.2, glibc-2.3.2-r9, 2.6.5-gentoo-r1) ================================================================= System uname: 2.6.5-gentoo-r1 i686 AMD Athlon(tm) XP 2800+ Gentoo Base System version 1.4.10 Autoconf: sys-devel/autoconf-2.59-r3 Automake: sys-devel/automake-1.8.3 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O2 -march=athlon-xp -mcpu=i686 -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/bind /var/qmail/alias /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=athlon-xp -mcpu=i686 -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="http://gentoo.mirrors.pair.com/ http://128.213.5.34/gentoo/ ftp://cudlug.cudenver.edu/pub/mirrors/distributions/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/home/portage_overlay" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="3dnow X acpi alsa also apache2 apm arts avi berkdb cdr crypt cups divx4linux dvd dvdr encode esd ethereal evo flac flash foomaticdb gdbm gif gnome gpm gtk gtk2 guile imagemagick imap imlib innodb java jpeg kde libg++ libwww mad maildir mikmod mmx motif mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam pda pdflib perl png python qt quicktime readline samba sdl slang spell sqlite ssl svga tcltk tcpd theora tiff truetype usb wxwindows x86 xml2 xmms xv yahoo zlib" #### This is my make.conf where you can see neither berkdb or gdbm is mentioned CFLAGS="-O2 -march=athlon-xp -mcpu=i686 -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CXXFLAGS="${CFLAGS}" GENTOO_MIRRORS="http://gentoo.mirrors.pair.com/ http://128.213.5.34/gentoo/ ftp://cudlug.cudenver.edu/pub/mirrors/distributions/gentoo/" USE="3dnow acpi also apache2 cdr cups divx4linux dvd dvdr encode esd ethereal evo flac flash foomaticdb gif gnome gtk2 imap innodb imagemagick java jpeg maildir mmx mozilla mpeg oggvorbis pda pdflib png python quicktime readline samba sdl ssl sqlite theora tiff usb wxwindows X yahoo zlib"
raker, swtaylor: i've brought you in as you both handle packages that this involves. we need to avoid duplicate programs, and come up with some common logic for which of gdbm/berkdb is used.
clearing up my bug tracking
Not sure about courier-imap 3.x, but >= 4.0.1 (as well as the whole set of new courier programs) have all the auth stuff pulled into a separate courier-authlib package. In the event both berkdb and gdbm are both checked, it will favor gdbm which as you noticed is the original default for courier. In addition, the ebuild will give a warning stating that both were chosen and it's only going to build gdbm. So, this should be fixed now, at least in >=courier-imap-4.0.1 (which is still keyworded as ~x86 at the moment). And due to this being moved to the shared courier-authlib ebuild, it answers the "common logic" point as well.