IMAPSieve plugin will not run rspamd script
Host: VMware Workstation 14.1.8
OS: Debian 12 (Bookworm)
Dovecot: 2.3.19.1
Postfix: 3.7.10 Mailclient: Outlook 2016
Hello,
I am currently working on a new mail server to replace my Debian 10 mail server. For preparation, I use VMware Workstation to learn and test the installation steps. When I'm eventually done, I'll rebuild my root server from scratch.
This time, my problem is getting the IMAPSieve plugin working to trigger rspamd if mail gets moved to the junk folder. Sieve runs well – if rspam recognizes a spam mail, it will be transferred to the junk folder.
For me it looks like the IMAPSieve plugin recognizes the move but will not running the script behind. I can see some actions in the log but nothing happens on the rspamd side where the log is also open to view. Moving a mail with Outlook produces the following log entry:
imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: Module loaded: /usr/lib/dovecot/modules/lib95_imap_sieve_plugin.so
imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: imapsieve: mailbox INBOX/Spam: APPEND event
imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: sieve: Pigeonhole version 0.5.19 (4eae2f79) initializing
imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: sieve: include: sieve_global is not set; it is currently not possible to include `:global' scripts.
imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: sieve: Sieve imapsieve plugin for Pigeonhole version 0.5.19 (4eae2f79) loaded
imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: sieve: Sieve Extprograms plugin for Pigeonhole version 0.5.19 (4eae2f79) loaded
imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: imapsieve: Static mailbox rule [1]: mailbox=Spam' from=
*' causes=(COPY APPEND) => before=`file:/usr/lib/dovecot/sieve/report-spam.sieve' after=(none)
imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: imapsieve: Static mailbox rule [2]: mailbox=*' from=
Spam' causes=(COPY APPEND) => before=`file:/usr/lib/dovecot/sieve/report-ham.sieve' after=(none)
imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: imapsieve: mailbox INBOX: FLAG event (changed flags: \Deleted)
imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: sieve: Pigeonhole version 0.5.19 (4eae2f79) initializing
imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: sieve: include: sieve_global is not set; it is currently not possible to include `:global' scripts.
imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: sieve: Sieve imapsieve plugin for Pigeonhole version 0.5.19 (4eae2f79) loaded
imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: sieve: Sieve Extprograms plugin for Pigeonhole version 0.5.19 (4eae2f79) loaded
imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: imapsieve: Static mailbox rule [1]: mailbox=Spam' from=
*' causes=(COPY APPEND) => before=`file:/usr/lib/dovecot/sieve/report-spam.sieve' after=(none)
imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: imapsieve: Static mailbox rule [2]: mailbox=*' from=
Spam' causes=(COPY APPEND) => before=`file:/usr/lib/dovecot/sieve/report-ham.sieve' after=(none)
imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: imapsieve: mailbox INBOX: FLAG event (changed flags: \Seen)
My /etc/dovecot/local.conf looks like this:
## dovecot.conf
# Mailuser im Log mit Namen darstellen
verbose_proctitle = yes
protocols = imap lmtp sieve
## 10-auth.conf
# Disable LOGIN command and all other plaintext authentications unless
# SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
# matches the local IP (ie. you're connecting from the same computer), the
# connection is considered secure and plaintext authentication is allowed.
# See also ssl=required setting.
disable_plaintext_auth = yes
# Space separated list of wanted authentication mechanisms:
# plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp
# gss-spnego
# NOTE: See also disable_plaintext_auth setting.
auth_mechanisms = plain login
# Username formatting before it's looked up from databases. You can use
# the standard variables here, eg. %Lu would lowercase the username, %n would
# drop away the domain if it was given, or "%n-AT-%d" would change the '@' into
# "-AT-". This translation is done after auth_username_translation changes.
auth_username_format = %Lu
##
## Password and user databases
##
#
# Password database is used to verify user's password (and nothing more).
# You can have multiple passdbs and userdbs. This is useful if you want to
# allow both system users (/etc/passwd) and virtual users to login without
# duplicating the system users into virtual database.
#
# <doc/wiki/PasswordDatabase.txt>
#
# User database specifies where mails are located and what user/group IDs
# own them. For single-UID configuration use "static" userdb.
#
# <doc/wiki/UserDatabase.txt>
#!include conf.d/auth-deny.conf.ext
#!include conf.d/auth-master.conf.ext
#!include conf.d/auth-system.conf.ext
#!include conf.d/auth-sql.conf.ext
#!include conf.d/auth-ldap.conf.ext
!include conf.d/auth-passwdfile.conf.ext
#!include conf.d/auth-checkpassword.conf.ext
#!include conf.d/auth-static.conf.ext
## 10-director.conf
## 10-logging.conf
# Loglevel festelegen
auth_verbose = no
auth_debug = no
mail_debug = yes
## 10-mail.conf
# Format der Mailbox ändern
mail_location = maildir:~/Maildir
namespace inbox {
# Namespace type: private, shared or public
type = private
# Hierarchy separator to use. You should use the same separator for all
# namespaces or some clients get confused. '/' is usually a good one.
# The default however depends on the underlying mail storage format.
separator = /
# Prefix required to access this namespace. This needs to be different for
# all namespaces. For example "Public/".
prefix = INBOX/
# Physical location of the mailbox. This is in same format as
# mail_location, which is also the default for it.
location =
# There can be only one INBOX, and this setting defines which namespace
# has it.
inbox = yes
# If namespace is hidden, it's not advertised to clients via NAMESPACE
# extension. You'll most likely also want to set list=no. This is mostly
# useful when converting from another server with different namespaces which
# you want to deprecate but still keep working. For example you can create
# hidden namespaces with prefixes "~/mail/", "~%u/mail/" and "mail/".
hidden = no
# If namespace namespace/location fails to load, by default the entire
# session will fail to start. If this is set, this namespace will be ignored
# instead.
ignore_on_failure = no
# Show the mailboxes under this namespace with LIST command. This makes the
# namespace visible for clients that don't support NAMESPACE extension.
# "children" value lists child mailboxes, but hides the namespace prefix.
list = yes
# Namespace handles its own subscriptions. If set to "no", the parent
# namespace handles them (empty prefix should always have this as "yes")
subscriptions = yes
# See 15-mailboxes.conf for definitions of special mailboxes.
}
## 10-master.conf
service lmtp {
inet_listener lmtp {
address = 127.0.0.1 ::1
port = 24
}
}
service auth {
# auth_socket_path points to this userdb socket by default. It's typically
# used by dovecot-lda, doveadm, possibly imap process, etc. Users that have
# full permissions to this socket are able to get a list of all usernames and
# get the results of everyone's userdb lookups.
#
# The default 0666 mode allows anyone to connect to the socket, but the
# userdb lookups will succeed only if the userdb returns an "uid" field that
# matches the caller process's UID. Also if caller's uid or gid matches the
# socket's uid or gid the lookup succeeds. Anything else causes a failure.
#
# To give the caller full permissions to lookup all users, set the mode to
# something else than 0666 and Dovecot lets the kernel enforce the
# permissions (e.g. 0777 allows everyone full permissions).
unix_listener auth-userdb {
#mode = 0666
#user =
#group =
}
# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0666
}
# Auth process is run as this user.
#user = $default_internal_user
}
## 10-ssl.conf
## 10-tcpwrapper.conf
## 15-lda.conf
## 15-mailboxes.conf
namespace inbox {
inbox = yes
mailbox Spam {
auto = subscribe
special_use = \Junk
}
mailbox Trash {
auto = subscribe
special_use = \Trash
}
mailbox Drafts {
auto = subscribe
special_use = \Drafts
}
mailbox Sent {
auto = subscribe
special_use = \Sent
}
}
## 20-imap.conf
protocol imap {
# Space separated list of plugins to load (default is global mail_plugins).
mail_plugins = $mail_plugins imap_sieve
}
## 20-lmtp.conf
protocol lmtp {
# Space separated list of plugins to load (default is global mail_plugins).
mail_plugins = $mail_plugins sieve
}
## 20-managesieve.conf
## 90-acl.conf
## 90-plugin.conf
## 90-quota.conf
## 90-sieve.conf
plugin {
sieve_before = /etc/dovecot/conf.d/custom-sieve/global_before.sieve
sieve_after = /etc/dovecot/conf.d/custom-sieve/global_after.sieve
sieve_plugins = sieve_imapsieve sieve_extprograms
# From elsewhere to Spam folder
imapsieve_mailbox1_name = Spam
imapsieve_mailbox1_causes = COPY APPEND
imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/report-spam.sieve
# From Spam folder to elsewhere
imapsieve_mailbox2_name = *
imapsieve_mailbox2_from = Spam
imapsieve_mailbox2_causes = COPY APPEND
imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve
sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
}
## 90-sieve-extprograms.conf
root@ServerIV-home:~# ^C
root@ServerIV-home:~# cat /etc/dovecot/local.conf
## dovecot.conf
# Mailuser im Log mit Namen darstellen
verbose_proctitle = yes
protocols = imap lmtp sieve
## 10-auth.conf
# Disable LOGIN command and all other plaintext authentications unless
# SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
# matches the local IP (ie. you're connecting from the same computer), the
# connection is considered secure and plaintext authentication is allowed.
# See also ssl=required setting.
disable_plaintext_auth = yes
# Space separated list of wanted authentication mechanisms:
# plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp
# gss-spnego
# NOTE: See also disable_plaintext_auth setting.
auth_mechanisms = plain login
# Username formatting before it's looked up from databases. You can use
# the standard variables here, eg. %Lu would lowercase the username, %n would
# drop away the domain if it was given, or "%n-AT-%d" would change the '@' into
# "-AT-". This translation is done after auth_username_translation changes.
auth_username_format = %Lu
##
## Password and user databases
##
#
# Password database is used to verify user's password (and nothing more).
# You can have multiple passdbs and userdbs. This is useful if you want to
# allow both system users (/etc/passwd) and virtual users to login without
# duplicating the system users into virtual database.
#
# <doc/wiki/PasswordDatabase.txt>
#
# User database specifies where mails are located and what user/group IDs
# own them. For single-UID configuration use "static" userdb.
#
# <doc/wiki/UserDatabase.txt>
#!include conf.d/auth-deny.conf.ext
#!include conf.d/auth-master.conf.ext
#!include conf.d/auth-system.conf.ext
#!include conf.d/auth-sql.conf.ext
#!include conf.d/auth-ldap.conf.ext
!include conf.d/auth-passwdfile.conf.ext
#!include conf.d/auth-checkpassword.conf.ext
#!include conf.d/auth-static.conf.ext
## 10-director.conf
## 10-logging.conf
# Loglevel festelegen
auth_verbose = no
auth_debug = no
mail_debug = yes
## 10-mail.conf
# Format der Mailbox ändern
mail_location = maildir:~/Maildir
namespace inbox {
# Namespace type: private, shared or public
type = private
# Hierarchy separator to use. You should use the same separator for all
# namespaces or some clients get confused. '/' is usually a good one.
# The default however depends on the underlying mail storage format.
separator = /
# Prefix required to access this namespace. This needs to be different for
# all namespaces. For example "Public/".
prefix = INBOX/
# Physical location of the mailbox. This is in same format as
# mail_location, which is also the default for it.
location =
# There can be only one INBOX, and this setting defines which namespace
# has it.
inbox = yes
# If namespace is hidden, it's not advertised to clients via NAMESPACE
# extension. You'll most likely also want to set list=no. This is mostly
# useful when converting from another server with different namespaces which
# you want to deprecate but still keep working. For example you can create
# hidden namespaces with prefixes "~/mail/", "~%u/mail/" and "mail/".
hidden = no
# If namespace namespace/location fails to load, by default the entire
# session will fail to start. If this is set, this namespace will be ignored
# instead.
ignore_on_failure = no
# Show the mailboxes under this namespace with LIST command. This makes the
# namespace visible for clients that don't support NAMESPACE extension.
# "children" value lists child mailboxes, but hides the namespace prefix.
list = yes
# Namespace handles its own subscriptions. If set to "no", the parent
# namespace handles them (empty prefix should always have this as "yes")
subscriptions = yes
# See 15-mailboxes.conf for definitions of special mailboxes.
}
## 10-master.conf
service lmtp {
inet_listener lmtp {
address = 127.0.0.1 ::1
port = 24
}
}
service auth {
# auth_socket_path points to this userdb socket by default. It's typically
# used by dovecot-lda, doveadm, possibly imap process, etc. Users that have
# full permissions to this socket are able to get a list of all usernames and
# get the results of everyone's userdb lookups.
#
# The default 0666 mode allows anyone to connect to the socket, but the
# userdb lookups will succeed only if the userdb returns an "uid" field that
# matches the caller process's UID. Also if caller's uid or gid matches the
# socket's uid or gid the lookup succeeds. Anything else causes a failure.
#
# To give the caller full permissions to lookup all users, set the mode to
# something else than 0666 and Dovecot lets the kernel enforce the
# permissions (e.g. 0777 allows everyone full permissions).
unix_listener auth-userdb {
#mode = 0666
#user =
#group =
}
# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0666
}
# Auth process is run as this user.
#user = $default_internal_user
}
## 10-ssl.conf
## 10-tcpwrapper.conf
## 15-lda.conf
## 15-mailboxes.conf
namespace inbox {
inbox = yes
mailbox Spam {
auto = subscribe
special_use = \Junk
}
mailbox Trash {
auto = subscribe
special_use = \Trash
}
mailbox Drafts {
auto = subscribe
special_use = \Drafts
}
mailbox Sent {
auto = subscribe
special_use = \Sent
}
}
## 20-imap.conf
protocol imap {
# Space separated list of plugins to load (default is global mail_plugins).
mail_plugins = $mail_plugins imap_sieve
}
## 20-lmtp.conf
protocol lmtp {
# Space separated list of plugins to load (default is global mail_plugins).
mail_plugins = $mail_plugins sieve
}
## 20-managesieve.conf
## 90-acl.conf
## 90-plugin.conf
## 90-quota.conf
## 90-sieve.conf
plugin {
sieve_before = /etc/dovecot/conf.d/custom-sieve/global_before.sieve
sieve_after = /etc/dovecot/conf.d/custom-sieve/global_after.sieve
sieve_plugins = sieve_imapsieve sieve_extprograms
# From elsewhere to Spam folder
imapsieve_mailbox1_name = Spam
imapsieve_mailbox1_causes = COPY APPEND
imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/report-spam.sieve
# From Spam folder to elsewhere
imapsieve_mailbox2_name = *
imapsieve_mailbox2_from = Spam
imapsieve_mailbox2_causes = COPY APPEND
imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve
sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
}
## 90-sieve-extprograms.conf
root@ServerIV-home:~# cat /etc/dovecot/local.conf
## dovecot.conf
# Mailuser im Log mit Namen darstellen
verbose_proctitle = yes
protocols = imap lmtp sieve
## 10-auth.conf
# Disable LOGIN command and all other plaintext authentications unless
# SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
# matches the local IP (ie. you're connecting from the same computer), the
# connection is considered secure and plaintext authentication is allowed.
# See also ssl=required setting.
disable_plaintext_auth = yes
# Space separated list of wanted authentication mechanisms:
# plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp
# gss-spnego
# NOTE: See also disable_plaintext_auth setting.
auth_mechanisms = plain login
# Username formatting before it's looked up from databases. You can use
# the standard variables here, eg. %Lu would lowercase the username, %n would
# drop away the domain if it was given, or "%n-AT-%d" would change the '@' into
# "-AT-". This translation is done after auth_username_translation changes.
auth_username_format = %Lu
##
## Password and user databases
##
#
# Password database is used to verify user's password (and nothing more).
# You can have multiple passdbs and userdbs. This is useful if you want to
# allow both system users (/etc/passwd) and virtual users to login without
# duplicating the system users into virtual database.
#
# <doc/wiki/PasswordDatabase.txt>
#
# User database specifies where mails are located and what user/group IDs
# own them. For single-UID configuration use "static" userdb.
#
# <doc/wiki/UserDatabase.txt>
#!include conf.d/auth-deny.conf.ext
#!include conf.d/auth-master.conf.ext
#!include conf.d/auth-system.conf.ext
#!include conf.d/auth-sql.conf.ext
#!include conf.d/auth-ldap.conf.ext
!include conf.d/auth-passwdfile.conf.ext
#!include conf.d/auth-checkpassword.conf.ext
#!include conf.d/auth-static.conf.ext
## 10-director.conf
## 10-logging.conf
# Loglevel festelegen
auth_verbose = no
auth_debug = no
mail_debug = yes
## 10-mail.conf
# Format der Mailbox ändern
mail_location = maildir:~/Maildir
namespace inbox {
# Namespace type: private, shared or public
type = private
# Hierarchy separator to use. You should use the same separator for all
# namespaces or some clients get confused. '/' is usually a good one.
# The default however depends on the underlying mail storage format.
separator = /
# Prefix required to access this namespace. This needs to be different for
# all namespaces. For example "Public/".
prefix = INBOX/
# Physical location of the mailbox. This is in same format as
# mail_location, which is also the default for it.
location =
# There can be only one INBOX, and this setting defines which namespace
# has it.
inbox = yes
# If namespace is hidden, it's not advertised to clients via NAMESPACE
# extension. You'll most likely also want to set list=no. This is mostly
# useful when converting from another server with different namespaces which
# you want to deprecate but still keep working. For example you can create
# hidden namespaces with prefixes "~/mail/", "~%u/mail/" and "mail/".
hidden = no
# If namespace namespace/location fails to load, by default the entire
# session will fail to start. If this is set, this namespace will be ignored
# instead.
ignore_on_failure = no
# Show the mailboxes under this namespace with LIST command. This makes the
# namespace visible for clients that don't support NAMESPACE extension.
# "children" value lists child mailboxes, but hides the namespace prefix.
list = yes
# Namespace handles its own subscriptions. If set to "no", the parent
# namespace handles them (empty prefix should always have this as "yes")
subscriptions = yes
# See 15-mailboxes.conf for definitions of special mailboxes.
}
## 10-master.conf
service lmtp {
inet_listener lmtp {
address = 127.0.0.1 ::1
port = 24
}
}
service auth {
# auth_socket_path points to this userdb socket by default. It's typically
# used by dovecot-lda, doveadm, possibly imap process, etc. Users that have
# full permissions to this socket are able to get a list of all usernames and
# get the results of everyone's userdb lookups.
#
# The default 0666 mode allows anyone to connect to the socket, but the
# userdb lookups will succeed only if the userdb returns an "uid" field that
# matches the caller process's UID. Also if caller's uid or gid matches the
# socket's uid or gid the lookup succeeds. Anything else causes a failure.
#
# To give the caller full permissions to lookup all users, set the mode to
# something else than 0666 and Dovecot lets the kernel enforce the
# permissions (e.g. 0777 allows everyone full permissions).
unix_listener auth-userdb {
#mode = 0666
#user =
#group =
}
# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0666
}
# Auth process is run as this user.
#user = $default_internal_user
}
## 10-ssl.conf
## 10-tcpwrapper.conf
## 15-lda.conf
## 15-mailboxes.conf
namespace inbox {
inbox = yes
mailbox Spam {
auto = subscribe
special_use = \Junk
}
mailbox Trash {
auto = subscribe
special_use = \Trash
}
mailbox Drafts {
auto = subscribe
special_use = \Drafts
}
mailbox Sent {
auto = subscribe
special_use = \Sent
}
}
## 20-imap.conf
protocol imap {
# Space separated list of plugins to load (default is global mail_plugins).
mail_plugins = $mail_plugins imap_sieve
}
## 20-lmtp.conf
protocol lmtp {
# Space separated list of plugins to load (default is global mail_plugins).
mail_plugins = $mail_plugins sieve
}
## 20-managesieve.conf
## 90-acl.conf
## 90-plugin.conf
## 90-quota.conf
## 90-sieve.conf
plugin {
sieve_before = /etc/dovecot/conf.d/custom-sieve/global_before.sieve
sieve_after = /etc/dovecot/conf.d/custom-sieve/global_after.sieve
sieve_plugins = sieve_imapsieve sieve_extprograms
# From elsewhere to Spam folder
imapsieve_mailbox1_name = Spam
imapsieve_mailbox1_causes = COPY APPEND
imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/report-spam.sieve
# From Spam folder to elsewhere
imapsieve_mailbox2_name = *
imapsieve_mailbox2_from = Spam
imapsieve_mailbox2_causes = COPY APPEND
imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve
sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
}
## 90-sieve-extprograms.conf
Meanwhile I tried a lot of several guides in the internet – nothing of them worked for me – what’s hard to understand because it’s a fresh and simple installation I did.
Any help is very appreciated!
Thanks
Jens
On 29/06/2024 10:08, postfix_dovecot--- via dovecot wrote:
Host: VMware Workstation 14.1.8
OS: Debian 12 (Bookworm)
Dovecot: 2.3.19.1
Postfix: 3.7.10 Mailclient: Outlook 2016
Hello,
I am currently working on a new mail server to replace my Debian 10 mail server. For preparation, I use VMware Workstation to learn and test the installation steps. When I'm eventually done, I'll rebuild my root server from scratch.
This time, my problem is getting the IMAPSieve plugin working to trigger rspamd if mail gets moved to the junk folder. Sieve runs well – if rspam recognizes a spam mail, it will be transferred to the junk folder.
For me it looks like the IMAPSieve plugin recognizes the move but will not running the script behind. I can see some actions in the log but nothing happens on the rspamd side where the log is also open to view. Moving a mail with Outlook produces the following log entry:
imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: Module loaded: /usr/lib/dovecot/modules/lib95_imap_sieve_plugin.so
imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: imapsieve: mailbox INBOX/Spam: APPEND event
imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: sieve: Pigeonhole version 0.5.19 (4eae2f79) initializing
imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: sieve: include: sieve_global is not set; it is currently not possible to include `:global' scripts.
imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: sieve: Sieve imapsieve plugin for Pigeonhole version 0.5.19 (4eae2f79) loaded
imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: sieve: Sieve Extprograms plugin for Pigeonhole version 0.5.19 (4eae2f79) loaded
imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: imapsieve: Static mailbox rule [1]: mailbox=
Spam' from=
*' causes=(COPY APPEND) => before=`file:/usr/lib/dovecot/sieve/report-spam.sieve' after=(none)imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: imapsieve: Static mailbox rule [2]: mailbox=
*' from=
Spam' causes=(COPY APPEND) => before=`file:/usr/lib/dovecot/sieve/report-ham.sieve' after=(none)imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: imapsieve: mailbox INBOX: FLAG event (changed flags: \Deleted)
imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: sieve: Pigeonhole version 0.5.19 (4eae2f79) initializing
imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: sieve: include: sieve_global is not set; it is currently not possible to include `:global' scripts.
imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: sieve: Sieve imapsieve plugin for Pigeonhole version 0.5.19 (4eae2f79) loaded
imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: sieve: Sieve Extprograms plugin for Pigeonhole version 0.5.19 (4eae2f79) loaded
imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: imapsieve: Static mailbox rule [1]: mailbox=
Spam' from=
*' causes=(COPY APPEND) => before=`file:/usr/lib/dovecot/sieve/report-spam.sieve' after=(none)imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: imapsieve: Static mailbox rule [2]: mailbox=
*' from=
Spam' causes=(COPY APPEND) => before=`file:/usr/lib/dovecot/sieve/report-ham.sieve' after=(none)imap(mail@test.example)<1795><iC6JmQIcnqvAqB4a>: Debug: imapsieve: mailbox INBOX: FLAG event (changed flags: \Seen)
......
Hi Jens
I can't give you any expert advise about that plugin as I haven't used it. However, looking at the debug info you posted I don't see where the rules are being matched.
That debugging looks like it is reading in the configuration, so you can see that dovecot recognises the rules configuration, but nothing in the debugging suggests that those rules are being matched or that you sieve scripts are being executed.
So it seems that the event that is being recognized "mailbox INBOX/Spam: APPEND event" doesn't match your defined rules. Maybe it's to do with name of the mailbox in the event not matching the one in your rule 1. It's a wild guess on my part, but maybe changing the rules to use "INBOX/Spam" might just solve it.
When the rules match you should see a message like "Matched static mailbox rule n" where n=1,2 etc in the debugging output.
John
Tried it now in every known combination. Nothing changes. It's my 7th evening about this and I'm starting to despair :(
-----Ursprüngliche Nachricht----- Von: John Fawcett via dovecot <dovecot@dovecot.org> Gesendet: Samstag, 29. Juni 2024 11:50 An: dovecot@dovecot.org Betreff: Re: IMAPSieve plugin will not run rspamd script
Hi Jens
I can't give you any expert advise about that plugin as I haven't used it. However, looking at the debug info you posted I don't see where the rules are being matched.
That debugging looks like it is reading in the configuration, so you can see that dovecot recognises the rules configuration, but nothing in the debugging suggests that those rules are being matched or that you sieve scripts are being executed.
So it seems that the event that is being recognized "mailbox INBOX/Spam: APPEND event" doesn't match your defined rules. Maybe it's to do with name of the mailbox in the event not matching the one in your rule 1. It's a wild guess on my part, but maybe changing the rules to use "INBOX/Spam" might just solve it.
When the rules match you should see a message like "Matched static mailbox rule n" where n=1,2 etc in the debugging output.
John
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
On June 30, 2024 7:57:26 PM GMT+02:00, postfix_dovecot--- via dovecot <dovecot@dovecot.org> wrote:
Tried it now in every known combination. Nothing changes. It's my 7th evening about this and I'm starting to despair :( Your config roughly looks like you followed <https://doc.dovecot.org/3.0/configuration_manual/howto/antispam_with_sieve/>
Please post doveconf -n to the list.
Have you checked that your .sieve files have been compiled with sievec, eg have a .svbin extension? Are the scripts being called executable?
Christian Kivalo
Hi Christian,
yes, it's from the genuine Dovecot documentation. But I tried also a lot of other tutorials. They're almost the same except the external scrips for rspamd. The result was every time the same: Nothing noticeable in the log.
Have you checked that your .sieve files have been compiled with sievec, eg have a .svbin extension? Yes, they are.
Are the scripts being called executable? Yes, they are 755
Here's my doveconf -n:
# 2.3.19.1 (9b53102964): /etc/dovecot/dovecot.conf # Pigeonhole version 0.5.19 (4eae2f79) # OS: Linux 6.1.0-21-amd64 x86_64 Debian 12.5 # Hostname: ServerIV-home.demo.example auth_mechanisms = plain login mail_debug = yes mail_location = maildir:~/Maildir mail_privileged_group = mail 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 { hidden = no ignore_on_failure = no inbox = yes list = yes location = mailbox Drafts { auto = subscribe special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { auto = subscribe special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Spam { auto = subscribe special_use = \Junk } mailbox Trash { auto = subscribe special_use = \Trash } prefix = INBOX/ separator = / subscriptions = yes type = private } passdb { driver = pam } passdb { args = scheme=CRYPT username_format=%u /etc/dovecot/users driver = passwd-file } plugin { imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/report-spam.sieve imapsieve_mailbox1_causes = COPY APPEND FLAG imapsieve_mailbox1_name = Spam imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve imapsieve_mailbox2_causes = COPY APPEND FLAG imapsieve_mailbox2_from = Spam imapsieve_mailbox2_name = * sieve = file:~/sieve;active=~/.dovecot.sieve sieve_after = /etc/dovecot/conf.d/custom-sieve/global_after.sieve sieve_before = /etc/dovecot/conf.d/custom-sieve/global_before.sieve sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment sieve_pipe_bin_dir = /usr/lib/dovecot/sieve sieve_plugins = sieve_imapsieve sieve_extprograms } protocols = imap lmtp sieve service auth { unix_listener /var/spool/postfix/private/auth { mode = 0666 } } service lmtp { inet_listener lmtp { address = 127.0.0.1 ::1 port = 24 } } ssl_cert = </etc/dovecot/private/dovecot.pem ssl_client_ca_dir = /etc/ssl/certs ssl_dh = # hidden, use -P to show it ssl_key = # hidden, use -P to show it userdb { driver = passwd } userdb { args = username_format=%u /etc/dovecot/users driver = passwd-file } verbose_proctitle = yes protocol lmtp { mail_plugins = " sieve" } protocol imap { mail_plugins = " imap_sieve" }
And this is what happens, if I move a mail from Inbox to Spam:
# journalctl -u dovecot -f | grep sieve:
imap(info@demo.example)<1503><frRYejEc7vPAqB4a>: Debug: imapsieve: mailbox INBOX: FLAG event (changed flags: \Deleted)
imap(info@demo.example)<1518><VBvZgzEcc/TAqB4a>: Debug: Module loaded: /usr/lib/dovecot/modules/lib95_imap_sieve_plugin.so
imap(info@demo.example)<1518><VBvZgzEcc/TAqB4a>: Debug: imapsieve: mailbox INBOX/Spam: APPEND event
imap(info@demo.example)<1518><VBvZgzEcc/TAqB4a>: Debug: sieve: Pigeonhole version 0.5.19 (4eae2f79) initializing
imap(info@demo.example)<1518><VBvZgzEcc/TAqB4a>: Debug: sieve: include: sieve_global is not set; it is currently not possible to include :global' scripts. imap(info@demo.example)<1518><VBvZgzEcc/TAqB4a>: Debug: sieve: Sieve imapsieve plugin for Pigeonhole version 0.5.19 (4eae2f79) loaded imap(info@demo.example)<1518><VBvZgzEcc/TAqB4a>: Debug: sieve: Sieve Extprograms plugin for Pigeonhole version 0.5.19 (4eae2f79) loaded imap(info@demo.example)<1518><VBvZgzEcc/TAqB4a>: Debug: imapsieve: Static mailbox rule [1]: mailbox=
Spam' from=*' causes=(COPY APPEND FLAG) => before=
file:/usr/lib/dovecot/sieve/report-spam.sieve' after=(none)
imap(info@demo.example)<1518><VBvZgzEcc/TAqB4a>: Debug: imapsieve: Static mailbox rule [2]: mailbox=*' from=
Spam' causes=(COPY APPEND FLAG) => before=`file:/usr/lib/dovecot/sieve/report-ham.sieve' after=(none)
imap(info@demo.example)<1503><frRYejEc7vPAqB4a>: Debug: imapsieve: mailbox INBOX: FLAG event (changed flags: \Seen)
Regards Jens
-----Ursprüngliche Nachricht----- Von: Christian Kivalo via dovecot <dovecot@dovecot.org> Gesendet: Sonntag, 30. Juni 2024 22:07 An: dovecot@dovecot.org Betreff: Re: IMAPSieve plugin will not run rspamd script
On June 30, 2024 7:57:26 PM GMT+02:00, postfix_dovecot--- via dovecot <dovecot@dovecot.org> wrote:
Tried it now in every known combination. Nothing changes. It's my 7th evening about this and I'm starting to despair :( Your config roughly looks like you followed <https://doc.dovecot.org/3.0/configuration_manual/howto/antispam_with_sieve/>
Please post doveconf -n to the list.
Have you checked that your .sieve files have been compiled with sievec, eg have a .svbin extension? Are the scripts being called executable?
Christian Kivalo
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
On 30/06/2024 19:57, postfix_dovecot--- via dovecot wrote:
Tried it now in every known combination. Nothing changes. It's my 7th evening about this and I'm starting to despair :(
Hi Jens
any chance of posting the debugging from that test in case it gives any clues.
John
imap(mail@test.example)<1797><a/FKmgIcqKvAqB4a>: Debug: sieve: include: sieve_global is not set; it is currently not possible to include `:global' scripts.
i am running dovecot 2.3.21 on ubuntu 24.04. while i was casting about trying to get the spam learning sieve going (it nows works beautifully), i took even debug warnings seriously, and it only started working after i set 'sieve_global' - not sure if that was coincidence, but if we are grasping at straws... GE
participants (4)
-
Christian Kivalo
-
ge@geddy.au
-
John Fawcett
-
postfix_dovecot@gmx.de