On 15/09/13 00:45, Sam Varshavchik wrote:
>> Ubuntu/Debian systems do have a bin user as uid 2 whereas the official debs
>> distribute courier as daemon. Archlinux and I think rpm system have bin as
>> 1 so deb/rpm packages all seem to install courier as mainly the uid 1 but
>> in my case I'm not sure why or where bin:bin is chosen?
>
> It's hardwired in the makefiles.

So, if need be, I have to manually readjust uid:gid after the build.

>> At this point $1 should be start|stop|restart. I'm about to remove everything
>> and rebuild from scratch.
>
> Something's wrong somewhere. Wrong imapd. There's imapd in sbin, that starts
 > and stops everything, and there's imapd the actual server. Once a connection
 > comes in, and imaplogin authenticates, it should end up executing the imapd
 > server, not the startup script in sbin.

Thanks for the hint. I started from the Archlinux configure recipe here...
https://aur.archlinux.org/packages/co/courier-mta/PKGBUILD and their --sbindir
is /usr/bin instead of /usr/sbin so imapd was being overwritten with the wrong
one!

FWIW this is the build script I am using which may a good starting point for
someone else if they do not usually build from source. These adjustments below
will pretty well allow it to run on a deb based system using the standard
startup scripts (I should include Alessandro Veselys' patch too)...

SYS=
NSU=daemon
NSG=daemon

ln -s /etc/authlib/authdaemonrc /etc/courier/authdaemonrc
ln -s /etc/authlib/authmysqlrc /etc/courier/authmysqlrc

--------------------------------------------------------------
~ cat courier.build
#!/bin/sh
# courier.build 20130914 (C) Mark Constable (AGPL-3.0)
#
# Ubuntu 13.10 devel package dependencies:
# build-essential libtool libgamin-dev libgdbm-dev libssl-dev
# libsqlite3-dev libmysqlclient-dev libpcre3-dev libperl-dev

SYS=/home/admin
NSU=admin
NSG=adm
SRC=https://sourceforge.net/projects/courier/files

PKG=courier-authlib
VER=0.65.0.20130913

if [ ! -f $PKG-$VER.tar.bz2 ];then
     wget $SRC/authlib-devel/20130913/$PKG-$VER.tar.bz2
fi

if [ ! -d $PKG-$VER/ ];then
     tar xf $PKG-$VER.tar.bz2
fi

cd $PKG-$VER

./configure \
     --prefix=$SYS/usr \
     --sbindir=$SYS/usr/sbin \
     --sysconfdir=$SYS/etc \
     --localstatedir=$SYS/var \
     --libdir=$SYS/usr/lib \
     --libexecdir=$SYS/usr/lib \
     --with-db=gdbm \
     --with-mailuser=$NSU \
     --with-mailgroup=$NSG \
     --with-authmysql \
     --with-authcram \
     --with-authsqlite \
     --with-sqlite-libs=/usr/lib/x86_64-linux-gnu \
     --with-authdaemon \
     --with-authdaemonvar=$SYS/var/run/authdaemon

make
sudo make install

cd ..

PKG=courier
VER=0.71.20130913

if [ ! -f $PKG-$VER.tar.bz2 ];then
     wget $SRC/courier-devel/20130913/$PKG-$VER.tar.bz2
fi

if [ ! -d $PKG-$VER/ ];then
     tar xf $PKG-$VER.tar.bz2
fi

cd $PKG-$VER

export COURIERAUTHCONFIG=$SYS/usr/bin/courierauthconfig
LDFLAGS+=",-L $SYS/usr/lib/courier-authlib -lcourierauth"
./configure \
     --prefix=$SYS/usr \
     --sbindir=$SYS/usr/sbin \
     --sysconfdir=$SYS/etc/courier \
     --libdir=$SYS/usr/lib \
     --libexecdir=$SYS/usr/lib \
     --localstatedir=$SYS/var/lib/courier \
     --disable-root-check \
     --enable-unicode \
     --enable-workarounds-for-imap-client-bugs \
     --enable-mimetypes=/etc/mime.types \
     --with-piddir=$SYS/var/run/courier \
     --with-locking-method=lockf \
     --with-trashquota \
     --with-db=gdbm \
     --with-trashquota \
     --with-random=/dev/urandom \
     --without-ispell \
     --with-mailuser=$NSU \
     --with-mailgroup=$NSG \
     --with-certdb=/etc/ssl/certs/

C_INCLUDE_PATH=$SYS/usr/include make
sudo make install
sudo make install-configure
awk '{print "chmod "$2" "$1"\nchown "$3":"$4" "$1}' permissions.dat | sudo sh

# fixups
sudo mv $SYS/usr/bin/rmail $SYS/usr/sbin # symlink to sendmail
sudo mv $SYS/usr/bin/sendmail $SYS/usr/sbin
sudo ln -s $SYS/usr/sbin/sendmail $SYS/usr/bin/sendmail
sudo chmod 4511 $SYS/usr/bin/maildrop
sudo chmod 4511 $SYS/usr/sbin/sendmail



------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
_______________________________________________
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to