Problem with dovecot-managesieved and sieve scripts in mysql
    ing. Petr Bitzan 
    petr.bitzan at lf3.cuni.cz
       
    Fri Oct  3 17:34:03 UTC 2014
    
    
  
Hello,
I would like to ask for advice on the following things:
 
I have sieve scripts stored in mysql,  work for LDA and imapd correctly.
When I try to connect using the client managesieve (Roungcube plugin managesieve with Thunderbird addon sieve), i receive the following error:
 
Oct  3 19:04:50 mail dovecot: managesieve(11044167): Debug: sieve: include: sieve_global_dir is not set; it is currently not possible to include `:global' scripts.
Oct  3 19:04:50 mail dovecot: managesieve(11044167): Error: sieve-storage: Cannot open non-file script location for active script `dict:proxy::sieve;name=active;bindir=/var/vmail/sieve-scripts/11044167'
Oct  3 19:04:50 mail dovecot: managesieve(11044167): Fatal: Failed to open Sieve storage.
 
If i change settings sieve to:
 
sieve = ~/.dovecot.sieve
sieve_dir = ~/sieve
 
it works fine.
 
can someone please advise configuring dovecot-managesieved with saving scripts in the database.
 
Thank you very much
 
Petr Bitzan
 
 
-------------
# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.6 ext4
auth_debug = yes
auth_mechanisms = plain login
auth_verbose = yes
dict {
  acl = mysql:/etc/dovecot/dovecot-acl-shared-dict.conf.ext
  sieve = mysql:/etc/dovecot/dict-sieve-sql.conf.ext
}
first_valid_gid = 1002
first_valid_uid = 1002
last_valid_gid = 1002
last_valid_uid = 1002
mail_debug = yes
mail_location = maildir:/var/vmail/%n/Maildir
mail_plugins = " mail_log notify acl"
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave
namespace {
  list = children
  location = maildir:%%h/Maildir:INDEX=~/shared/%%u/
  prefix = shared/%%u/
  separator = /
  subscriptions = yes
  type = shared
}
namespace inbox {
  hidden = no
  inbox = yes
  list = yes
  location = 
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox HAM {
    auto = subscribe
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox SPAM {
    auto = subscribe
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix = 
  separator = /
  subscriptions = yes
  type = private
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
plugin {
  acl = vfile
  acl_shared_dict = proxy::acl
  quota = maildir:User quota
  quota_warning = storage=95%% quota-warning 95 %u
  sieve = dict:proxy::sieve;name=active;bindir=/var/vmail/sieve-scripts/%u
  sieve_dir = dict:proxy::sieve;name=active;bindir=~/.sieve-bin
}
protocols = " imap lmtp sieve pop3"
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
}
service dict {
  unix_listener dict {
    group = vmail
    mode = 0600
    user = vmail
  }
}
service lmtp {
  inet_listener lmtp {
    address = 127.0.0.1
    port = 24
  }
  user = vmail
}
service managesieve-login {
  inet_listener sieve {
    address = xxxxxxx
    port = 4190
  }
}
service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  unix_listener quota-warning {
    user = vmail
  }
  user = dovecot
}
ssl_cert = </etc/ssl/certs/smtp.lf3.cuni.cz.pem
ssl_key = </etc/ssl/private/serverkeynopass.pem
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocol lmtp {
  mail_plugins = " mail_log notify acl quota sieve"
}
protocol lda {
  mail_plugins = " mail_log notify acl quota sieve acl"
}
protocol imap {
  mail_plugins = " mail_log notify acl quota imap_quota acl imap_acl"
}
protocol pop3 {
  mail_plugins = " mail_log notify acl quota"
}
 
dict-sieve-sql.conf.ext:
 
connect = host=xxxxxxxxxxxxx dbname=xxxxxxxx user=xxxxxxxx password=xxxxxxxxxxxxxx
map {
  pattern = priv/sieve/name/$script_name
  table = user_sieve_scripts
  username_field = username
  value_field = id
  fields {
    script_name = $script_name
  }
}
map {
  pattern = priv/sieve/data/$id
  table = user_sieve_scripts
  username_field = username
  value_field = script_data
  fields {
    id = $id
  }
}
 
CREATE TABLE IF NOT EXISTS `user_sieve_scripts` (
  `id` int(11) NOT NULL DEFAULT '0',
  `username` varchar(40) DEFAULT NULL,
  `script_name` varchar(255) DEFAULT NULL,
  `script_data` varchar(10240) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`,`script_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    
    
More information about the dovecot
mailing list