RainLoop / rainloop-webmail

Simple, modern & fast web-based email client
http://rainloop.net
MIT License
4.1k stars 883 forks source link

debugging sieve script with a parser #2050

Open cauerego opened 3 years ago

cauerego commented 3 years ago

user script screenshot

how about a button to test how the script would work and see which results to expect?

the-djmaze commented 3 years ago

I am working on something like that.

Problem is that there is no good sieve parser/lexer in RainLoop to convert sieve scripts in a (simple) visual editor. There is a sieve parser by protonmail, but there is no JavaScript ui/parser (thunderbird plugin is standalone now).

The simple sieve editor in RainLoop relies on comments with base64 encoded json inside the script.

It is a lot of work to create an UI that supports (nested) identifier test commands with comparators properly. Not to mention all extensions...

Take a look at the dovecot pigeonhole sieve lib for example.

cauerego commented 3 years ago

i take it you're talking about the second idea only, the one more related to the previous title...

so i edited the original and moved the first idea to a second issue... 😒😇

you win 😁

https://github.com/RainLoop/rainloop-webmail/issues/2051

back to topic:

got no idea, had no idea there's nothing good that can be used yet.

how about using some other more wide spread script then, rather than sieve? wouldn't that be better?

just trying to throw some "out of the box" random ideas now! 😜

the-djmaze commented 3 years ago

My reply was for both. To test you also need to parse the script. Dovecot pigeonhole has sieve-test https://www.huge-man-linux.net/man1/sieve-test.html

Take a look at the source: https://github.com/dovecot/pigeonhole