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:
http://wiki.dovecot.org/MailLocation
http://wiki2.dovecot.org/MailLocation

References:
http://lists.untroubled.org/?list=bgware&cmd=showthread&month=201011&threadid=elpfjlnilcganfkokehg
http://mij.oltrelinux.com/net/dovecot-qmail-vmailmgr/
http://wiki.dovecot.org/HowTo/VMailMgr


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



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

Portal Log In/Sign In

Log In/Sign In to the Portal requires cookies and javascript.

×
×