Re: [exim] exim and sieve filters

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Michael Haardt
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: Re: [exim] exim and sieve filters
On Thu, Sep 24, 2009 at 09:27:35AM +0200, Roel Schroeven wrote:
> As far as I can see, that cannot be done in
> an exim filter, but it can be done in a sieve filter using addflag
> "$label4".


I don't know what addflag is supposed to be, but:

> I tried that, but that doesn't work in the current setup; the log says
>
> appendfile: file or directory name "inbox" is not absolute
>
> The docs say that the name inbox must be handled for Sieve filters, and
> show a way to set the file setting in the appendfile transport.


Right, you need to convert the folder name in $address_file to an
absolute name. For mailbox, use "file", for maildir use "directory".

> So I think I need to set the directory setting (not file, since we're
> using Maildir) in the appendfile transport in a way that handles the
> Sieve name 'inbox' in a way suitable for Maildir, and also still
> supports the exim filters of all the other accounts (though I could
> convert all those to Sieve filters if there's no other way).


It all depends on how users save their mails. If you handle relative
paths right, you can run Exim and Sieve filters mixed:

  file = ${if eq{$address_file}{inbox} \
              {/var/mail/$local_part} \
              {${if eq{${substr_0_1:$address_file}}{/} \
                    {$address_file} \
                    {$home/mail/$address_file} \
              }} \
         }


This converts "inbox" to /var/mail/$local_part and anything else is
taken as absolute path, if it begins with "/", and used relative
to $home/mail otherwise. For maildir, use directory, but other than
that, it's the same.

Michael