the-djmaze / snappymail

Simple, modern & fast web-based email client
https://snappymail.eu
GNU Affero General Public License v3.0
981 stars 115 forks source link

Filter editor limitations #80

Open tomscii opened 3 years ago

tomscii commented 3 years ago

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):

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 commented 3 years ago

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 "nobody@example.com", 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. (:

the-djmaze commented 3 years ago

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.

tomscii commented 3 years ago

:+1:

the-djmaze commented 3 years ago

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

require ["imap4flags"];

if header :contains ["From"] "example.com"
{
    addflag "\\Seen";
}
tomscii commented 3 years ago

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/

veitw commented 2 years ago

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

Kofl commented 3 months ago

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.