Hello, I am building a new server on CentOS 7 and the global sieve filter can not be loaded. The debug shows: Nov? 9 15:23:09 mail dovecot: lmtp(11182, gao at mydomain.com): Debug: sieve: Pigeonhole version 0.4.2 initializing Nov? 9 15:23:09 mail dovecot: lmtp(11182, gao at mydomain.com): Debug: sieve: include: sieve_global_dir is not set; it is currently not possible to include `:global' scripts. The pigeonhole version: # yum list dovecot-pigeonhole dovecot-pigeonhole.x86_64 1:2.2.10-8.el7 I googled and got confused on how to make sieve point to the correct global filter (which I want auto deliver spams to Junk folder). So what is the correct setting? Thanks in advance. Gao Here is my doveconf -n output: ----------------------------------------------------------- [root at mail ~]# doveconf -n # 2.2.10: /etc/dovecot/dovecot.conf # OS: Linux 3.10.0-693.5.2.el7.x86_64 x86_64 CentOS Linux release 7.4.1708 (Core)? xfs auth_mechanisms = plain login cram-md5 first_valid_gid = 5000 first_valid_uid = 5000 last_valid_gid = 5000 last_valid_uid = 5000 listen = * mail_debug = yes mail_gid = 5000 mail_location = maildir:/home/vmail/%d/%n/:INDEX=/home/vmail/%d/%n/indexes mail_plugins = " quota" mail_uid = 5000 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 mbox_write_locks = fcntl namespace inbox { ? inbox = yes ? location ? mailbox Drafts { ??? auto = subscribe ??? special_use = \Drafts ? } ? mailbox Junk { ??? auto = subscribe ??? special_use = \Junk ? } ? mailbox Sent { ??? auto = subscribe ??? special_use = \Sent ? } ? mailbox "Sent Messages" { ??? special_use = \Sent ? } ? mailbox Trash { ??? auto = subscribe ??? special_use = \Trash ? } ? prefix } passdb { ? args = /etc/dovecot/conf.d/dovecot-mysql.conf.ext ? driver = sql } plugin { ? quota = maildir:User quota ? quota_exceeded_message = ERROR:422 - Mailbox full, sorry. ? quota_rule = Junk:ignore ? quota_rule2 = Trash:storage=+100M ? quota_warning = storage=90%% quota-warning 90 %u %d ? quota_warning2 = storage=80%% quota-warning 80 %u %d ? sieve = ~/sieve/.dovecot.sieve ? sieve_dir = ~/sieve ? sieve_global_path = /home/vmail/sieve/globalfilter.sieve ? sieve_max_script_size = 1M ? sievedir = ~/sieve } protocols = imap pop3 lmtp sieve service auth { ? unix_listener /var/spool/postfix/private/auth { ??? group = vmail ??? mode = 0666 ??? user = vmail ? } } service imap-login { ? inet_listener imap { ??? port = 143 ? } ? inet_listener imaps { ??? port = 993 ??? ssl = yes ? } } service lmtp { ? unix_listener /var/spool/postfix/private/dovecot-lmtp { ??? group = postfix ??? mode = 0600 ??? user = postfix ? } } service managesieve-login { ? inet_listener sieve { ??? port = 4190 ? } ? process_min_avail = 0 ? service_count = 1 ? vsz_limit = 64 M } service pop3-login { ? inet_listener pop3 { ??? port = 110 ? } ? inet_listener pop3s { ??? port = 995 ??? ssl = yes ? } } service quota-warning { ? executable = script /usr/local/bin/overquota.sh ? group = vmail ? unix_listener quota-warning { ??? group = vmail ??? user = vmail ? } ? user = vmail } ssl = required ssl_cert = </etc/letsencrypt/live/mydomain.com/fullchain.pem ssl_cipher_list = EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH+aRSA:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4 ssl_key = </etc/letsencrypt/live/mydomain.com/privkey.pem ssl_prefer_server_ciphers = yes ssl_protocols = !SSLv2 !SSLv3 userdb { ? args = /etc/dovecot/conf.d/dovecot-mysql.conf.ext ? driver = sql } protocol lmtp { ? mail_plugins = " quota sieve" ? postmaster_address = postmaster at mydomain.com } protocol imap { ? mail_plugins = " quota imap_quota" } protocol sieve { ? managesieve_implementation_string = Dovecot Pigeonhole ? managesieve_max_compile_errors = 5 ? managesieve_max_line_length = 65536 }
Set the sieve_global_dir like this. /etc/dovecot/conf.d/99-mystuff.conf: . . plugin { ? sieve???????????????? = ~/Maildir/dovecot.sieve ? sieve_dir???????????? = ~/Maildir/sieve ? sieve_global_dir????? = /etc/dovecot/sieve/global/ ? sieve_before????????? = /etc/dovecot/sieve/before.d/ #? sieve_before2??????? #? sieve_before3??????? ? sieve_after?????????? = /etc/dovecot/sieve/after.d/ #? sieve_after2???????? #? sieve_after3???????? ? fts?????????????????? = lucene ? fts_lucene??????????? = whitespace_chars=@. } Permissions: drwxr-xr-x. 174 root root system_u:object_r:etc_t:s0???????? 12288 Nov? 9 11:43 /etc drwxr-xr-x.?? 4 root root system_u:object_r:dovecot_etc_t:s0??? 95 Apr 28? 2016 /etc/dovecot drwxr-xr-x.?? 5 root root system_u:object_r:dovecot_etc_t:s0??? 64 Jul 13? 2015 /etc/dovecot/sieve drwxr-xr-x.?? 2 root root system_u:object_r:dovecot_etc_t:s0??? 10 Jul 13? 2015 /etc/dovecot/sieve/global Since this directory is read-only to all but root, pre-complie your scripts with 'sievec'. Bill On 11/9/2017 6:39 PM, Gao wrote:> Hello, > I am building a new server on CentOS 7 and the global sieve filter can not be loaded. The debug shows: > Nov? 9 15:23:09 mail dovecot: lmtp(11182, gao at mydomain.com): Debug: sieve: Pigeonhole version 0.4.2 initializing > Nov? 9 15:23:09 mail dovecot: lmtp(11182, gao at mydomain.com): Debug: sieve: include: sieve_global_dir is not set; it is > currently not possible to include `:global' scripts. > > The pigeonhole version: > # yum list dovecot-pigeonhole > dovecot-pigeonhole.x86_64 1:2.2.10-8.el7 > > I googled and got confused on how to make sieve point to the correct global filter (which I want auto deliver spams to Junk > folder). So what is the correct setting? > > Thanks in advance. > > Gao > > > > > Here is my doveconf -n output: > ----------------------------------------------------------- > [root at mail ~]# doveconf -n > # 2.2.10: /etc/dovecot/dovecot.conf > # OS: Linux 3.10.0-693.5.2.el7.x86_64 x86_64 CentOS Linux release 7.4.1708 (Core)? xfs > auth_mechanisms = plain login cram-md5 > first_valid_gid = 5000 > first_valid_uid = 5000 > last_valid_gid = 5000 > last_valid_uid = 5000 > listen = * > mail_debug = yes > mail_gid = 5000 > mail_location = maildir:/home/vmail/%d/%n/:INDEX=/home/vmail/%d/%n/indexes > mail_plugins = " quota" > mail_uid = 5000 > 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 > mbox_write_locks = fcntl > namespace inbox { > ? inbox = yes > ? location > ? mailbox Drafts { > ??? auto = subscribe > ??? special_use = \Drafts > ? } > ? mailbox Junk { > ??? auto = subscribe > ??? special_use = \Junk > ? } > ? mailbox Sent { > ??? auto = subscribe > ??? special_use = \Sent > ? } > ? mailbox "Sent Messages" { > ??? special_use = \Sent > ? } > ? mailbox Trash { > ??? auto = subscribe > ??? special_use = \Trash > ? } > ? prefix > } > passdb { > ? args = /etc/dovecot/conf.d/dovecot-mysql.conf.ext > ? driver = sql > } > plugin { > ? quota = maildir:User quota > ? quota_exceeded_message = ERROR:422 - Mailbox full, sorry. > ? quota_rule = Junk:ignore > ? quota_rule2 = Trash:storage=+100M > ? quota_warning = storage=90%% quota-warning 90 %u %d > ? quota_warning2 = storage=80%% quota-warning 80 %u %d > ? sieve = ~/sieve/.dovecot.sieve > ? sieve_dir = ~/sieve > ? sieve_global_path = /home/vmail/sieve/globalfilter.sieve > ? sieve_max_script_size = 1M > ? sievedir = ~/sieve > } > protocols = imap pop3 lmtp sieve > service auth { > ? unix_listener /var/spool/postfix/private/auth { > ??? group = vmail > ??? mode = 0666 > ??? user = vmail > ? } > } > service imap-login { > ? inet_listener imap { > ??? port = 143 > ? } > ? inet_listener imaps { > ??? port = 993 > ??? ssl = yes > ? } > } > service lmtp { > ? unix_listener /var/spool/postfix/private/dovecot-lmtp { > ??? group = postfix > ??? mode = 0600 > ??? user = postfix > ? } > } > service managesieve-login { > ? inet_listener sieve { > ??? port = 4190 > ? } > ? process_min_avail = 0 > ? service_count = 1 > ? vsz_limit = 64 M > } > service pop3-login { > ? inet_listener pop3 { > ??? port = 110 > ? } > ? inet_listener pop3s { > ??? port = 995 > ??? ssl = yes > ? } > } > service quota-warning { > ? executable = script /usr/local/bin/overquota.sh > ? group = vmail > ? unix_listener quota-warning { > ??? group = vmail > ??? user = vmail > ? } > ? user = vmail > } > ssl = required > ssl_cert = </etc/letsencrypt/live/mydomain.com/fullchain.pem > ssl_cipher_list = > EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH+aRSA:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4 > ssl_key = </etc/letsencrypt/live/mydomain.com/privkey.pem > ssl_prefer_server_ciphers = yes > ssl_protocols = !SSLv2 !SSLv3 > userdb { > ? args = /etc/dovecot/conf.d/dovecot-mysql.conf.ext > ? driver = sql > } > protocol lmtp { > ? mail_plugins = " quota sieve" > ? postmaster_address = postmaster at mydomain.com > } > protocol imap { > ? mail_plugins = " quota imap_quota" > } > protocol sieve { > ? managesieve_implementation_string = Dovecot Pigeonhole > ? managesieve_max_compile_errors = 5 > ? managesieve_max_line_length = 65536 > }
On Thu, 9 Nov 2017 21:02:44 -0500 Bill Shirley <bill at KnoxvilleChristian.org> wrote:> Set the sieve_global_dir like this. > /etc/dovecot/conf.d/99-mystuff.conf: > . > . > plugin { > ? sieve???????????????? = ~/Maildir/dovecot.sieve > ? sieve_dir???????????? = ~/Maildir/sieve > ? sieve_global_dir????? = /etc/dovecot/sieve/global/ > ? sieve_before????????? = /etc/dovecot/sieve/before.d/ > #? sieve_before2??????? > #? sieve_before3??????? > ? sieve_after?????????? = /etc/dovecot/sieve/after.d/ > #? sieve_after2???????? > #? sieve_after3???????? > > ? fts?????????????????? = lucene > ? fts_lucene??????????? = whitespace_chars=@. > } > > Permissions: > drwxr-xr-x. 174 root root system_u:object_r:etc_t:s0???????? 12288 Nov? 9 > 11:43 /etc drwxr-xr-x.?? 4 root root system_u:object_r:dovecot_etc_t:s0 > 95 Apr 28? 2016 /etc/dovecot drwxr-xr-x.?? 5 root root > system_u:object_r:dovecot_etc_t:s0??? 64 Jul 13? 2015 /etc/dovecot/sieve > drwxr-xr-x.?? 2 root root system_u:object_r:dovecot_etc_t:s0??? 10 Jul 13 > 2015 /etc/dovecot/sieve/global > > Since this directory is read-only to all but root, pre-complie your scripts > with 'sievec'. > > Bill... And don't follow this example setting sieve_dir inside your maildirs. This will lead to the dir being shown as imap folder which you don't want. Simply put out it outside and everything is fine. -- Regards, Stephan