Re: Sieve filter script EXECUTION FAILED
On 30/10/2020 19:25 Bernd Petrovitsch bernd@petrovitsch.priv.at wrote:
On 30/10/2020 17:11, @lbutlr wrote: [...]
echo $1 | sed -e '|</head>|<style>* {color:white !important; background-color: black !important; } </style></head>|'
What should the sed stuff do? TTBOMK '|' is not known by sed ...
MfG, Bernd
sed accepts | as alternative for / as boundary.
But I think the sed here is missing 's' from start, so this does not actually do anything...
Aki
On 30 Oct 2020, at 11:57, Aki Tuomi aki.tuomi@open-xchange.com wrote:
But I think the sed here is missing 's' from start, so this does not actually do anything...
Copy/paste/edit error. The s is there in the file.
darkmode.sh: #!/bin/sh echo $1 | sed -e 's|</head>|<style>* {color:white !important; background-color: black !important; } </style></head>|'
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]]
-- They looked at the drinks. They drank the drinks.
On Fri, Oct 30, 2020 at 11:34 AM @lbutlr kremels@kreme.com wrote:
On 30 Oct 2020, at 11:57, Aki Tuomi aki.tuomi@open-xchange.com wrote:
But I think the sed here is missing 's' from start, so this does not actually do anything...
Copy/paste/edit error. The s is there in the file.
darkmode.sh: #!/bin/sh echo $1 | sed -e 's|</head>|<style>* {color:white !important; background-color: black !important; } </style></head>|'
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]]
Not a fix (just a debug step), but I'm curious what happens if you explicitly set 'exit 0' at the end of the shell script.
On 30 Oct 2020, at 12:34, @lbutlr kremels@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]]
Here is the relevant part of doveconf -n
plugin { imapsieve_mailbox1_before = file:/usr/lib/dovecot/sieve/report-spam.sieve imapsieve_mailbox1_causes = COPY imapsieve_mailbox1_name = Junk imapsieve_mailbox2_before = file:/usr/lib/dovecot/sieve/report-ham.sieve imapsieve_mailbox2_causes = COPY imapsieve_mailbox2_from = Junk imapsieve_mailbox2_name = * imapsieve_mailbox3_before = file:/usr/lib/dovecot/sieve/mark-read.sieve imapsieve_mailbox3_causes = COPY imapsieve_mailbox3_name = Archive quota_rule2 = .EXPUNGED:ignore sieve = file:~/.sieve;active=~/.active_sieve sieve_before = file:/usr/lib/dovecot/sieve/bcc.sieve sieve_before3 = file:/usr/lib/dovecot/sieve/filespam.sieve sieve_default_name = spamassassin sieve_duplicate_default_period = 1h sieve_duplicate_max_period = 12d sieve_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment +vnd.dovecot.filter +editheader sieve_filter_bin_dir = /usr/lib/dovecot/sieve /usr/local/virtual/ sieve_pipe_bin_dir = /usr/lib/dovecot/sieve sieve_plugins = sieve_imapsieve sieve_extprograms sieve_trace_dir = ~/.trace sieve_trace_level = matching sieve_user_log = ~/sieve.log }
Current shell script is
#!/bin/sh sed -e 's|</head>|<style>* {color:white !important; background-color: black !important; } </style></head>|'
exit 0
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).
-- 'It is always useful to face an enemy who is prepared to die for his country,' he read. 'This means that both you and he have exactly the same aim in mind.'
"@lbutlr" == @lbutlr kremels@kreme.com writes:
@lbutlr> On 30 Oct 2020, at 12:34, @lbutlr kremels@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
On Fri, 2020-10-30 at 19:57 +0200, Aki Tuomi wrote:
On 30/10/2020 19:25 Bernd Petrovitsch bernd@petrovitsch.priv.at wrote:
On 30/10/2020 17:11, @lbutlr wrote: [...]
echo $1 | sed -e '|</head>|<style>* {color:white !important; background-color: black !important; } </style></head>|'
What should the sed stuff do? TTBOMK '|' is not known by sed ...
MfG, Bernd
sed accepts | as alternative for / as boundary.
GNU-sed accepts (almost?) all characters as boundary for s/from/to/ ...
But I think the sed here is missing 's' from start, so this does not actually do anything...
We can only guess what was actually meant ...
MfG, Bernd
Bernd Petrovitsch Email : bernd@petrovitsch.priv.at There is no cloud, just other people computers. - FSFE LUGA : http://www.luga.at
participants (5)
-
@lbutlr
-
Aki Tuomi
-
Bernd Petrovitsch
-
John Stoffel
-
Mark Moseley