snappymail icon indicating copy to clipboard operation
snappymail copied to clipboard

Filter editor limitations

Open tomscii opened this issue 3 years ago • 8 comments

Describe the bug The filter editor does not allow creating certain (simple) filters. For example, I would like to create a filter that marks the message as read (on certain conditions) and does nothing else.

If I try to create a filter that does not move the message anywhere (other than leaving it in the Inbox), I run into an error: the drop-down has Inbox greyed out, and does not accept the empty selection (becomes red if I try to submit the dialog). I cannot choose not to move (or forward, or reject ...) the message. I think a checkbox to enable this line of actions would solve this nicely.

It would also be super nice if other common attributes/flags could be set/unset (in combination with other actions). For example, I cannot create a filter that would mark matching messages as Starred (\Flagged in imap4 lingo). (I realize this is starting to look more like an open-ended feature request, so feel free to make whatever you want out of it. I also realize that the sieve source can be edited by hand, which basically shortcuts all the limitations, so again, please treat this with a "nice to have" priority.)

Screenshots Here is what I see when I try to create a filter without moving the message anywhere. I cannot turn this thing off. SnappyMail_Filter

Desktop (please complete the following information):

  • Browser: Firefox 78.9.0esr
  • SnappyMail Version: 2.5.0-rc.2

Additional context This is not super important to me right now, submitting for your feedback in case you want to improve your upcoming release. Feel free to save for later.

tomscii avatar Apr 09 '21 17:04 tomscii

One further issue that looks like a well-rounded bug that I have ran into is that I seemingly cannot save back to the server a sieve with everything removed.

Steps to reproduce:

  1. Create a dummy sieve filter: "+ Add filter", Condition: From contains "[email protected]", Action: Move to Archive. Press "Done"
  2. Now the "outer dialog" shows a yellow admonition "These changes need to be saved to the server". Press "Save".
  3. The admonition goes away, and on the server, I can look at the sieve script which looks fine.
  4. Still in the same dialog, press the trash can icon, plus the red "Are you sure" popup.
  5. There is a new yellow admonition "These changes need to be saved to the server". Press "Save"
  6. Press "Save"
  7. Press "Save" ... It does not work!

In comparison, if I do not remove the filter, but only disable it by un-ticking the tick-box before its name, that change CAN be saved. And the sieve script on the server looks ok (the script is put into a block comment).

This is something that could be made into a separate bug report, but I figured I spammed you enough already. (:

tomscii avatar Apr 09 '21 18:04 tomscii

Spamming is fine 😉

RainLoop has a limited filter editor. So i wanted to improve that.

The first step was to see/edit all available sieve scripts on the server, as you might have created some through Thunderbird/KMail/Evolution/RoundCube/etc.

The second step was to create a full-blown GUI, but i found out that is a lot of work. I have a lot of draft code to parse complex sieve scripts and that also makes a GUI very complex.

For now i like to focus on upgrading everything to 2021 and after that improve the filters.

I will keep this one open for future releases, and you can already use the raw editor to write complex scripts.

The current simple editor will stay as-is to be compatible with RainLoop users.

the-djmaze avatar Apr 09 '21 18:04 the-djmaze

:+1:

tomscii avatar Apr 09 '21 21:04 tomscii

Regarding your mark as read. You could create new script with:

require ["imap4flags"];

if header :contains ["From"] "example.com"
{
    addflag "\\Seen";
}

the-djmaze avatar Apr 09 '21 22:04 the-djmaze

Yes :) My request was more on behalf of users who are not as technical. By the way, for the benefit of anyone reading this: I found an excellent guide to this on the ProtonMail website: https://protonmail.com/support/knowledge-base/sieve-advanced-custom-filters/

tomscii avatar Apr 10 '21 08:04 tomscii

I suggest introduction of a Basic/Expert mode for the new Sieve filters, so it will get less confusing for technically non-experienced users:

  • Put a button in Settings -> Filters to switch between Expert mode and Basic mode.
  • Expert mode corresponds to the full-fledged implementation that allows multiple scripts and Sieve source code editing.
  • Basic mode opens the visual ruleset editor for the rainloop.user script automatically instead of the script manager, removes the "Edit Sieve source code" button, and the rainloop.user script is enabled automatically on save.
  • If there is at least one script that is not rainloop.user, or rainloop.user is not set active, the user is put into Expert mode automatically and trying to enable Basic mode shows a message that the script status prevents this.
  • An option in application.ini defines whether (new) users are put into Basic or Expert mode by default.

veitw avatar Mar 04 '22 10:03 veitw

It would be awesome to add for the basic filter a date start / stop range, in which the vacation message should be sent. The only thing missing from roundcubemail.

Kofl avatar Jun 10 '24 13:06 Kofl

Working on it https://github.com/the-djmaze/snappymail/tree/sieve-gui

afbeelding

the-djmaze avatar Sep 23 '24 01:09 the-djmaze