Re: imapsieve: script not triggered

2019-03-24 Thread Andreas Krischer via dovecot
Hello!

Sorry for replying on this quite old thread, but I just found the issue in my 
config and would like to share it if anyone else is having the same problem.

My passdb is ldap-based and I included a possibility to enable extra 
mail_plugins via LDAP (I used it for debug purposes).
There was the line:
pass_attrs = userPassword=password,=userdb_mail_plugins=%{ldap:mailPlugins}
Which caused the problem.

It seems like these setting does not added enabled plugins to IMAP but 
overwrote all other mail_plugins settings. Unfortunately just adding 
“$mail_plugins” does not work here as well, so I had to add all my plugins here 
manually.

Hope this help someone!

Best,
Andreas

> On 8. May 2018, at 08:53, Andreas Krischer  wrote:
> 
>> Check that sieve-test actually shows it would do what you expect it to do.
> 
> sieve-test just shows: learn-spam: error: the imapsieve extension cannot be 
> used outside IMAP.
> 
> Andreas
> 
>> Am 07.05.2018 um 20:56 schrieb Aki Tuomi > >:
>> 
>> 
>> 
>> On 2018-05-07 20:58, Andreas Krischer wrote:
>>> Hi, folks!
>>> 
>>> My problem:
>>> I set up dovecot with imapsieve to execute a script whenever a user copies 
>>> a mail to his Spam folder (spam autolearning). Unfortunately this script is 
>>> never executed regardless what I’m configuring for imapsieve. It looks like 
>>> dovecot doesn’t really load the plugin…
>>> 
>>> The "dovecot -n" output is attached.
>>> 
>>> I already tried setting imapsieve_mailbox1_name to *, but even this does 
>>> not execute the script… Also I tried a mailbox without mail_crypt enabled, 
>>> no success as well.
>>> 
>>> In the attached mail.log (mail_debug=yes) you can see, that 
>>> imap_sieve_plugin is loaded, but it isn’t really executed.
>>> 
>>> The normal (LMTP) sieve is working - if a mail is incoming the sieve module 
>>> shows it work in mail.log:
>>> 
>>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name 
>>> ): Debug: YEm9ILyS8FqSaAAAujt/SA: sieve: 
>>> file storage: Storage path `/var/vmail/myhost.name/postmaster/sieve' not 
>>> found
>>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name 
>>> ): Debug: YEm9ILyS8FqSaAAAujt/SA: sieve: 
>>> file storage: Storage path 
>>> `/var/vmail/myhost.name/postmaster/.dovecot.sieve' not found
>>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name 
>>> ): Debug: YEm9ILyS8FqSaAAAujt/SA: sieve: 
>>> storage: No default script location configured
>>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name 
>>> ): Debug: YEm9ILyS8FqSaAAAujt/SA: sieve: 
>>> User has no personal script
>>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name 
>>> ): Debug: YEm9ILyS8FqSaAAAujt/SA: sieve: 
>>> file storage: Using script storage path: /etc/dovecot/sieve/after/
>>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name 
>>> ): Debug: YEm9ILyS8FqSaAAAujt/SA: sieve: 
>>> file script: Opened script `spam' from `/etc/dovecot/sieve/after/spam.sieve'
>>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name 
>>> ): Debug: YEm9ILyS8FqSaAAAujt/SA: sieve: 
>>> executed after user's Sieve script(1): /etc/dovecot/sieve/after/spam.sieve
>>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name 
>>> ): Debug: Mailbox : Opened mail 
>>> UID=1 because: header Message-ID (Cache file is unusable)
>>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name 
>>> ): Debug: YEm9ILyS8FqSaAAAujt/SA: sieve: 
>>> Opening script 1 of 1 from `/etc/dovecot/sieve/after/spam.sieve'
>>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name 
>>> ): Debug: YEm9ILyS8FqSaAAAujt/SA: sieve: 
>>> Loading script /etc/dovecot/sieve/after/spam.sieve
>>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name 
>>> ): Debug: YEm9ILyS8FqSaAAAujt/SA: sieve: 
>>> Script binary /etc/dovecot/sieve/after/spam.svbin successfully loaded
>>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name 
>>> ): Debug: YEm9ILyS8FqSaAAAujt/SA: sieve: 
>>> binary save: not saving binary /etc/dovecot/sieve/after/spam.svbin, because 
>>> it is already stored
>>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name 
>>> ): Debug: YEm9ILyS8FqSaAAAujt/SA: sieve: 
>>> Executing script from `/etc/dovecot/sieve/after/spam.svbin'
>>> 
>>> 
>>> I already spent hours on this problem so please let me know if you have any 
>>> idea what the problem could be… :(
>>> 
>>> Thanks in advance!
>>> 
>>> Andreas
>>> 
>>> 
>>> 
>> 
>> Check that sieve-test actually shows it would do what you expect it to do.
>> 
>> Aki



Re: imapsieve: script not triggered

2018-05-08 Thread Thomas Leuxner
* Andreas Krischer  2018.05.07 19:58:

>   sieve_global_extensions = +vnd.dovecot.pipe

Hi,

my working configuration looks like this:

sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.execute

Regards
Thomas



signature.asc
Description: PGP signature


Re: imapsieve: script not triggered

2018-05-08 Thread Andreas Krischer
> Check that sieve-test actually shows it would do what you expect it to do.

sieve-test just shows: learn-spam: error: the imapsieve extension cannot be 
used outside IMAP.

Andreas

> Am 07.05.2018 um 20:56 schrieb Aki Tuomi :
> 
> 
> 
> On 2018-05-07 20:58, Andreas Krischer wrote:
>> Hi, folks!
>> 
>> My problem:
>> I set up dovecot with imapsieve to execute a script whenever a user copies a 
>> mail to his Spam folder (spam autolearning). Unfortunately this script is 
>> never executed regardless what I’m configuring for imapsieve. It looks like 
>> dovecot doesn’t really load the plugin…
>> 
>> The "dovecot -n" output is attached.
>> 
>> I already tried setting imapsieve_mailbox1_name to *, but even this does not 
>> execute the script… Also I tried a mailbox without mail_crypt enabled, no 
>> success as well.
>> 
>> In the attached mail.log (mail_debug=yes) you can see, that 
>> imap_sieve_plugin is loaded, but it isn’t really executed.
>> 
>> The normal (LMTP) sieve is working - if a mail is incoming the sieve module 
>> shows it work in mail.log:
>> 
>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
>> YEm9ILyS8FqSaAAAujt/SA: sieve: file storage: Storage path 
>> `/var/vmail/myhost.name/postmaster/sieve' not found
>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
>> YEm9ILyS8FqSaAAAujt/SA: sieve: file storage: Storage path 
>> `/var/vmail/myhost.name/postmaster/.dovecot.sieve' not found
>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
>> YEm9ILyS8FqSaAAAujt/SA: sieve: storage: No default script location configured
>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
>> YEm9ILyS8FqSaAAAujt/SA: sieve: User has no personal script
>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
>> YEm9ILyS8FqSaAAAujt/SA: sieve: file storage: Using script storage path: 
>> /etc/dovecot/sieve/after/
>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
>> YEm9ILyS8FqSaAAAujt/SA: sieve: file script: Opened script `spam' from 
>> `/etc/dovecot/sieve/after/spam.sieve'
>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
>> YEm9ILyS8FqSaAAAujt/SA: sieve: executed after user's Sieve script(1): 
>> /etc/dovecot/sieve/after/spam.sieve
>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
>> Mailbox : Opened mail UID=1 because: header Message-ID (Cache 
>> file is unusable)
>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
>> YEm9ILyS8FqSaAAAujt/SA: sieve: Opening script 1 of 1 from 
>> `/etc/dovecot/sieve/after/spam.sieve'
>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
>> YEm9ILyS8FqSaAAAujt/SA: sieve: Loading script 
>> /etc/dovecot/sieve/after/spam.sieve
>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
>> YEm9ILyS8FqSaAAAujt/SA: sieve: Script binary 
>> /etc/dovecot/sieve/after/spam.svbin successfully loaded
>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
>> YEm9ILyS8FqSaAAAujt/SA: sieve: binary save: not saving binary 
>> /etc/dovecot/sieve/after/spam.svbin, because it is already stored
>> May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
>> YEm9ILyS8FqSaAAAujt/SA: sieve: Executing script from 
>> `/etc/dovecot/sieve/after/spam.svbin'
>> 
>> 
>> I already spent hours on this problem so please let me know if you have any 
>> idea what the problem could be… :(
>> 
>> Thanks in advance!
>> 
>> Andreas
>> 
>> 
>> 
> 
> Check that sieve-test actually shows it would do what you expect it to do.
> 
> Aki



Re: imapsieve: script not triggered

2018-05-07 Thread Aki Tuomi



On 2018-05-07 20:58, Andreas Krischer wrote:

Hi, folks!

My problem:
I set up dovecot with imapsieve to execute a script whenever a user copies a 
mail to his Spam folder (spam autolearning). Unfortunately this script is never 
executed regardless what I’m configuring for imapsieve. It looks like dovecot 
doesn’t really load the plugin…

The "dovecot -n" output is attached.

I already tried setting imapsieve_mailbox1_name to *, but even this does not 
execute the script… Also I tried a mailbox without mail_crypt enabled, no 
success as well.

In the attached mail.log (mail_debug=yes) you can see, that imap_sieve_plugin 
is loaded, but it isn’t really executed.

The normal (LMTP) sieve is working - if a mail is incoming the sieve module 
shows it work in mail.log:

May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: file storage: Storage path 
`/var/vmail/myhost.name/postmaster/sieve' not found
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: file storage: Storage path 
`/var/vmail/myhost.name/postmaster/.dovecot.sieve' not found
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: storage: No default script location configured
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: User has no personal script
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: file storage: Using script storage path: 
/etc/dovecot/sieve/after/
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: file script: Opened script `spam' from 
`/etc/dovecot/sieve/after/spam.sieve'
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: executed after user's Sieve script(1): 
/etc/dovecot/sieve/after/spam.sieve
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: Mailbox 
: Opened mail UID=1 because: header Message-ID (Cache file is 
unusable)
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: Opening script 1 of 1 from 
`/etc/dovecot/sieve/after/spam.sieve'
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: Loading script 
/etc/dovecot/sieve/after/spam.sieve
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: Script binary 
/etc/dovecot/sieve/after/spam.svbin successfully loaded
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: binary save: not saving binary 
/etc/dovecot/sieve/after/spam.svbin, because it is already stored
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: Executing script from 
`/etc/dovecot/sieve/after/spam.svbin'


I already spent hours on this problem so please let me know if you have any 
idea what the problem could be… :(

Thanks in advance!

Andreas





Check that sieve-test actually shows it would do what you expect it to do.

Aki


imapsieve: script not triggered

2018-05-07 Thread Andreas Krischer
Hi, folks!

My problem:
I set up dovecot with imapsieve to execute a script whenever a user copies a 
mail to his Spam folder (spam autolearning). Unfortunately this script is never 
executed regardless what I’m configuring for imapsieve. It looks like dovecot 
doesn’t really load the plugin…

The "dovecot -n" output is attached. 

I already tried setting imapsieve_mailbox1_name to *, but even this does not 
execute the script… Also I tried a mailbox without mail_crypt enabled, no 
success as well.

In the attached mail.log (mail_debug=yes) you can see, that imap_sieve_plugin 
is loaded, but it isn’t really executed.

The normal (LMTP) sieve is working - if a mail is incoming the sieve module 
shows it work in mail.log:

May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: file storage: Storage path 
`/var/vmail/myhost.name/postmaster/sieve' not found
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: file storage: Storage path 
`/var/vmail/myhost.name/postmaster/.dovecot.sieve' not found
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: storage: No default script location configured
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: User has no personal script
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: file storage: Using script storage path: 
/etc/dovecot/sieve/after/
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: file script: Opened script `spam' from 
`/etc/dovecot/sieve/after/spam.sieve'
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: executed after user's Sieve script(1): 
/etc/dovecot/sieve/after/spam.sieve
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: Mailbox 
: Opened mail UID=1 because: header Message-ID (Cache file is 
unusable)
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: Opening script 1 of 1 from 
`/etc/dovecot/sieve/after/spam.sieve'
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: Loading script 
/etc/dovecot/sieve/after/spam.sieve
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: Script binary 
/etc/dovecot/sieve/after/spam.svbin successfully loaded
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: binary save: not saving binary 
/etc/dovecot/sieve/after/spam.svbin, because it is already stored
May  7 17:54:04 dovecot dovecot: lmtp(postmas...@myhost.name): Debug: 
YEm9ILyS8FqSaAAAujt/SA: sieve: Executing script from 
`/etc/dovecot/sieve/after/spam.svbin'


I already spent hours on this problem so please let me know if you have any 
idea what the problem could be… :(

Thanks in advance!

Andreas 



# 2.2.34 (874deae): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.22 (22940fb7)
# OS: Linux 4.13.13-5-pve x86_64 Debian 9.4 zfs
# Hostname: myhost.name
dict {
  ldap = ldap:/etc/dovecot/dovecot-ldap.conf.ext
}
disable_plaintext_auth = no
mail_attribute_dict = file:/var/vmail/%d/%n/Maildir/dovecot-attributes
mail_debug = yes
mail_gid = vmail
mail_location = maildir:/var/vmail/%d/%n/Maildir
mail_uid = vmail
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 vnd.dovecot.imapsieve
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
auto = subscribe
special_use = \Drafts
  }
  mailbox Sent {
auto = no
special_use = \Sent
  }
  mailbox "Sent Messages" {
auto = subscribe
special_use = \Sent
  }
  mailbox Spam {
auto = subscribe
special_use = \Junk
  }
  mailbox Trash {
auto = subscribe
special_use = \Trash
  }
  prefix = 
  separator = .
}
passdb {
  args = /etc/dovecot/dovecot-ldap.conf.ext
  driver = ldap
}
plugin {
  imapsieve_mailbox1_before = file:/etc/dovecot/sieve/learn-spam.sieve
  imapsieve_mailbox1_causes = COPY FLAG
  imapsieve_mailbox1_name = Spam
  imapsieve_mailbox2_before = file:/etc/dovecot/sieve/learn-ham.sieve
  imapsieve_mailbox2_causes = COPY
  imapsieve_mailbox2_from = Spam
  imapsieve_mailbox2_name = *
  last_login_dict = proxy::ldap
  last_login_key = last-login/%u
  mail_crypt_curve = secp521r1
  mail_crypt_save_version = 2
  mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename 
flag_change append
  sieve = file:~/sieve;active=~/.dovecot.sieve
  sieve_after = /etc/dovecot/sieve/after/
  sieve_global = /etc/dovecot/sieve/global/