Re: [exim] sieve filters from (ldap-)database

Top Page

Reply to this message
Author: Michael Haardt
Date:  
To: exim-users
Subject: Re: [exim] sieve filters from (ldap-)database
On Wed, Feb 16, 2005 at 01:32:54AM +0100, Timo Boettcher wrote:
> What I found so far is:
> Courier-imap uses "." as path-separator for subfolders, and sieve
> seems to use "/", so for INBOX/subfolder I end up with
> ~/.maildir/INBOX/subfolder/mymail instead of
> ~/.maildir/.subfolder/mymail
> I tried to solve that with some string-expansion on $address_file
> in the forward_address_file transport when I actually deliver the
> mail, but I hope there is a better way to do that...


Sieve makes no assumptions no mailbox names, so using what Courier
uses makes sense. You do need a string expansion on $address_file,
there is no way around. For courier, it needs to expand:

inbox -> ~/.maildir
inbox.folder -> ~/.maildir/.folder

Something like this (untested):

  directory = ${if eq{$address_file}{inbox} \
                   {$home/.maildir} \
                   {$home/.maildir/${sg{$address_file}{^inbox}{}}} \
               }


That way, fileinto "inbox.subfolder.mymail" will save to
~/.maildir/.subfolder.mymail/new.

If you want to allow INBOX as well, a case-insensitive comparison must
be performed.

Michael