Mind Dump, Tech And Life Blog
written by Ivan Alenko
published under license CC4-BY
posted in category Systems Software / E-Mail
posted at 04. May '24

Howto Compile Sieve Rules Manually

I use Sieve rules to have server side email filtering. It is very useful since I use at least two different email clients and it is kind of standard. Unfortunately currently there are not many good utilities to edit sieve rules, Thunderbird plugin I used to use is dead and KSieve sends cleartext password (???) - checked a couple of months ago.

While it should be possible to edit sieve rules remotely, for now I just edit it on the server and then compile them.

In a home directory, there are .sieve Sieve rules which is a clear text file and .svbin is the binary representation.

root@starz:/home/damon# ls -lah
total 54K
drwx------  4 2000 2000   10 Aug 16  2023 .
drwx------  6 2000 2000    6 Nov 21 11:43 ..
lrwxrwxrwx  1 2000 2000   16 May 16  2016 .dovecot.sieve -> linuxwacom.sieve
-rw-------  1 2000 2000 7.4K Jul 17  2023 .dovecot.sieve.log
-rw-------  1 2000 2000  11K Jul 17  2019 .dovecot.sieve.log.0
-rw-------  1 2000 2000 1.9K Aug 16  2023 .dovecot.svbin
-rw-------  1 2000 2000 1.8K Aug 16  2023 linuxwacom.sieve
-rw-------  1 2000 2000 1.9K Mar 17 17:07 linuxwacom.svbin
drwx------ 21 2000 2000   34 Mar 17 16:42 Maildir
drwx------  2 2000 2000    2 Dec 14  2020 tmp

Somewhere I read Dovecot can create .svbin file itself if it doesn’t exist, but not sure if it tracks when outdated.

How to compile - since my root sieve is linuxwacom.sieve, I had to update and compile that:

sievec linuxwacom.sieve

This will create linuxwacom.svbin.

And then it is useful to check logs if Dovecot puts stuff into folders:

less .dovecot.sieve.log

Sometimes folders are missing or other errors:

error: msgid=<410145479.141639.1689580289943@example.com>: fileinto action: failed to store into mailbox 'INBOX.news': Mailbox doesn't exist: INBOX.news.

And that’s all, server side filters should work now.

Add Comment