# apt-get install dpkg-dev
# apt-get install gcc make patch g++
# apt-get source courier
# apt-get build-dep courier
# cd courier_0.x.x.orig
# cat ../courier_patch/courier_0.x.x | patch -p1
Remember to always apply the patch provided with debian before
any other patch (in this case, apt-get source takes care of that).
# dpkg-buildpackage
# dpkg -i ./courier-imap_0.x.x.deb
# dpkg -i ./courier-pop3_0.x.x.deb
# dpkg -i ./courier-authdaemon_0.x.x.deb
# dpkg -i ./courier-authmysql_0.x.x.deb