Re: mailfront imapfront-auth with dovecot 1.2.16 : SUCCESS

Giam Teck Choon <[email protected]> Thu, 11 Nov 2010 05:38:43 +0800
Newsgroups gmane.comp.sysutils.bgware
Organization CHOON.NET
Message-ID <[email protected]>

On 11/11/2010 04:07 AM, Bruce Guenter wrote:
> On Wed, Nov 10, 2010 at 09:20:58AM +0800, Giam Teck Choon wrote:
>> This is just to share with the list members that upon couple hours of
>> researching, I have successfully run mailfront v1.17 imapfront-auth with
>> dovecot v1.2.16 which doesn't require dovecot service to be running.
>>
>> Below is the wrapper /usr/bin/mailfront-imapfront-auth-dovecot or name
>> whatever you like and chmod +x /usr/bin/mailfront-imapfront-auth-dovecot:
>> --------------------8<----------8<----------8<----------8<---------------------
>> #!/bin/sh
>>
>> if [ -n "$MAIL" ] ; then
>> 	export MAIL=maildir:`echo $MAIL | sed 's@:@::@g'`
>> fi
>> exec "$@"
>
> Well, if that's all that's needed, I can add that right into
> imapfront-auth itself.
>
> Please try the appended patch.  Simply set SETUP_DOVECOT=1 (or =
> anything) before running imapfront-auth, and it should set $MAIL to an
> appropriate string.  I am working on testing it myself, but the test CVM
> I am currently using doesn't actually set a mail fact.
>

Yes, the patch works!  I should ask you first before spending time to 
code the wrapper :p

Below is the imapd/run file:

--------------------8<----------8<----------8<----------8<---------------------
#!/bin/sh

# Default to support dovecot
if [ -x "/usr/libexec/dovecot/imap" ] ; then
     IMAPD=/usr/libexec/dovecot/imap
     export SETUP_DOVECOT=1
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 \
$IMAPD 2>&1
--------------------8<----------8<----------8<----------8<---------------------

Thanks.

Kindest regards,
Giam Teck Choon