On Sun, Feb 12, 2017 at 3:52 PM, Aki Tuomi <aki.tuomi at dovecot.fi> wrote:> > > On February 10, 2017 at 10:06 AM Aki Tuomi <aki.tuomi at 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 at 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 at 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 ---
On 12.02.2017 17:36, George Kontostanos wrote:> it automatically creates a .spamassassin/ folder in the userThat happens because sa-learn is invoked as the user who is logged into IMAP. If you want all users to contribute to a global SpamAssassin database (like I do), you'll need to create your own learning mechanism instead of calling sa-learn directly. -Ralph
On Sun, Feb 12, 2017 at 7:52 PM, Ralph Seichter <dovecot-ml at seichter.de> wrote:> On 12.02.2017 17:36, George Kontostanos wrote: > >> it automatically creates a .spamassassin/ folder in the user > > That happens because sa-learn is invoked as the user who is logged into > IMAP. If you want all users to contribute to a global SpamAssassin > database (like I do), you'll need to create your own learning mechanism > instead of calling sa-learn directly. > > -RalphActually I think that sa-learn is invoked as user vmail. But of course I might be wrong. sa-learn-ham.sh LOG='/var/log/sa-learn.log' exec /usr/local/bin/sa-learn --ham -D >> $LOG 2>&1 I had to give ownership to vmail to sa-learn.log otherwise it would refuse to run. Do you have any suggestions as per the way sa-learn should be executed? Thanks for your help. -- George Kontostanos ---
Op 2/12/2017 om 5:36 PM schreef George Kontostanos:> On Sun, Feb 12, 2017 at 3:52 PM, Aki Tuomi <aki.tuomi at dovecot.fi> wrote: > >>> On February 10, 2017 at 10:06 AM Aki Tuomi <aki.tuomi at 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 at 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 at dmain): Debug: imapsieve: Static mailbox rule > [2]: mailbox=`*' from=`Junk' causes=(COPY) => > before=`file:/usr/local/lib/dovecot/sieve/report-ham.sieve' after=(none)That is not an error. That is merely a debug message indicating that the vnd.dovecot.execute extension is unconfigured. Don't enable that extension if you're not using the "execute" command/test. Yes, it is in the example, but it has no function either. Only the vnd.dovecot.pipe extension is actually used ("pipe" command).> 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.The likely scenario is that the sa-learn tool is creating a hidden directory inside the $HOME directory of the user for user-specific state information. According to your mail_home and mail_location configuration, that is the same directory as the INBOX mailbox. That is why this may be interpreted as a mailbox by the maildir format. It is generally a bad idea to have those equal; you should put the mail location in a sub-directory of the home directory to prevent problems like this. https://wiki.dovecot.org/VirtualUsers/Home Regards, Stephan.
On Sun, Feb 12, 2017 at 8:56 PM, Stephan Bosch <stephan at rename-it.nl> wrote:> Op 2/12/2017 om 5:36 PM schreef George Kontostanos: >> On Sun, Feb 12, 2017 at 3:52 PM, Aki Tuomi <aki.tuomi at dovecot.fi> wrote: >> >>>> On February 10, 2017 at 10:06 AM Aki Tuomi <aki.tuomi at 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 at 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 at dmain): Debug: imapsieve: Static mailbox rule >> [2]: mailbox=`*' from=`Junk' causes=(COPY) => >> before=`file:/usr/local/lib/dovecot/sieve/report-ham.sieve' after=(none) > > That is not an error. That is merely a debug message indicating that the > vnd.dovecot.execute extension is unconfigured. > > Don't enable that extension if you're not using the "execute" > command/test. Yes, it is in the example, but it has no function either. > Only the vnd.dovecot.pipe extension is actually used ("pipe" command). > >> 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. > > The likely scenario is that the sa-learn tool is creating a hidden > directory inside the $HOME directory of the user for user-specific state > information. According to your mail_home and mail_location > configuration, that is the same directory as the INBOX mailbox. That is > why this may be interpreted as a mailbox by the maildir format. It is > generally a bad idea to have those equal; you should put the mail > location in a sub-directory of the home directory to prevent problems > like this. > > https://wiki.dovecot.org/VirtualUsers/Home > > Regards, > > Stephan. > > >That makes perfect sense. I might need to find a way to migrate now to the correct structure. Thanks -- George Kontostanos ---