Sieve body test

@lbutlr kremels at kreme.com
Tue Oct 27 16:30:02 EET 2020


On 26 Oct 2020, at 21:04, Stephan Bosch <stephan at rename-it.nl> wrote:
> On 23/10/2020 13:22, @lbutlr wrote:
>> On 22 Oct 2020, at 19:09, Stephan Bosch <stephan at rename-it.nl> wrote:
>>> You need to include the extprograms plugin:
>> I have, and vnf.dovecot.pipe doesn't give the error.
>> 
>>   sieve_plugins = sieve_imapsieve sieve_extprograms
>> 
>> ¯\_(ツ)_/¯
>> 
>> I am not using filter now though, so I haven't try to track down what the issue is.
> 
> And you also need to add vnd.dovecot.filter to sieve_extensions (or sieve_global_extensions).

Ah, yes, so I do. I only had .pipe there. While I am here, does _global_ mean that they do not need to be listed in the requires header?

That's good, I'm working on a. Filter to restyle some html emails that I get to eliminate the white backgrounds, and filter is going to be necessary for that to work.

Something along the lines of

if allof ( header :contains "from" "someone",
           header :contains "to" "me".
           Header :contains "Subject" "Stupid HTML" ) {

  if body :raw :contains "</head>" {
    filter :try "darkmode.sh";
  }
}

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

(Not that I have even begun to test that)

-- 
[Unused] "Are you pondering what I'm pondering?"

Pinky: I think so, Brain, but she'd never leave Mickey.
Brain: I thought we agreed never to discuss that!



More information about the dovecot mailing list