Discover and Learn the Endless Tech Innovations

Mailfront Imapfront-auth Dovecot

  • Table of Content
  • Introduction
  • License
  • Changes
  • Download
  • Requirements
  • How to Compile, Install and Use

Introduction

Last Updated: 19 Nov 2010 GMT +8.

mailfront-imapfront-auth-dovecot is a program to modify the MAIL environment variable according to dovecot imap requirements in order to access users mail storage.

Dovecot uses colons as internal field separators; however, since v1.2rc6, it allows colons occurrences via escaping (as : → ::). Before passing such mailbox paths via MAIL environment variable to dovecot imap, this wrapper performs such escaping.

From original MAIL environment variable:

/home/USERNAME/MAILDIR/mail:box:user

To:

maildir:/home/USERNAME/MAILDIR/mail::box::user

Or:

mbox:/home/USERNAME/MAILDIR/mail::box::user

More information can be read at:

References:

License

This package is copyright © 2010 Giam Teck Choon or CHOON.NET, and may be copied according to the GNU GENERAL PUBLIC LICENSE (GPL) Version 2 or a later version. A copy of this license is included with this package. This package comes with no warranty of any kind.

Changes

  • 19 Nov 2010 GMT +8 : Version 0.04
  • Use strcpy instead of strcat for initial maildir: or mbox: as using strcat might cause the funny string prefixed in some systems
  • Added mailfront-imapfront-auth-dovecot.sh
  • Place back gcc optimizations in Makefile as previous break issue is due to strcat
  • 18 Nov 2010 GMT +8 : Version 0.03
  • Remove gcc optimizations in Makefile since it break some systems
  • 13 Nov 2010 GMT +8 : Version 0.02
  • Support mbox format
  • Skip modifying $MAIL if starting string is mbox: or maildir:
  • 10 Nov 2010 GMT +8 : Version 0.01
  • Initial release

Download

  • v0.04 md5sum 0269e406ca2c042583088a0e2f37d2da
  • v0.03 md5sum 26a49c8ed3906a097aabd9a97be87c08
  • v0.02 md5sum 420a69495279ccc19030c1f5c052000d
  • v0.01 md5sum f9926ce5e90c62cf0dd487d8140f4d63

How to Compile, Install and Use?

Please read the README file provided in this package which contains more information about doing custom installation and so on.

cd /usr/local/src
wget http://choon.net/opensource/mailfront-imapfront-auth-dovecot/mailfront-imapfront-auth-dovecot-0.04.tar.bz2
tar jxvf mailfront-imapfront-auth-dovecot-0.04.tar.bz2
cd mailfront-imapfront-auth-dovecot-0.04
make
make install
  • Line 1: Change current working directory to /usr/local/src
  • Line 2: Download mailfront-imapfront-auth-dovecot version 0.04 source
  • Line 3: Unpack mailfront-imapfront-auth-dovecot version 0.04 source
  • Line 4: Change current working directory to the newly unpacked mailfront-imapfront-auth-dovecot source
  • Line 5: Run make to compile
  • Line 6: Run make install to install

In your imapd run file, place mailfront-imapfront-auth-dovecot before dovecot imap. Example imapd/run file:

#!/bin/sh

DOVECOTWRAPPER=""
# Default to support dovecot 1.2
if [ -x "/usr/libexec/dovecot/imap" ] ; then
	IMAPD=/usr/libexec/dovecot/imap
	if [ -x "/usr/bin/mailfront-imapfront-auth-dovecot" ] ; then
		DOVECOTWRAPPER=/usr/bin/mailfront-imapfront-auth-dovecot
		# uncomment below line if you are using dovecot version 2
		#export DOVECOT_V2=1
		# uncomment below line if you want to see debug message
		#export IMAPFRONTAUTH_DOVECOT_DEBUG=1
	elif [ -x "/usr/local/bin/mailfront-imapfront-auth-dovecot" ] ; then
		# uncomment below line if you are using dovecot version 2
		#export DOVECOT_V2=1
		DOVECOTWRAPPER=/usr/local/bin/mailfront-imapfront-auth-dovecot
		# uncomment below line if you want to see debug message
		#export IMAPFRONTAUTH_DOVECOT_DEBUG=1
	fi
elif [ -x "/usr/local/bin/imapd" ] ; then
	IMAPD=/usr/local/bin/imapd
elif [ -x "/usr/lib/courier-imap/bin/imapd" ] ; then
	IMAPD=/usr/lib/courier-imap/bin/imapd
else
	IMAPD=/usr/bin/imapd
fi

if [ -x "/usr/bin/imapfront-auth" ] ; then
	IMAPFRONT_AUTH=/usr/bin/imapfront-auth
else
	IMAPFRONT_AUTH=/usr/local/bin/imapfront-auth
fi

ulimitdata=500000000
concurrency=40

CVM_SASL_PLAIN=cvm-local:/tmp/.cvm-vmailmgr
CVM_SASL_LOGIN=cvm-local:/tmp/.cvm-vmailmgr
export CVM_SASL_PLAIN
export CVM_SASL_LOGIN

exec \
softlimit -m $ulimitdata \
tcpserver -DHRUvX -c "$concurrency" -l "`head -n 1 /var/qmail/control/me`" \
	-x /etc/tcpcontrol/imap.cdb 0 imap \
$IMAPFRONT_AUTH $DOVECOTWRAPPER \
$IMAPD 2>&1