Articles Comments

{ Berbagi, Menulis, Dan Mengajar } Ilmu… » 7. Operating System » Qmail Installasi Hack / Trouble Shooting dengan VPOPMAIL

Qmail Installasi Hack / Trouble Shooting dengan VPOPMAIL

1. Merubah Configurasi Qmail
disini  /var/qmail/control/defaultdelivery
dari
./Maildir   —> menjadi ./Maildir/

2. Cara Membuka Files Ber-extension tar.bz2
install paket debian : bzip2
#apt-get install bzip2
#bunzip2 courier-authlib-0.58.tar.bz2

3. Cara Mengakses FTP server dengan MC (Midnighr Commander)
“namauser:password@AlamatServer”

4. Courier Link di Debian

http://www.raptorized.com/2007/05/20/courier-imap-and-vpopmail-on-debian/

Courier imap and vpopmail on Debian –> Gak Bisa Jalan Bareng

Hi everyone. Sorry for the lack of updates, I’ve been fairly busy — I’m migrating all of my servers to a single, brand new Dell Poweredge 2900 server. I have a couple of great tutorials regarding Xen coming up soon, I’m sure at least someone will find them useful — I found the Xen documentation to be really scarce.

So, right now, I’m migrating my qmail, vpopmail, courier, clamav and friends set-up from Gentoo to Debian, on a new virtual machine. I followed the basic steps from here:

http://wiki.debian.iuculano.it/quick_howto

This gent was nice enough to provide the required qmail packages and patches. Only problem came when I tried to make courier work with vpopmail — turns out the official debian courier-imap packages don’t support vchkpw, which is the authentication mechanism for vpopmail. Fortunately, I managed to hack it in an almost clean way, that doesn’t involve building it yourself from tarball.

Read on for the jazz.

So, first of all, fetch the courier-authlib source. You should first make sure that your /etc/apt/sources.list file contains the “deb-src” lines for everything. apt-get update if necessary.

So, step one, create a folder to hold the sources and debian packages, and cd into it.

mkdir -p /usr/src/deb-source; cd  /usr/src/deb-source

Step two, fetch the sources.

apt-get source courier-authlib

Once that is done, you must install the tools and libraries courier might need to be built. This sounds scary, but is actually a breeze under Debian.

apt-get build-dep courier-authlib

This should bring in a few things like build-essential, if you don’t have a compiler on the machine yet.

Next, cd’ into the source folder, and into the debian package files.

cd courier-authlib-0.58/debian

Now you’re sitting where all the package specifications are configured, and the sweet thing is, you can hack them to your heart’s content. First of all, we need to edit the file named control.

vi control

Add the following at the end of the file to create a description for vchkpw.

Package: courier-authlib-vchkpw
Architecture: any
Depends: ${shlibs:Depends}, courier-authlib (>= ${RELUP})
Description: External authentication support for Vpopmail.
This package contains vpopmail support for courier-authlib.

Next, we must create a list of files for the package.

echo “/usr/lib/courier-authlib/libauthvchkpw.so*” > courier-authlib-vchkpw.files

Failure to do this could lead to the following message during build:

/usr/src/deb-source/courier-authlib-0.58/debian/tmp/usr/lib/courier-authlib/libauthvchkpw.so.0.0.0 /usr/src/deb-source/courier-authlib-0.58/debian/tmp/usr/lib/courier-authlib/libauthvchkpw.so.0 /usr/src/deb-source/courier-authlib-0.58/debian/tmp/usr/lib/courier-authlib/libauthvchkpw.so File(s) found not belonging to any package, please contact maintainer make: *** [install] Error 1

Next step, altering the build parameters to include vpopmail support. That’s fairly easy. Just edit the file rules.

vi rules

Scroll down to the part where COMMON_CONFOPTS is defined, near line 35. Change the line where it says:

–without-authvchkpw \

so that it now reads:

–with-authvchkpw \

Once that is done, save the file, and you’re now ready to build the new and improved package:

# cd ..
# dpkg-buildpackage

And go fetch some coffee. The courier builds are always pretty nasty, and configure can take a while. During compilation, I spotted this with my hawk eyes:

Compiling authvchkpw.c
authvchkpw.c: In function ‘callback_vchkpw':
authvchkpw.c:46: warning: value computed is not used
authvchkpw.c: In function ‘auth_vchkpw_changepass':
authvchkpw.c:142: warning: passing argument 1 of ‘parse_email’ discards qualifiers from pointer target type
Compiling authvchkpwlib.c

This confirmed that support was indeed being included this time.

Once the build is done, simply install the required package.

# cd ..
# ls -lah *.deb
courier-authdaemon_0.58-4_amd64.deb     courier-authlib-pipe_0.58-4_amd64.deb
courier-authlib_0.58-4_amd64.deb        courier-authlib-postgresql_0.58-4_amd64.deb
courier-authlib-dev_0.58-4_amd64.deb    courier-authlib-userdb_0.58-4_amd64.deb
courier-authlib-ldap_0.58-4_amd64.deb   courier-authlib-vchkpw_0.58-4_amd64.deb
courier-authlib-mysql_0.58-4_amd64.deb
# dpkg -i courier-authlib-vchkpw_0.58-4_amd64.deb
Selecting previously deselected package courier-authlib-vchkpw.
(Reading database …
27234 files and directories currently installed.)
Unpacking courier-authlib-vchkpw (from courier-authlib-vchkpw_0.58-4_amd64.deb) …
Setting up courier-authlib-vchkpw (0.58-4) …
#

And we’re done.

Now all that is left is just to edit /etc/courier/authdaemonrc where it specifies the authentication modules to include our newly created one:

authmodulelist=”authvchkpw”

And voilà. That wasn’t so hard, was it?

I hope someone finds the following guide useful :)

Filed under: 7. Operating System

Leave a Reply

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>