Sieve Plugin Error: undefined symbol: mail_deliver_ctx_get_log_var_expand_table in Dovecot

Sieve is enabled in Dovecot on my Ubuntu server. However, I’m seeing the following recurring error in the mail logs:

Error: Couldn't load required plugin /usr/lib/dovecot/modules/lib90_sieve_plugin.so: dlopen() failed: /usr/lib/dovecot/modules/lib90_sieve_plugin.so: undefined symbol: mail_deliver_ctx_get_log_var_expand_table

I’ve already tried reinstalling the Dovecot and related packages (including dovecot-core and dovecot-sieve), but the issue persists.

Has anyone encountered this error before? Could this be a version mismatch between Dovecot and the Sieve plugin? Any advice on how to resolve this would be greatly appreciated.

SYSTEM INFORMATION
OS type and version Ubuntu 24.04.2 LTS
Webmin version 2.303
Virtualmin version 7.30.8
Webserver version 2.4.58
Dovecot 2.3.21