[Gllug] Cyrus IMAP delivery
Mike Brodbelt
mike at coruscant.demon.co.uk
Wed Oct 17 18:04:14 UTC 2001
matthew.king at gardeneden.net wrote:
>
> On 17 Oct, John Hearns wrote:
>
> > One way you do the filtering is with your email client. So you set
> > the filters up in Pine/Mozilla/Evolution (whatever) and the client
> > will read mail from the Inbox and filter it.
> >
> > That does have the drawback, which I suffer from, that every time
> > you start using a new email client you have to put the filters in
> > again...
Gaaah. Avoid client side scripts like black plague :-)
> This is exactly what I'm trying to avoid, as at a minimum I use an X
> client and mutt.
Procmail is the Wrong Thing (TM) for a cyrus server :-)
Seriously though, cyrus is designed to work as a black box, where users
don't need local accounts. If you have existing procmail scripts, you
can make them work by using procmail as the local delivery agent, and
having procmail call the cyrus deliver program to perform final delivery
to the appropriate mail folder.
Personally, I'd avoid that. The Cyrus deliver program has caused me
grief, and I think it's best to not use it if possible. It's far better
to set your mail server up to talk LMTP to cyrus directly. I can provide
potted scripts for doing this with sendmail if anyone needs them, and
it's not hard with Exim or Postfix AFAIK.
Once the message gets to cyrus, it gets filtered through Sieve. Sieve is
a mail filtering language described in rfc 3028, and cyrus has a two
part sieve implementation. The LMTP daemon will process mail through
sieve scripts, and deliver to the right folder. Cyrus also provides a
daemon called timsieved, which listens on a predefined port, and can
accept script submissions over the network, so a mail client can be
allowed access to your on server scripts. A sample prog called
sieveshell is provided, which is a perl script that allows you to submit
a script, and activate it. You can also just dump it in the right
directory if you have root access to the box :-) - sieveshell is not the
most reliable of things, as the perl modules it depends on don't always
build right. The sieve implementation in the server is solid though, I
use it for all my mail.
Sieve is cool in that it'll do vacation and similar jobs as well as just
filtering.
My sieve script here is:-
require "fileinto";
if header :is "X-BeenThere" "gllug at linux.co.uk" {
fileinto "INBOX.Mailing Lists.GLLUG";}
elsif header :is "X-BeenThere" "libpdmp at lists.pointless.net" {
fileinto "INBOX.Mailing Lists.Libpdmp list";}
elsif header :is "Mailing-List" "contact
sage-wise-announce-help at sage-wise.org;
run by ezmlm" {
fileinto "INBOX.Mailing Lists.SAGE-WISE";}
elsif header :contains "Subject" "Cron <root at bifrost>" {
fileinto "INBOX.System Mail.Cron Mail";}
elsif header :contains "Subject" "bifrost.altair.nexus" {
fileinto "INBOX.System Mail.Logchecker";}
else {
fileinto "INBOX";}
It's pretty simple. The fastmail webmail service offers an HTML frontend
to allow users to build their own sieve scripts.
HTH,
Mike.
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list