[BUG?] Dovecot 2.4.2 from Dovecot repo (RHEL 9) does not implement Sieve (properly/fully)

"patrick.starrenburg--- via dovecot" <[email protected]>
Newsgroups gmane.mail.imap.dovecot
Message-ID <[email protected]>
Hi all

Below is report of what I suspect is a bug arising in Dovecot 2.4.x regarding Sieve functionality after Pigeonhole functionality was folded into Dovecot/Dovecot-sieve. 

ISSUE:
======

I am building a new mail server on Rocky Linux 9.7 with Postfix 3.10 and Dovecot 2.4.2. The base installation & setup of Dovecot was OK with core functionality (Postfix interoperability and mail into virtual mail domain mailboxes no problem).

Once I had the base setup done I started with Sieve functionality:

1) Incoming mail marked as SPAM by Rspamd auto moved into /Junk
2) Mail manually moved in/out of /Junk handed to Rspamd for training as SPAM/HAM

This consistantly failed - the first issue I found was Dovecot failing to restart and `dovecot -n` reporting fatal errors related to sieve — section not found etc. etc.

>From my reading previously I knew I needed to install `dovecot-sieve` and it was installed before I started working on Sieve functionality. I also saw `dovecot-pigeonhole` but I seemed to read that (version >= 2.4) the functionality for that had been included in `dovecot-sieve` **and** there was no Pigeonhole included in the Dovecot 2.4.2 repo — also if I tried to install it I got errors of course because of the version mismatch, and it was not in the dovecot-2.4-latest repo.

```
# dnf info dovecot-pigeonhole
Last metadata expiration check: 1:21:15 ago on Fri 06 Mar 2026 08:05:08.
Available Packages
Name         : dovecot-pigeonhole
Epoch        : 1
Version      : 2.3.16
Release      : 15.el9
Architecture : x86_64
Size         : 371 k
Source       : dovecot-2.3.16-15.el9.src.rpm
Repository   : appstream
Summary      : Sieve and managesieve plug-in for dovecot
URL          : https://www.dovecot.org/
License      : MIT and LGPLv2
Description  : This package provides sieve and managesieve plug-in for dovecot LDA.
```

I also saw `dovecot-managesieved` but as I was **not** going to implement a client sieve functionality I did not install that.

Anyway I could not even get to first base with Sieve, Dovecot simply did not know about it. I went on IRC and chatted with Aki Tuomi who confirmed that "yeah, looks like there is some packaging mistake." because the directory `/usr/lib64/dovecot/settings` was empty. As a workaround he suggested "you need to install dovecot-managesieved as workaround". I did that and as a result the following files appeared:

```
-rwxr-xr-x 1 root root 15560 Jan  8 12:13 libmanagesieve_login_settings.so
-rwxr-xr-x 1 root root 15840 Jan  8 12:13 libmanagesieve_settings.so
-rwxr-xr-x 1 root root 19656 Jan  8 12:13 libpigeonhole_settings.so
```

The `dovecot -n` errors went away, it recognised the sieve directives, and I continued with the Sieve setup. All — `dovecot.conf`, sieve files source and compiled — installed OK. But the sieve functionality simply refused to work. I got advice and we found the following which essentially points to sieve (even with `dovecot-managesieved` installed) not working. After installing everything — dovecot.conf, sieve files (compiled successfully) and a pipe to a shell script to call `rspamc` nothing seemed to happen.

* `journalctl -f -u dovecot | grep -E "sieve|pipe"` -> nothing showed
* `rspamc stat` -> 'Messages scanned' & 'Messages learned' no increase

When we checked we found the following:

1) `lib90_sieve_settings.so` (which should be in `/etc/lib64/dovecot/settings`) is missing from the system.

  `find / -name "lib90_sieve_settings.so"` -> not found

I believe the file is critical for the running of (Dovecot using) Sieve?

2) The Dovecot build options missing any sieve functionality:

```
#dovecot --build-options
Build options: ioloop=epoll notify=inotify openssl io_block_size=8192
SQL driver plugins: mysql postgresql sqlite
Passdb: ldap pam passwd passwd-file sql
Userdb: ldap(plugin) passwd prefetch passwd-file sql
```

I believe (I was told) that minus the above (even though `dovecot-managesieved` was installed as well as `dovecot-sieve`) Sieve simply will not function.

Is this a bug/packaging error?

Regards

Patrick


ENVIRONMENT:
============

Software
--------
* Rocky Linux 9.7 (RHEL)
* Postfix 3.10 Built from source
* Postscreen running in Postfix
* Dovecot 2.4 installed from Dovecot repo
* Valkey 9.0.3 (Redis replacement)
* Rspamd 3.14.3

Setup
-----
* Rspamd <-> Valkey communicate via Unix socket
* Postfix & Dovecot <-> Rspamd via inet port/milter: 
    smtpd_milters = inet:localhost:11332
    non_smtpd_milters = inet:localhost:11332
