project: d.r.e.a.m

This documentation is no longer maintained. It may be out of date, or simply wrong. I will leave it online, as long as it think it may still be useful.

Using bincimap with vmailmgr

UPDATED: 1.2.7 needs a new wrapper script (submitted by Joshua_Boschert@aismail.wustl.edu)

UPDATED: Since 1.1.6 a wrapper is needed to make vmailmgr work. Please set "." as your Maildir Path in /etc/bincimap.conf.

UPDATED: Since 1.2.8, the wrapper script is no longer needed.

bincimap has a nice and clean design, and works really fine. Altough, i ran into some problems when trying to use bincimap with vmailmgr. I was able to solve these problems by RTFS (a quick google search showed nothing). Of course, this should be documented somewhere.

These problems have been fixed in 1.2.8. bincimapd now behaves like qmail-pop3d, and using it with vmailmgr is now really easy. I'll this document here since several pages link to it. But there isn't any magic involved anymore.

Runfiles for imap

Setting up plain imap with vmailmgr is pretty straightforward. Just create a runfile like this:

#!/bin/sh

exec    tcpserver -vRH -l "`hostname`" 0 143 \
        bincimap-up \
        --logtype=multilog \
        --conf=/etc/bincimap.conf -- \
        checkvpw \
		bincimapd Maildir 2>&1

Runfiles for imaps

Setting up imaps with sslserver (not bincimap's native SSL mode) is a bit more difficult. First, you need to split your certificate into two files, and get a dh1024.pem. After the split, the files should look like this:

This was the difficult part, the rest is pretty straightforward. Just create a runfile like this:

#!/bin/sh

exec envdir ./env \
        sslserver -vRH -l "`hostname`" 0 993 \
        bincimap-up \
        --logtype=multilog \
        --conf=/etc/bincimap.conf -- \
        checkvpw \
        bincimapd Maildir/ 2>&1

You need to create a dir called env in your service dir. There, you need three files:

Testing your installation

To test your installation, use an ssl enabled version of telnet, and try to login to your imap server. Some screenshots:

% telnet -z ssl localhost 993
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK Welcome to Binc IMAP v1.1.5 (c) Copyright 2002, 2003 Andreas Aardal Hanssen at 2003-05-07T03:29:38+0200
a001 LOGIN alias-test test
a001 OK LOGIN completed
a002 LOGOUT
* BYE Binc IMAP shutting down
a002 OK LOGOUT completed
Connection closed by foreign host.
% telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK Welcome to Binc IMAP v1.1.5 (c) Copyright 2002, 2003 Andreas Aardal Hanssen at 2003-05-07T03:29:38+0200
a001 LOGIN alias-test test
a001 OK LOGIN completed
a002 LOGOUT
* BYE Binc IMAP shutting down
a002 OK LOGOUT completed
Connection closed by foreign host.

Execline runscripts

imap

#!/command/execlineb
# imap runfile
# $Id: bincimap.html 57 2006-04-26 23:19:04Z lb $

backtick -n AUTH                { head -1 ./env/AUTH }
backtick -n HOSTNAME            { hostname }

fdmove -c 2 1

envdir ./env
tcpserver -vRH -l $HOSTNAME 0 143 
bincimap-up --logtype=multilog --conf=/etc/bincimap.conf -- 
$AUTH
bincimapd -Maildir

imaps

#!/command/execlineb
# imap runfile
# $Id: bincimap.html 57 2006-04-26 23:19:04Z lb $

backtick -n AUTH                { head -1 ./env/AUTH }
backtick -n HOSTNAME            { hostname }

fdmove -c 2 1

envdir ./env
sslserver -vRH -l $HOSTNAME 0 993 
bincimap-up  --logtype=multilog --conf=/etc/bincimap.conf -- 
$AUTH
bincimapd Maildir

If you have any questions or suggestions don't hesitate to contact me.

This document public domain.