On Sun, Feb 12, 2017 at 3:52 PM, Aki Tuomi <aki.tuomi@dovecot.fi> wrote:
On February 10, 2017 at 10:06 AM Aki Tuomi <aki.tuomi@dovecot.fi> wrote:
Hi!
Since antispam plugin is deprecated and we would really prefer people
not to use it, we wrote instructions on how to replace it with
IMAPSieve. Comments and suggestions are most welcome.
https://wiki.dovecot.org/HowTo/AntispamWithSieve
Aki Tuomi
Dovecot oy
Hi everyone,
thank you all for your feedback, questions and comments. We have upgraded
the documentation based on this, including information how to exclude Trash
folder in ham script.
Aki
Thank you all very much. I am now running into a very weird issue. Whenever
an Junk email is “seen” I get the following error:
Debug: sieve: vnd.dovecot.execute extension: no bin or socket directory
specified; extension is unconfigured (both sieve_execute_bin_dir and
sieve_execute_socket_dir are not set)
Feb 12 18:02:54 imap(user@domain): Debug: imapsieve: Static mailbox rule
[1]: mailbox=Junk' from=
*' causes=(COPY) =>
before=file:/usr/local/lib/dovecot/sieve/report-spam.sieve' after=(none) Feb 12 18:02:54 imap(user@dmain): Debug: imapsieve: Static mailbox rule [2]: mailbox=
*' from=Junk' causes=(COPY) => before=
file:/usr/local/lib/dovecot/sieve/report-ham.sieve' after=(none)
Also it automatically creates a .spamassassin/ folder in the user:
-rw------- 1 vmail vmail 136 Feb 10 17:33 .dovecot.lda-dupes
lrwx------ 1 vmail vmail 17 Mar 13 2016 .dovecot.sieve@ ->
managesieve.sieve
-rw------- 1 vmail vmail 322 Feb 11 03:02 .dovecot.svbin
drwx------ 2 vmail vmail 512 Feb 12 18:04 .spamassassin/
drwx------ 5 vmail vmail 512 Feb 10 17:32 Drafts/
drwx------ 5 vmail vmail 512 Feb 12 18:09 Junk/
drwx------ 5 vmail vmail 512 Feb 11 17:36 Saved/
drwx------ 5 vmail vmail 512 Jan 16 11:55 Sent/
drwx------ 5 vmail vmail 512 Feb 12 18:09 Trash/
drwx------ 2 vmail vmail 1024 Feb 12 18:07 cur/
-rw------- 1 vmail vmail 21 Mar 13 2016 dovecot-acl-list
-rw------- 1 vmail vmail 68 Oct 17 13:19 dovecot-keywords
-rw------- 1 vmail vmail 245 Feb 12 18:07 dovecot-uidlist
-rw------- 1 vmail vmail 8 Jun 9 2016 dovecot-uidvalidity
-r--r--r-- 1 vmail vmail 0 Mar 12 2016 dovecot-uidvalidity.56e48129
-rw------- 1 vmail vmail 640 Feb 11 22:24 dovecot.index
-rw------- 1 vmail vmail 27788 Feb 12 18:07 dovecot.index.cache
-rw------- 1 vmail vmail 25996 Feb 12 18:07 dovecot.index.log
-rw------- 1 vmail vmail 192 Feb 12 16:04 dovecot.mailbox.log
-rw------- 1 vmail vmail 181 Feb 10 17:34 managesieve.sieve
drwx------ 2 vmail vmail 512 Feb 12 17:46 new/
-rw------- 1 vmail vmail 39 Jun 9 2016 subscriptions
drwx------ 2 vmail vmail 512 Feb 12 18:04 tmp/
Any ideas ? I am attaching my config.
Thanks
2.2.27 (c0f36b0): /usr/local/etc/dovecot/dovecot.conf
Pigeonhole version 0.4.16 (fed8554)
OS: FreeBSD 10.3-RELEASE-p11 amd64 ufs
auth_mechanisms = plain login
auth_verbose = yes
default_client_limit = 2560
default_process_limit = 512
dict {
acl = mysql:/usr/local/etc/dovecot/dovecot-dict-sql.conf.ext
quota = mysql:/usr/local/etc/dovecot/dovecot-dict-sql.conf.ext
}
log_path = /var/log/dovecot.log
mail_home = /usr/local/vhosts/mail/%d/%n
mail_location = maildir:/usr/local/vhosts/mail/%d/%n:LAYOUT=fs
mail_max_userip_connections = 20
mail_plugins = quota acl
mail_privileged_group = vmail
mail_shared_explicit_inbox = yes
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 index ihave
duplicate mime foreverypart extracttext imapsieve
mbox_write_locks = fcntl
namespace {
inbox = no
list = children
location =
maildir:/usr/local/vhosts/mail/%%d/%%n:LAYOUT=fs:INDEX=/usr/local/vhosts/indexes/%d/%n/shared/%%u:INDEXPVT=/usr/local/vhosts/indexes/%d/%n/shared/%%u
prefix = shared/%%d/%%n/
separator = /
subscriptions = no
type = shared
}
namespace inbox {
inbox = yes
list = yes
location =
mailbox Drafts {
auto = subscribe
special_use = \Drafts
}
mailbox Junk {
auto = subscribe
special_use = \Junk
}
mailbox Sent {
auto = subscribe
special_use = \Sent
}
mailbox Trash {
auto = subscribe
special_use = \Trash
}
prefix =
separator = /
type = private
}
passdb {
args = /usr/local/etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
plugin {
acl = vfile
acl_shared_dict = proxy::acl
imapsieve_mailbox1_before =
file:/usr/local/lib/dovecot/sieve/report-spam.sieve
imapsieve_mailbox1_causes = COPY
imapsieve_mailbox1_name = Junk
imapsieve_mailbox2_before =
file:/usr/local/lib/dovecot/sieve/report-ham.sieve
imapsieve_mailbox2_causes = COPY
imapsieve_mailbox2_from = Junk
imapsieve_mailbox2_name = *
quota = dict:User quota::proxy::quota
quota_rule2 = Trash:storage=+100M
sieve = /usr/local/vhosts/mail/%d/%n/.dovecot.sieve
sieve_before = /usr/local/vhosts/sieve/before.d/
sieve_dir = /usr/local/vhosts/mail/%d/%n
sieve_global_dir = /usr/local/vhosts/sieve/%d
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.execute
sieve_global_path = /usr/local/vhosts/sieve/%d/default.sieve
sieve_pipe_bin_dir = /usr/local/lib/dovecot/sieve
sieve_plugins = sieve_imapsieve sieve_extprograms
}
protocols = imap lmtp sieve sieve
service auth-worker {
user = vmail
}
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0666
user = postfix
}
unix_listener auth-userdb {
mode = 0600
user = vmail
}
user = dovecot
}
service dict {
unix_listener dict {
mode = 0600
user = vmail
}
}
service imap-login {
inet_listener imap {
port = 143
}
}
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
}
ssl_cert = </usr/local/etc/postfix/keys/mail.my.domain.crt
ssl_key = # hidden, use -P to show it
userdb {
args = /usr/local/etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
protocol lmtp {
mail_plugins = quota acl sieve
}
protocol imap {
imap_client_workarounds = tb-extra-mailbox-sep
mail_plugins = quota acl imap_quota imap_acl imap_sieve
}
protocol lda {
mail_plugins = quota acl sieve acl
postmaster_address = root
}
local xxx.xxx.xxx.xxx {
protocol imap {
ssl_cert = </usr/local/etc/postfix/keys/mail.my.domain.crt
ssl_key = # hidden, use -P to show it
}
}
George Kontostanos