[Dovecot] $MAIL environment variable to override mail_location works in v1.2.16 but not in v2.0.7 for /usr/libexec/dovecot/imap

Giam Teck Choon dovecot.org at choon.net
Thu Nov 11 20:50:09 EET 2010


For the past day, I have been researching about making dovecot to 
support mailfront (http://untroubled.org/mailfront/) imapfront-auth 
natively and able to use mailfront imapfront-auth with dovecot imap 
v1.2.16 without starting any dovecot related services and no 
/etc/dovecot.conf file is required.

More information about this can be read at:


However, same trick can't be used for dovecot v2.0.7.  First error is 
/etc/dovecot/dovecot.conf must be exists so I just simply touch 
/etc/dovecot/dovecot.conf with empty content to bypass that error.  I 
noticed v2.0.7 is not using $MAIL environment variable to override 

I have read the following:


Any idea to override mail_location setting?  I have tried various 
setting of environment variables such as below:


# $MAIL, $HOME, $MAILDIR, $MAILBOX are the same in mailfront
# imapfront-auth
if [ -n "$MAIL" ]; then
   # make dovecot imap escape colon by replacing single : to ::
   export MAIL=maildir:`echo $MAIL | sed 's@:@::@g'`
# For knowing all env. uncomment the below line and
# see /tmp/imapd-log.txt
# printenv >>/tmp/imapd-log.txt
exec "$@"

The above script is being placed between imapfront-auth and dovecot imap 

Thanks for any kind assistance.

Kindest regards,
Giam Teck Choon

More information about the dovecot mailing list