Replication sieve scripts.

Luescher Claude stargate at tango.lu
Mon Jul 25 12:21:54 UTC 2016


 Hello,

 So basically this sieve replication support is still in some broken 
 alfa stage and one should not build production system on top of it.

 I have found this older thread: 
 http://www.dovecot.org/list/dovecot/2013-February/088640.html


 We came up with a few options for syncing:

  1) rsync/unison ~/sieve every x seconds

  2) move sieve dirs to separatate partition and sync with
    gluster or drbd

  3) patch roundcube managesieve sieve plugin to upload to both
  managesieve servers (only roundcube can access managesieve in our
  setup)

  4) store sieve scripts in mysql and patch roundcube managesieve plugin
  to directly access the db instead of using managesieve (we tried this,
  but apparently sieve scripts read from db via dovecot dict can't have
  more than one line? show stopper due to roundcube sieve plugin  
 needing
    comments to parse the scripts)


 The database solution would be perfect since the nodes are using a db 
 master-master cluster but at the time of that post this was not working. 
 My original 2.2.10 dovecot is around that time so I would have to 
 upgrade for that again and at the end it would might not work because as 
 he said roundcube using multi-line sieve scripts.

 The problem with rsync is that rsync from where? If I rsync from 
 machine A -> B and let's say the user already have sieves on both nodes 
 and changes his holiday sieve on node B then the file will be 
 overwritten. I will give unison a try otherwise I have to put the sieves 
 on a shared filesystem like OCFS2 which imo is not reliable for 
 production either. When nodes lose connectivity that can end in kernel 
 crash, autoreboot on 1 node or both.

 On Sat, 23 Jul 2016 18:17:58 +0200, Michael Grimm wrote:

> Stephan Bosch wrote:
>
>> Only the user's scripts in the ~/sieve directory and the active 
>> script
>> marked by ~/.dovecot.sieve (symlink) are replicated.
>
> I do have those files in those directories:
>
> KB> la /var/mail/.homedirs/mike/.dovecot.sieve
> /var/mail/.homedirs/mike/.sieves/default.sieve
> lrwx------ 1 vmail dovecot uarch 21 Jul 21 19:38
> /var/mail/.homedirs/mike/.dovecot.sieve -> .sieves/default.sieve
> -rw------- 1 vmail dovecot uarch 5898 Jul 21 19:38
> /var/mail/.homedirs/mike/.sieves/default.sieve
>
> MW> la /var/mail/.homedirs/mike/.dovecot.sieve
> /var/mail/.homedirs/mike/.sieves/default.sieve
> lrwx------ 1 vmail dovecot uarch 21 Jul 21 19:38
> /var/mail/.homedirs/mike/.dovecot.sieve -> .sieves/default.sieve
> -rw------- 1 vmail dovecot uarch 5898 Jul 21 19:38
> /var/mail/.homedirs/mike/.sieves/default.sieve
>
> KB> ls -al default
> -rw-r--r-- 1 root wheel 5909 Jul 21 19:39 default
>
> KB> doveadm sieve put -u mike -a default < default
>
> I do see traffic arriving at MW when listening on the defined port 
> for
> synchronisation (tcpdump), but the new default file at KB doesn't 
> become
> synchronized:
>
> MW> la /var/mail/.homedirs/mike/.dovecot.sieve
> /var/mail/.homedirs/mike/.sieves/default.sieve
> lrwx------ 1 vmail dovecot uarch 21 Jul 21 19:38
> /var/mail/.homedirs/mike/.dovecot.sieve -> .sieves/default.sieve
> -rw------- 1 vmail dovecot uarch 5898 Jul 21 19:38
> /var/mail/.homedirs/mike/.sieves/default.sieve
>
> If I do remove that file at MW and repeat "doveadm sieve put" at KB, 
> I
> do see synchronization succeed:
>
> MW> rm /var/mail/.homedirs/mike/.sieves/default.sieve
>
> MW> la /var/mail/.homedirs/mike/.dovecot.sieve
> /var/mail/.homedirs/mike/.sieves/default.sieve
> ls: /var/mail/.homedirs/mike/.sieves/default.sieve: No such file or
> directory
> lrwx------ 1 vmail dovecot uarch 21 Jul 21 19:38
> /var/mail/.homedirs/mike/.dovecot.sieve -> .sieves/default.sieve
>
> KB> doveadm sieve put -u mike -a default < default
>
> KB> la /var/mail/.homedirs/mike/.dovecot.sieve
> /var/mail/.homedirs/mike/.sieves/default.sieve
> lrwx------ 1 vmail dovecot uarch 21 Jul 21 19:40
> /var/mail/.homedirs/mike/.dovecot.sieve -> .sieves/default.sieve
> -rw------- 1 vmail dovecot uarch 5909 Jul 21 19:40
> /var/mail/.homedirs/mike/.sieves/default.sieve
>
> MW> la /var/mail/.homedirs/mike/.dovecot.sieve
> /var/mail/.homedirs/mike/.sieves/default.sieve
> lrwx------ 1 vmail dovecot uarch 21 Jul 21 19:40
> /var/mail/.homedirs/mike/.dovecot.sieve -> .sieves/default.sieve
> -rw------- 1 vmail dovecot uarch 5909 Jan 1 1970
> /var/mail/.homedirs/mike/.sieves/default.sieve
>
> The date of the file puzzles me, though.
>
> JFTR: This is a recent FreeBSD and ZFS.
> JFTR: The logfiles do show the very same messages as Claud has shown 
> in
> his last mail.
>
> Regards,
> Michael

 

 Links:
 ------
 [1] mailto:stephan at rename-it.nl


More information about the dovecot mailing list