Create a default sieve folder on user creation

Troy Carpenter troy at carpenter.cx
Sat Apr 18 01:38:32 CEST 2015


I've noticed that when a user goes into the managesieve plugin in Roundcube,
it creates an empty "managesieve" script, and in /var/lib/imap/sieve/... it
creates a user directory of the following structure if it doesn't already
exist:

drwx------ 2 cyrus mail 4.0K Apr 17 16:09 .
drwx------ 6 cyrus mail 4.0K Apr 17 19:08 ..
lrwxrwxrwx 1 cyrus mail    7 Apr 17 15:42 defaultbc -> USER.bc
-rw------- 1 cyrus mail  124 Apr 17 15:50 managesieve.bc
-rw------- 1 cyrus mail  168 Apr 17 15:50 managesieve.script
-rw------- 1 cyrus mail   40 Apr 17 16:09 USER.bc
-rw------- 1 cyrus mail  269 Apr 17 16:09 USER.script

However, the user has to actually go into the managesieve setting screen to
create the above files, logging into Roundcube isn't enough.  On top of
that, not all my users use Roundcube so there is no guarantee the user files
would ever get created.

Based on that, I would like to create the above directory with the same
files on user creation from the kolab-webadmin interface.  The
managesieve.script file us already active and has a single rule which moves
emails identified as SPAM by Kolab into the Spam folder.  It would be the
same rule for everyone.  I'm not looking to prevent people from changing or
even disabling the rule, but I do want it as the default for any new user.

Is there a mechanism to tie into the process that creates the mailbox such
that the sieve directory can be created at the same time?

Thanks,
Troy Carpenter
troy at carpenter dot cx 




More information about the users mailing list