Sieve filter script EXECUTION FAILED

John Stoffel john at stoffel.org
Fri Oct 30 21:58:28 EET 2020


>>>>> "@lbutlr" == @lbutlr  <kremels at kreme.com> writes:

@lbutlr> On 30 Oct 2020, at 12:34, @lbutlr <kremels at kreme.com> wrote:
>> I am not sure about the $1. I think filter just pipes the message (or part of the message.
>> 
>> I will see what happens without the echo I suppose.
>> 
>> Nope, still the same.
>> 
>> 32:   starting `:contains' match with `i;ascii-casemap' comparator:
>> 32:   matching value `<!DOCTYPE html><html lang="en"><head><title>29-Oct-2020 ""</title> <style>?? ...'
>> 32:     with key `</head>' => 1
>> 32:   finishing match with result: matched
>> 32: jump if result is false
>> 32:   not jumping
>> 34: filter action
>> 34:   execute program `darkmode.sh'
>> 34:   [[EXECUTION ABORTED]]

@lbutlr> Here is the relevant part of doveconf -n

@lbutlr> plugin {
@lbutlr>   imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/report-spam.sieve
@lbutlr>   imapsieve_mailbox1_causes = COPY
@lbutlr>   imapsieve_mailbox1_name = Junk
@lbutlr>   imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve
@lbutlr>   imapsieve_mailbox2_causes = COPY
@lbutlr>   imapsieve_mailbox2_from = Junk
@lbutlr>   imapsieve_mailbox2_name = *
@lbutlr>   imapsieve_mailbox3_before = file:/usr/lib/dovecot/sieve/mark-read.sieve
@lbutlr>   imapsieve_mailbox3_causes = COPY
@lbutlr>   imapsieve_mailbox3_name = Archive
@lbutlr>   quota_rule2 = .EXPUNGED:ignore
@lbutlr>   sieve = file:~/.sieve;active=~/.active_sieve
@lbutlr>   sieve_before = file:/usr/lib/dovecot/sieve/bcc.sieve
@lbutlr>   sieve_before3 = file:/usr/lib/dovecot/sieve/filespam.sieve
@lbutlr>   sieve_default_name = spamassassin
@lbutlr>   sieve_duplicate_default_period = 1h
@lbutlr>   sieve_duplicate_max_period = 12d
@lbutlr>   sieve_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment +vnd.dovecot.filter +editheader
@lbutlr>   sieve_filter_bin_dir = /usr/lib/dovecot/sieve /usr/local/virtual/
@lbutlr>   sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
@lbutlr>   sieve_plugins = sieve_imapsieve sieve_extprograms
@lbutlr>   sieve_trace_dir = ~/.trace
@lbutlr>   sieve_trace_level = matching
@lbutlr>   sieve_user_log = ~/sieve.log
@lbutlr> }

@lbutlr> Current shell script is

@lbutlr> #!/bin/sh
@lbutlr> sed -e 's|</head>|<style>* {color:white !important; background-color: black !important; } </style></head>|'

@lbutlr> exit 0

@lbutlr> The script is in both the /usr/local/virtual/user/ with the
.active_sieve and in /usr/lib/dovecot/sieve (unique files, not links,
but identical).

Can you get the script to work to just add a line or two at the end
instead as a simple test?  Something like:


   #!/bin/sh

   sed -e 's|</body>|<br>Hi there.<P></body>|i'
   exit 0

And of course make sure you're matching case-insensitively as well.

I kinda think the mimedefang milter might be better, but ... not
sure.

John


More information about the dovecot mailing list