Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 878161

Summary: net-mail/dovecot-2.3.19.1-r1: sieve plugin has missing symbols
Product: Gentoo Linux Reporter: Jocelyn Mayer <l_indien>
Component: Current packagesAssignee: Eray Aslan <eras>
Status: UNCONFIRMED ---    
Severity: normal CC: ideal.wheel3343, l_indien
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: output from emerge --info =net-mail/dovecot-2.3.19.1-r1
Patch to dovecot sieve plugin build system to link it against libdovecot-lda
Patch proposal to dovecot ebuild to apply dovecot sieve plugin patch

Description Jocelyn Mayer 2022-10-24 12:37:03 UTC
It's a long standing bug.
sieve-plugin library, ie lib90_sieve_plugin.so, has references on some symbols defined in libdovecot-lda.so but is not linked against this library:
ldd -d -r /usr/lib64/dovecot/lib90_sieve_plugin.so
        linux-vdso.so.1 (0x00007fff3176b000)
        libdovecot-sieve.so.0 => /usr/lib64/dovecot/libdovecot-sieve.so.0 (0x00007f453948a000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f45392b7000)
        libdovecot-storage.so.0 => /usr/lib64/dovecot/libdovecot-storage.so.0 (0x00007f4539141000)
        libdovecot.so.0 => /usr/lib64/dovecot/libdovecot.so.0 (0x00007f4538f67000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f453956e000)
undefined symbol: mail_deliver_ctx_get_log_var_expand_table     (/usr/lib64/dovecot/lib90_sieve_plugin.so)
undefined symbol: mail_deliver_get_return_address       (/usr/lib64/dovecot/lib90_sieve_plugin.so)
undefined symbol: mail_send_rejection   (/usr/lib64/dovecot/lib90_sieve_plugin.so)
undefined symbol: mail_deliver_hook_set (/usr/lib64/dovecot/lib90_sieve_plugin.so)


Reproducible: Always

Steps to Reproduce:
1. Build dovecot with sieve support activated
2. Check the sieve-plugin library
3.
Actual Results:  
the sieve-plugin library have missing symbols which make use of this plugin fail

Expected Results:  
Sieve plugin is to be usable

A quiet simple patch can solve this issue
Comment 1 Jocelyn Mayer 2022-10-24 12:37:46 UTC
Created attachment 825179 [details]
output from emerge --info =net-mail/dovecot-2.3.19.1-r1
Comment 2 Jocelyn Mayer 2022-10-24 12:42:07 UTC
Created attachment 825181 [details, diff]
Patch to dovecot sieve plugin build system to link it against libdovecot-lda

Linking sieve plugin library against libdovecot-lda library fixes the issue
Comment 3 Jocelyn Mayer 2022-10-24 12:43:01 UTC
Created attachment 825183 [details, diff]
Patch proposal to dovecot ebuild to apply dovecot sieve plugin patch
Comment 4 ideal.wheel3343 2025-01-07 17:17:22 UTC
This is NOT a Gentoo specific bug and probably shouldn't be considered a bug by upstream.
The upstream troubleshooting documentation might need to be improved. Confirmed similar behavior on Debian and Alpine Linux.

This a configuration mistake

The dovecot wiki guide on enabling sieve instructs the user to enable it for LDA or LMTP using:

Correct Configuration. 
---
protocol lmtp {
  mail_plugins = $mail_plugins sieve
  postmaster_address = postmaster@example.com
}
---
and , or
---
protocol lda {
  mail_plugins = $mail_plugins sieve
  postmaster_address = postmaster@example.com
}
---

https://doc.dovecot.org/2.3/configuration_manual/sieve/configuration/#basic-configuration

If you make a mistake and load the sieve plugin for protocol sieve, then the clients get an internal error occurred message when connecting to the manage sieve service. The error looks like this (shortened). You get similar messages and the same behavior in the above distributions . Tested using claws-mail

managesieve(test@mail.lan): Error: Couldn't load required plugin /usr/lib64/dovecot/lib90_sieve_plugin.so: dlopen() failed: /usr/lib64/dovecot/lib90_sieve_plugin.so: u

Incorrect configuration. Note protocol 
---
protocol sieve {
    mail_plugins = $mail_plugins sieve
}
---

According to the Dovecot wiki mail_plugins is currently useless for protocol sieve. There is also a warning against loading IMAP plugins.

https://doc.dovecot.org/2.3/configuration_manual/sieve/managesieve/configuration/#sieve-managesieve-configuration