> On 30/10/2020 19:25 Bernd Petrovitsch <bernd at 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, > Berndsed 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 at 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 at kreme.com> wrote:> On 30 Oct 2020, at 11:57, Aki Tuomi <aki.tuomi at 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. -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://dovecot.org/pipermail/dovecot/attachments/20201030/a3057f06/attachment.html>
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]]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.'
On Fri, 2020-10-30 at 19:57 +0200, Aki Tuomi wrote:> > On 30/10/2020 19:25 Bernd Petrovitsch <bernd at 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 at petrovitsch.priv.at There is no cloud, just other people computers. - FSFE LUGA : http://www.luga.at