Filtering Emails on the Server

From Kolab wiki

Jump to: navigation, search

You can use Sieve to do so. Check out Experiences - Antonio Larrosa which has a section on Sieve.

How to set a Sieve Script for another user as administrator?

One way to do this is using sieveshell. Note that sieveshell will use an unencrypted connection, so it is wise to do this from the server machine itself or over an encrypted network connection.

/kolab/bin/sieveshell --user=a.user@example.org --authname=manager  localhost


After giving the manager password, you can upload and activate a script. Here is a set of commands (use help for a short explanation):

list
put example.siv
activate example.siv
list
quit


Here is an example script (note that Umlauts should be encoded as uft8):

# Example Sieve script which does both
# a) vacation and
# b) email delivery into a subfolder when no scheduling mail
#
require "vacation";
require "fileinto";
 
if allof (not header :contains "X-Spam-Flag" "YES",
       # only react to emails coming from a specific domain:
       address :domain :contains "From" "example.com" ) {
    vacation :addresses [ "usera@example.com", "mr.a@example.org" ] :days 7 text:
Out of the office, I am, until August the 28th, 2006.
 
In urgent cases please contact: <my replacement>
 
E-Mail: <email address of vacation replacement>
Telefon: +49 000000 00
Fax:  +49 00000000 00

Best Regards,
-- <enter your name and email address here>
.
;
}

if header :contains ["X-Kolab-Scheduling-Message"] ["FALSE"] {
    fileinto "INBOX/incoming";
}
#
if header :contains ["List-Id"] ["freegis-list.intevation.de"] {
    fileinto "INBOX/ml/freegis";
    stop;
}


Using Smartsieve for editing Sievescripts

An other way to edit sieve scripts are smartsieve which you can download from [1].

Installation

cd /kolab/var/kolab/www
wget http://mesh.dl.sourceforge.net/sourceforge/smartsieve/smartsieve-1.0-RC2.tar.gz
tar xzvf smartsieve-1.0-RC2.tar.gz
rm smartsieve-1.0-RC2.tar.gz
mv smartsieve-1.0-RC2 smartsieve
cd smartsieve/conf
vi servers.php

Edit here the first server entry, the default options would work.

vi config.php

Here I had set the option $default->user_select_server to false. So the users don't have to join the server

Now smartsieve run, you can log in with your email address and password at https://your.domain/smartsieve

Deinstallation

cd /kolab/var/kolab/www
rm -rf smartsieve
Personal tools