So, I have the sieve working up to the point that it calls the script, and the script is called (I get different errors if the script is not there, for example). filter action execute program `darkmode.sh' [[EXECUTION ABORTED]] There's no other error logged (for example, when I had sieve_filter_bin_dir miss-set, I would get: sieve: action filter: failed to execute program `darkmode.sh': vnd.dovecot.filter extension is unconfigured In /var/log/messages, but I fixed that. I assume there is something wrong with what I am doing in the script, bit that is something I am not finding any examples on that are proving useful. The script file is simply: Darkmode.sh: #!/bin/sh echo $1 | sed -e '|</head>|<style>* {color:white !important; background-color: black !important; } </style></head>|' Which is somehwat similar to a working script for reporting spam: sa-learn-spam.sh: #!/bin/sh exec /usr/local/bin/sa-learn -u ${1} --spam -- "Are you pondering what I'm pondering?" "I think so, Brain, but won't it go straight to my hips?!"
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 -- There is no cloud, just other people computers. -- https://static.fsf.org/nosvn/stickers/thereisnocloud.svg -------------- next part -------------- A non-text attachment was scrubbed... Name: pEpkey.asc Type: application/pgp-keys Size: 3110 bytes Desc: not available URL: <https://dovecot.org/pipermail/dovecot/attachments/20201030/884ead40/attachment.bin>
On 10/30/20 10:11 AM, @lbutlr wrote:> So, I have the sieve working up to the point that it calls the script, and the script is called (I get different errors if the script is not there, for example).>> filter action> execute program `darkmode.sh'> [[EXECUTION ABORTED]]>> There's no other error logged (for example, when I had sieve_filter_bin_dir miss-set, I would get:>> sieve: action filter: failed to execute program `darkmode.sh': vnd.dovecot.filter extension is unconfigured>> In /var/log/messages, but I fixed that.>> I assume there is something wrong with what I am doing in the script, bit that is something I am not finding any examples on that are proving useful.>> The script file is simply:>> Darkmode.sh:> #!/bin/sh> echo $1 | sed -e '|</head>|<style>* {color:white !important; background-color: black !important; } </style></head>|'>> Which is somehwat similar to a working script for reporting spam:>> sa-learn-spam.sh:> #!/bin/sh> exec /usr/local/bin/sa-learn -u ${1} --spamwrong, or different, I can't say. if helpful, for my script executions, I successfully do require ["vnd.dovecot.pipe", "vnd.dovecot.filter", "vnd.dovecot.execute", "copy", "environment", "variables", "vnd.dovecot.debug", "vnd.dovecot.imapsieve", "imapsieve"]; execute :pipe "msmtp_sender.sh" ["<arg1>", "<arg1>", "<arg1>"]; note the " :pipe" usage. similar to examples here, https://wiki2.dovecot.org/Pigeonhole/Sieve/Plugins/Extprograms
On Fri, 30 Oct 2020 at 20:12, @lbutlr <kremels at kreme.com> wrote:> So, I have the sieve working up to the point that it calls the script, and > the script is called (I get different errors if the script is not there, > for example). > > filter action > execute program `darkmode.sh' > [[EXECUTION ABORTED]] > > There's no other error logged (for example, when I had > sieve_filter_bin_dir miss-set, I would get: > > sieve: action filter: failed to execute program `darkmode.sh': > vnd.dovecot.filter extension is unconfigured > > In /var/log/messages, but I fixed that. > > I assume there is something wrong with what I am doing in the script, bit > that is something I am not finding any examples on that are proving useful. > > The script file is simply: > > Darkmode.sh: > #!/bin/sh > echo $1 | sed -e '|</head>|<style>* {color:white !important; > background-color: black !important; } </style></head>|' >echo $1 | sed -e 's|</head>|<style>* {color:white !important; background-color: black !important; } </style></head>|g' ?? -- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", grep ^[^#] :-) -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://dovecot.org/pipermail/dovecot/attachments/20201030/d368cd38/attachment.html>
On 30 Oct 2020, at 11:26, PGNet Dev <pgnet.dev at gmail.com> wrote:> wrong, or different, I can't say. if helpful, for my script executions, I successfully do > > require ["vnd.dovecot.pipe", "vnd.dovecot.filter", "vnd.dovecot.execute", "copy", "environment", "variables", "vnd.dovecot.debug", "vnd.dovecot.imapsieve", "imapsieve"]; > > execute :pipe "msmtp_sender.sh" ["<arg1>", "<arg1>", "<arg1>"]; > > note the " :pipe" usage. similar to examples here,Yes, But I am not trying to pipe the message, I am trying to filter it to change the content.> https://wiki2.dovecot.org/Pigeonhole/Sieve/Plugins/ExtprogramsI've read that, but no real information on the actual script file execution. -- There is something to be said for grace and respect but humour alway helps - Toby Morris
On 30 Oct 2020, at 11: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?Changes </head> to <style>* {color:white !important; background-color: black !important; } </style></head>> TTBOMK '|' is not known by sed ...Yes, it most certainly is. (It's the only delimiter I use anymore since it means I never have to deal with escaping /) -- Some people are like a slinky: Totally useless, but you can't help but smile when you push them down the stairs
On Freitag, 30. Oktober 2020 18:11:46 CET @lbutlr wrote:> echo $1 | sed -e '|</head>|<style>* {color:white !important; > background-color: black !important; } </style></head>|'echo $1 | sed -e 's|</head>|<style>.* {color:white !important; background- color: black !important; } </style></head>|' Perhaps? -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://dovecot.org/pipermail/dovecot/attachments/20201030/8b4a0a7e/attachment-0001.html>