Re: [Exim] Exim and Sieve rules

Góra strony
Delete this message
Reply to this message
Autor: Tor Slettnes
Data:  
Dla: Ray Jackson
CC: exim-users
Temat: Re: [Exim] Exim and Sieve rules
On May 4, 2004, at 23:40, Ray Jackson wrote:

> We have built a prototype mail system with everything we need and it
> is working
> perfectly... the only problem is that we are using Cyrus+timsieved for
> the mail
> store. There are a number of reasons why we prefer Courier (e.g. NFS
> safe,
> Maildir format etc.) - however, we are stuggling to get Sieve support
> working
> with Courier. [...]


If you are already using Cyrus, don't switch to Courier. You will be
disappointed.

For one, Courier is significantly slower, especially with large
mailboxes. (Consider this list, which adds 50-100 messages in a
mailbox per day).

Secondly, even if Courier is NFS safe (is it?), you will have even
larger performance problems delivering mail over NFS shares (which,
BTW, would be done by Exim, and not Courier).

If you have many users and several machines, Cyrus provides the
"Murder" frontend to distribute delivery and pickup. Architecturally,
this is more efficient and better designed than a shared filesystem
like NFS. (In particular, if a NFS server is unavailable, the clients
will typically hang for a very long time, depending on your "intr", and
"hard"/"soft" mount options).

Lastly, although Exim does support sieve, and you can deliver either to
Maildir or Cyrus (either via UNIX or TCP sockets over LMTP, or
"cyrdeliver" pipes), I found that Cyrus' implementation of Sieve is
more complete and accurate w.r.t. the RFC. After all, the Sieve
language was developed by Cyrusoft.

Finally, with Cyrus you have the option of using SASL username/password
storage. This means that (a) your users do not need UNIX accounts, and
(b) you get MD5 (DIGEST-, CRAM-), Kerberos, etc. authentication
support.

All said and done, here is a simple Exim Sieve script I wrote for
someone using Courier/Maildir spools:

------8<------------8<------------8<------------8<------------8<--------
# Sieve filter
########################################################################

require "fileinto";

if header :contians "X-Spam-Status" "Yes"
         { fileinto "Junk"; }
else
         { keep; }
------8<------------8<------------8<------------8<------------8<--------



This works with the following Exim transport:

eximfilter_transport:
    driver            = appendfile
    directory        = ${if eq{$address_file}{inbox} \
                            {$home/Maildir} \
                            {$home/Maildir/.${sg{$address_file}{[/\.]}{/.}}} \
                        }
    delivery_date_add
    envelope_to_add = true
    return_path_add = true
    check_string    = ""
    escape_string   = ""
    mode            = 0600
    maildir_format




And with the following router:

eximfilter_router:
     debug_print    = "R: eximfilter_router for $local_part@$domain"
     driver         = redirect
     check_local_user
     file           = $home/.eximfilter
     no_verify
     no_expn
     check_ancestor
     allow_filter
     file_transport = eximfilter_transport
     skip_syntax_errors
     syntax_errors_to = real-$local_part@$domain
     syntax_errors_text = \
        This is an automatically generated message.  An error has\n\
        been found in your .eximfilter file.  Details of the error are\n\
        reported below.  While this error persists, you will receive\n\
        a copy of this message for every message that is addressed to\n\
        you.  A copy of each incoming message will be put in your normal\n\
        mailbox.