Hello Stuart,
Just wanted to preface my response with the fact that I use Emacs for my notes
hence you'll see source blocks later with "#+BEGIN_SRC".
Regarding your previous question:
Do you have:
*mail_plugins = $mail_plugins imap_sieve**
in the "protocol imap { ... }" block?
Answer:
Yes, I do have that exact block within /etc/dovecot/conf.d/20-imap.conf.
I checked the documentation you have provided. The only thing that is different
is that I have 'Junk' instead of 'Spam' like the documentation:
https://doc.dovecot.org/configuration_manual/howto/antispam_with_sieve/
So, just for kicks, I tried to just change it accordingly so here's the
"BEFORE" and "AFTER" my changes to the ''/etc/dovecot/conf.d/90-plugin.conf"
file:
I then tried running the following file as the root user on the box:
<2021-06-24 Thu 22:48>: With this in mind, this is my revised changes in
'/etc/dovecot/conf.d/90-plugin.conf'
BEFORE:
#+BEGIN_SRC bash
##
## Plugin settings
##
# All wanted plugins must be listed in mail_plugins setting before any of the
# settings take effect. See <doc/wiki/Plugins.txt> for list of plugins and
# their configuration. Note that %variable expansion is done for all values.
plugin {
sieve_plugins = sieve_imapsieve sieve_extprograms
sieve_global_extensions = +vnd.dovecot.environment +vnd.dovecot.debug
+vnd.dovecot.pipe
imapsieve_mailbox1_name = Junk
imapsieve_mailbox1_causes = COPY APPEND
imapsieve_mailbox1_before =
file:/usr/local/lib/dovecot/sieve/report-spam.sieve
imapsieve_mailbox2_name = *
imapsieve_mailbox2_from = Junk
imapsieve_mailbox2_causes = COPY
imapsieve_mailbox2_before = file:/usr/local/lib/dovecot/sieve/report-ham.sieve
imapsieve_mailbox3_name = Inbox
imapsieve_mailbox3_causes = APPEND
imapsieve_mailbox3_before = file:/usr/local/lib/dovecot/sieve/report-ham.sieve
sieve_pipe_bin_dir = /usr/local/lib/dovecot/sieve
}
#+END_SRC
AFTER:
#+BEGIN_SRC bash
##
## Plugin settings
##
# All wanted plugins must be listed in mail_plugins setting before any of the
# settings take effect. See <doc/wiki/Plugins.txt> for list of plugins and
# their configuration. Note that %variable expansion is done for all values.
plugin {
sieve_plugins = sieve_imapsieve sieve_extprograms
sieve_global_extensions = +vnd.dovecot.environment +vnd.dovecot.debug
+vnd.dovecot.pipe
imapsieve_mailbox1_name = Spam
imapsieve_mailbox1_causes = COPY APPEND
imapsieve_mailbox1_before =
file:/usr/local/lib/dovecot/sieve/report-spam.sieve
imapsieve_mailbox2_name = *
imapsieve_mailbox2_from = Spam
imapsieve_mailbox2_causes = COPY
imapsieve_mailbox2_before = file:/usr/local/lib/dovecot/sieve/report-ham.sieve
imapsieve_mailbox3_name = Inbox
imapsieve_mailbox3_causes = APPEND
imapsieve_mailbox3_before = file:/usr/local/lib/dovecot/sieve/report-ham.sieve
sieve_pipe_bin_dir = /usr/local/lib/dovecot/sieve
}
#+END_SRC
Here is the output of running the following command in
'/usr/local/dovecot/sieve' as the 'root' user on the box, but received the
following message:
#+BEGIN_SRC bash
l# sievec report-ham.sieve
report-ham: line 1: error: require command: unknown Sieve capability
`vnd.dovecot.pipe'.
report-ham: line 1: error: require command: unknown Sieve capability
`imapsieve'.
report-ham: line 15: error: unknown command 'pipe' (only reported once at first
occurrence).
report-ham: error: validation failed.
sievec(root): Fatal: failed to compile sieve script 'report-ham.sieve'
# sievec report-spam.sieve
report-spam: line 1: error: require command: unknown Sieve capability
`vnd.dovecot.pipe'.
report-spam: line 1: error: require command: unknown Sieve capability
`imapsieve'.
report-spam: line 7: error: unknown command 'pipe' (only reported once at first
occurrence).
report-spam: error: validation failed.
sievec(root): Fatal: failed to compile sieve script 'report-spam.sieve'
#+END_SRC
Is there anything else that can be done?
Don't mean to be that guy, but I get the feeling that it might have to be an
OpenBSD issue in terms of the sievec package, or the Dovecot release.
Please let me know what I could do to further troubleshoot the issue.
Thanks,
Sam
On Mon, Jun 21, 2021, at 11:18 AM, Stuart Henderson wrote:
> On 2021-06-19, Samuel Banya <[email protected]> wrote:
> > Hello everyone,
> >
> > I've been following the "poolp" guide on how to deploy an email server on
> > OpenBSD:
> > -
> > https://poolp.org/posts/2019-09-14/setting-up-a-mail-server-with-opensmtpd-dovecot-and-rspamd/
> >
> > I'm currently at the very end of the guide in which he is using sieve with
> > Dovecot to do some final filtering.
> >
> > The unfortunate thing is that when I run these two commands in the
> > '/usr/local/lib/dovecot/sieve' directory:
> > sievec report-ham.sieve
> > sievec report-spam.sieve
> >
> > I'm getting the following error:
> > # sievec report-ham.sieve
> > report-ham: line 1: error: require command: unknown Sieve capability
> > `vnd.dovecot.pipe'.
> > report-ham: line 1: error: require command: unknown Sieve capability
> > `imapsieve'.
> > report-ham: line 15: error: unknown command 'pipe' (only reported once at
> > first occurrence).
> > report-ham: error: validation failed.
> > sievec(root): Fatal: failed to compile sieve script 'report-ham.sieve'
> > # sievec report-spam.sieve
> > report-spam: line 1: error: require command: unknown Sieve capability
> > `vnd.dovecot.pipe'.
> > report-spam: line 1: error: require command: unknown Sieve capability
> > `imapsieve'.
> > report-spam: line 7: error: unknown command 'pipe' (only reported once at
> > first occurrence).
> > report-spam: error: validation failed.
> > sievec(root): Fatal: failed to compile sieve script 'report-spam.sieve'
>
> Do you have
>
> mail_plugins = $mail_plugins imap_sieve
>
> in the "protocol imap { ... }" block?
>
> > What's interesting is that this same post has the same exact error, and I
> > tried his workaround which did NOT work unfortunately:
> > - http://dovecot.2317879.n4.nabble.com/sieve-compile-error-td70414.html
>
> If that doesn't help, rather than looking at forum posts, try the
> documentation
>
> https://wiki.dovecot.org/Pigeonhole/Sieve/Plugins/IMAPSieve
> https://doc.dovecot.org/configuration_manual/howto/antispam_with_sieve/
>
>
>