* 'First line defence' = DNSBL via postscreen
* Rspamd SPF checking, DKIM signing and DMARC configured

All of the above installed, working and tested.


DOVECOT PACKAGES INSTALLED:
===========================

```
Name         : dovecot
Version      : 2.4.2
Architecture : x86_64
Source       : dovecot-2.4.2-2.src.rpm
>From repo    : dovecot-2.4-latest

Name         : dovecot-sieve
Version      : 2.4.2
Architecture : x86_64
Source       : dovecot-sieve-2.4.2-2.src.rpm
>From repo    : dovecot-2.4-latest

Name         : dovecot-managesieved		(see note about this in the email)
Version      : 2.4.2
Architecture : x86_64
Source       : dovecot-sieve-2.4.2-2.src.rpm
>From repo    : dovecot-2.4-latest

Name         : dovecot-submissiond
Version      : 2.4.2
Architecture : x86_64
Source       : dovecot-2.4.2-2.src.rpm
>From repo    : dovecot-2.4-latest

Name         : dovecot-imapd
Version      : 2.4.2
Architecture : x86_64
Source       : dovecot-2.4.2-2.src.rpm
>From repo    : dovecot-2.4-latest

Name         : dovecot-lmtpd
Version      : 2.4.2
Architecture : x86_64
Source       : dovecot-2.4.2-2.src.rpm
>From repo    : dovecot-2.4-latest

Name         : dovecot-lua
Version      : 2.4.2
Architecture : x86_64
Source       : dovecot-2.4.2-2.src.rpm
>From repo    : dovecot-2.4-latest
```


OUTPUT OF `dovecot -n`:
=======================

```
# dovecot -n
# 2.4.2-2 (0962ed2104): /etc/dovecot/dovecot.conf
# Pigeonhole version 2.4.2-2 (767418c3)
# OS: Linux 5.14.0-611.34.1.el9_7.x86_64 x86_64 Rocky Linux release 9.7 (Blue Onyx)
# Hostname: srv01.example.com
dovecot_config_version = 2.4.2
auth_default_domain = example.com
auth_mechanisms = plain
auth_username_format = %{user | lower }
dovecot_storage_version = 2.4.2
mail_access_groups = vmail
mail_control_path = ~/control
mail_driver = maildir
mail_gid = 5000
mail_home = /var/vmail/%{user | domain }/%{user | username }
mail_index_path = ~/indexes
mail_path = %{home}/Maildir
mail_privileged_group = vmail
mail_uid = 5000
mailbox_list_utf8 = yes
protocols = imap lmtp
sieve_global_extensions {
  vnd.dovecot.pipe = yes
}
sieve_pipe_bin_dir = /etc/dovecot/sieve/bin
sieve_plugins {
  sieve_imapsieve = yes
  sieve_extprograms = yes
}
sieve_trace_dir = /var/log/dovecot/sieve-trace
sieve_trace_level = actions
ssl = required
syslog_facility = local5
protocol lmtp {
  mail_plugins {
    sieve = yes
  }
}
ssl_server {
  cert_file = /etc/ssl/server/server_example_com.crt
  key_file = /etc/ssl/server/server_example_com.key
}
passdb passwd-file {
  auth_username_format = %{user | username}
  default_password_scheme = SHA512-CRYPT
  passwd_file_path = /etc/dovecot/passwd
}
userdb passwd-file {
  auth_username_format = %{user | username}
  passwd_file_path = /etc/dovecot/passwd
  fields {
    gid:default = 5000
    uid:default = 5000
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0600
    user = postfix
  }
}
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
}
service imap-login {
  inet_listener imap {
    port = 0
  }
  inet_listener imaps {
    port = 993
    ssl = yes
  }
}
service auth-worker {
  user = $SET:default_internal_user
}
service anvil {
  unix_listener anvil {
    group = $SET:default_internal_group
    mode = 0660
  }
}
service doveadm {
  unix_listener doveadm-server {
    mode = 0600
    user = $SET:default_internal_user
  }
}
sieve_script rspamd_to_junk {
  driver = file
  path = /etc/dovecot/sieve/rspamd-to-junk.sieve
  type = before
}
namespace inbox {
  mail_plugins {
    imap_sieve = yes
  }
  inbox = yes
  mailbox Junk {
    auto = create
    autoexpunge = 90d
    special_use = "\\Junk"
    sieve_script report-spam {
      cause = copy
      path = /etc/dovecot/sieve/report-spam.sieve
      type = before
    }
  }
  imapsieve_from Junk {
    sieve_script report-ham {
      cause = copy
      path = /etc/dovecot/sieve/report-ham.sieve
      type = before
    }
  }
  mailbox Drafts {
    auto = subscribe
    special_use = "\\Drafts"
  }
  mailbox Sent {
    auto = subscribe
    special_use = "\\Sent"
  }
  mailbox Trash {
    auto = subscribe
    special_use = "\\Trash"
  }
}
```
_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.