Good news, Everyone!
I finally have finished this functionality.
If you have the opportunity to test the filters, I'll be grateful to you.
link: http://www.rainloop.net/downloads/
screenshots:






Hi, sorry for the delay, but I finally got time to test this. I created a test install with your supplied zip and here are the results:
When I create a Sieve rule, I'm stuck on "These changes need to be saved to the server":
I created some logs.
When I enter Settings > Filters, I see this in theRainLoop log:
[08:55:36.006][215dc864] INFO[DATA]: [DATE:30.01.15][RL:1.7.3.235][PHP:5.4.36-0+deb7u3][IP:212.61.144.165][PID:7542][Apache][apache2handler]
[08:55:36.007][215dc864] INFO[DATA]: [Suhosin:off][APC:on][MB:on][PDO:mysql,pgsql,sqlite][Streams:tcp,udp,unix,udg,ssl,sslv3,tls]
[08:55:36.007][215dc864] REQUEST[NOTE]: [POST] https://#MYFQDN#/rainloop-sieve-test/?/Ajax/&s=/_#IMSENCORINGTHISJUSTINCASE#/
[08:55:36.007][215dc864] AJAX[NOTE]: Action: DoFilters
[08:55:36.008][215dc864] POST[DATA]: {"Action":"Filters","XToken":"#IMSENCORINGTHISJUSTINCASE#"}
[08:55:36.013][215dc864] SIEVE[NOTE]: Start connection to "tcp://localhost:4190"
[08:55:36.014][215dc864] SIEVE[NOTE]: Connected (success)
[08:55:36.034][215dc864] SIEVE[DATA]: < "IMPLEMENTATION" "Dovecot Pigeonhole"\r\n
[08:55:36.034][215dc864] SIEVE[DATA]: < "SIEVE" "fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave"\r\n
[08:55:36.034][215dc864] SIEVE[DATA]: < "NOTIFY" "mailto"\r\n
[08:55:36.035][215dc864] SIEVE[DATA]: < "SASL" "PLAIN"\r\n
[08:55:36.035][215dc864] SIEVE[DATA]: < "STARTTLS"\r\n
[08:55:36.035][215dc864] SIEVE[DATA]: < "VERSION" "1.0"\r\n
[08:55:36.035][215dc864] SIEVE[DATA]: < OK "Dovecot ready."\r\n
[08:55:36.037][215dc864] SIEVE[DATA]: > AUTHENTICATE "PLAIN" {24+}\r\n
[08:55:36.037][215dc864] SIEVE[DATA]: > #IMSENCORINGTHISJUSTINCASE#\r\n
[08:55:36.083][215dc864] SIEVE[DATA]: < OK "Logged in."\r\n
[08:55:36.083][215dc864] SIEVE[DATA]: > LISTSCRIPTS\r\n
[08:55:36.083][215dc864] SIEVE[DATA]: < OK "Listscripts completed."\r\n
[08:55:36.084][215dc864] SIEVE[DATA]: > LOGOUT\r\n
[08:55:36.088][215dc864] SIEVE[DATA]: < OK "Logout completed."\r\n
[08:55:36.088][215dc864] SIEVE[NOTE]: Disconnected from "tcp://localhost:4190" (success)
[08:55:36.088][215dc864] AJAX[DATA]: {"Action":"Filters","Result":{"RawIsAllow":true,"RawIsActive":false,"Raw":"","Filters":[],"Capa":["fileinto","reject","envelope","encoded-character","vacation","subaddress","comparator-i;ascii-numeric","relational","regex","imap4flags","copy","include","variables","body","enotify","environment","mai...
[08:55:36.088][215dc864] INFO[MEMORY]: Memory peak usage: 1.25MB
[08:55:36.089][215dc864] INFO[TIME]: Time delta: 0.086724996566772
And my syslog says:
Jan 30 09:55:36 webandmail dovecot: managesieve-login: Login: user=<#USERNAME#>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=8318, secured, session=<9WSaxNoNHQB/AAAB>
Jan 30 09:55:36 webandmail dovecot: managesieve(#USERNAME#): Disconnected: Logged out bytes=19/70
Then I add a filter, click done and end up with the message "These changes need to be saved to the server".
When I press Save, nothing happens and nothing gets logged...
Ralf.
Edit: This was tested with a user with no existing Sieve filters. I see "sieve" and "sieve/tmp" directories in the user home are being created with the first manage-sieve login.
Thanks!
Can you create some logs then you press Save button?
What do you mean? When I press Save, nothing happens and nothing gets logged...
Any js errors?
You mean in Apache logs? I get also nothing in Apache logs when pressing Save.
Same here. Not able to save new Filterscripts. Using this testinstallation on Nginx.
Tested in Firefox and Chrome. Nothing appears in any logs
Hi, sorry for not replying in time.
@ervee No, I mean browser console.
Ok, there is a new version on RainLoop Webmail with a lot of changes and fixes.
link: --removed--
Still the same behaviour with the new version.
Can you give me access credentials for tests?
wrote an mail to [email protected]
@andre-dierker Thank you very much. You really helped.
new version: --removed--
Works fine now :)
Saving scripts works here too. Saved script also looks okay. I'll try to test as much rule types as possible. If I find anything wrong I'll let you know.
Ok, thanks!
I do already have a little feedback:
1) I think it should me more clear to the user that the rules are processed from top to bottom and when there is a match, processing stops there. Al least, you insert a "stop" in every Sieve filter.
2) The filters are movable. So perhaps tell the user or make it visualy noticable like in most Android movable lists there are sort of a visual handle at the beginning of each movable item.
3) Perhaps an (advanced) option to _not_ stop rule processing after the rule you are creating/editing?
Ralf.
@ervee Thanks.
1) 2)
Agree.
3) Perhaps an (advanced) option to not stop rule processing after the rule you are creating/editing?
I thought about that. But I can not understand the reason why this is necessary.
If only to use it for "Forward to" and "Vacation message" actions.
The only thing I can quickly think of is indeed vacation messages. Perhaps:
1) Make "don't stop processing rules" an option when creating a vacation message?
2) Also have the user decide the reply interval (fixed set at 1 day now)
The only thing I can quickly think of is indeed vacation messages. Perhaps:
1) Make "don't stop processing rules" an option when creating a vacation message?
2) Also have the user decide the reply interval (fixed set at 1 day now)
Done.
Managesieve running on port 2000 is very outdated, maybe change it to 4190 in sieve configuration?
Ok
new version: --removed--
The filters I created with the previous version (filename rainloop.sieve.user.sieve) are now not visible anymore (but still there) and a new file rainloop.user.sieve is created and the symlink .dovecot.sieve is updated to use that new script. I assume this was a deliberate change :)
Also RainLoop does not use an already existing script? I don't realy know how this works though...
All looks good. But I do get a weird problem in this version (and the previous) if I open an email to read. I can't close it (with the X button of ESC). The message just pops back up again!
I assume this was a deliberate change
Yes
Also RainLoop does not use an already existing script?
I don't realy know how this works though...
RainLoop knows how to build script only.
The message just pops back up again!
I can not reproduce it.
The message just pops back up again!
I can not reproduce it.
Probably a browser/cookie/whatever. It's a test setup so I don't mind.
Ok, now I see the problem.
Thanks for reporting!
This version works great so far.
Sieve is working fine now. Now there is a related problem in Inbox view. Reloading the message list, doesn't reloading subdirectories too. New mails in folders aren't displayed.
@ervee Good.
@andre-dierker There is other reloading mechanism for that (automatically).
Reload button is for current folder message list only.
Hi Rainloop Team!
I couldn't test this feature yet, but I have one feedback:
Have to remove the Sieve configs of the validation (Test button) when "Allow sieve scripts" is not checked
Nice feature!
@arturbonnett Thanks for reporting!
I think it is a last beta version before release (RC1): --- removed ---
Just tested this version and it looks okay to me.
Updated my acceptance instance and still looks good :)
Ahhhhhh I'm so happy to see that sieve filters are in :)
But I did not understand why imap & smtp settings are there and what I have to put ?
My settings:
My error:
If i try to put 127.0.0.1 : 2000, it says that the server is not accessible.
Thanks a lot
Why your sieve port is 993?
Did you mail server support sieve scripts?
That's good question.. I'll try to find the answer... I hope so !
Ty for ur reply
please allow it to support already existing filters which were created by sogo.
Suggestion to add a link on the sieve page to the sieve help. This is probably the best page that I've seen: https://support.tigertech.net/sieve but also of course the rfc https://www.ietf.org/rfc/rfc3028.txt and http://sieve.info/ - up to you which to add.
So I finally got the time to test the sieve filters and I remember I had some set up .. but I don't see them .. found out that rainloop has its own "commented headers" that don't allow reading the filters I had written myself OR the ones I had created with squirrelmail .. why ?
why ?
A quick answer is: "It's too complicated"
But when you manage Sieve filters from multiple applications, the problem rises quickly to the surface. When you create rules in RainLoop (and you fail to notice your existing rules don't show in RainLoop) and save them, you wipe out your existing filters...
I don't have this problem because I only use RainLoop to edit Sieve filters, but I can imagine people running IE RoundCube and RainLoop together. Or when migrating from RoundCube to RainLoop, this needs admin intervention.
you wipe out your existing filters...
I do not delete them, I created my own script and sets it as default.
I understand that the best decision is to write a complete Sieve scripts parsing library,
but it is very complex and time consuming task.
im getting the message "Cannot connect to Server" when i click on the filters link.
nevermind - left off sieve in dovecot.conf
Works fine! thanks a lots!
i try to use with gmail
but not working
please check below screen
1 .

2.

please help me
@dineshrabara you need a sieve server for sieve to work, AFAIK gmail does not implement it.
how can i?
please help me
@dineshrabara you can't.
is this possible to add vacation email script ??
@dineshrabara https://github.com/RainLoop/rainloop-webmail/issues/43
Thanks @AndrewSav
working well here, using dovecot-managesieved on standard port.
Sorry add a new comment :)
but last year you comment about subfolder refresh :
RainLoop commented on 2 Feb 2015
@ervee Good.
@andre-dierker There is other reloading mechanism for that (automatically).
Reload button is for current folder message list only.
is it possible to know how it's working and is there a way to speed up notification for unread message moved in folder ?
btw thanks for this fresh webmail :)
Hello,
Is it possible to enable the "body" condition for the sieve filter?
Thanks.
Hello,
Sorry to reply on an old/closed subject but I really would like to know this:
I have added the sieve support to create rules, but I would LOVE an option to copy a message to another folder without removing it from the inbox folder.
Is there already an option like this or can this be done?
Edit:
Just tried to add a few filters, but they are not being saved.
They are added when I add them, but when I navigate to another page and go back to the filters page, the rules are gone.
Copy: in theory should work like this: https://tools.ietf.org/html/rfc3894 Did you try it?
Saving them - this best be troubleshoot from server logs. What sieve server are you using?
Is it possible to implement the parsing using existing projects? The inability of RainLoop to modify filters created by other programs makes this feature rather incomplete and in some cases even useless. Maybe to add an "Advance" mode in which parsing/interpretation is not needed, just a pure text field through which would be possible to edit all sieve scripts served by the server?
@adundovi as far as parsing goes, it does not belong on the mail client such as rainloop. The ability to edit sieve scripts, as far as I remember has been supported from the first release that included sieve support.
Hi @AndrewSav, thank you for your quick reply.
I was referring to this comment of @RainLoop above. As I already saw it in practice: RainLoop creates a custom base64 encoded comment inside a sieve script which saves the content of it in RainLoop's recognizable format therefore it doesn't need to parse the sieve language to interpret those rules - reading that comment is enough, if I understand the mechanism correctly (or if I correctly read the code: RainLoop/Providers/Filters/SieveStorage.php). If the other mail client doesn't update the comment in the sieve script created by RainLoop, RainLoop will not display it correctly.
OK, now by reading the code I understand that there is an option for "raw" sieve scripts like I suggested in my first comment. Great! Thus, if one uses the "raw" mode, there is no graphical editing of the scripts, but at least other programs can interfere with those rules. This is fair enough for me.
Is there some filter limit? After 59 filter I get a ”Invalid token” error, when I try to save filters.
Same issue for me.
59th filter cannot be saved with "Invalid Token" issue.
Removing one filter and adding a new one works correctly.
Hi, today I've tested Rainloop filters (or course, installed and configured Sieve with Dovecot first) and works. But I have a problem, which I think is related of Rainloop works: I needed to implement filters most of all cause I need to move emails to folders (since We are leaving Google apps, missing Gmail labels, at least I need to move emails to folders), but does not appears as new emails, only if i navigate to that folder.
There is no way to check for new emails in any folder and not only in the current folder I am browsing?
Thanks in advance.
In settings, folders you can toggle a checkmark for that:

@ervee: thanks! I didn't saw that.
Cheers.
Hello!
Currently I use mail server with postfix+cyrus-imap+roundcubemail.
It work fine and a can manage sieve rules via roundcubemail web console.
I installed rainloop app in nextcloud and see that sieve filters not working.
I can't see my current sieve rules and can't create new rules.
Nextcloud version- 12.0.2
Rainloop app version - 5.0.1
Please. fix this issue.
Have you thought about using a good library for parsing the true sieve rules? I understand that this is probably complicated to implement, but there seems to be some library around, which supports sieve + extensions:
https://github.com/ProtonMail/libsieve-php
This would mean no more rules restricted to an own format with a converter to sieve, but being able to implement all possible sieve rules and parse them.
I did not test it myself, but you could give it a try. Would make your life easier in maintaining the sieve-function and our life easier in using every sieve client we can find and still being able to edit the rules in rainloop.
+1
So what's the condition for rainloop to show a script ? I have a "Main" script in use currently which was created from thunderbird, but rainloop doesn't show anything even with the custom script ticked.
this may be obvious to most folks here, but i just want to link more and add redundancy because i had lots of issues to find a link with good documents and examples on how to use sieve script.
imho, this should be a link into rainloop on that very page from op in which there's a list of supported capabilities:
https://tools.ietf.org/html/rfc5228
cheers!
For me Sieve does not work on Rainloop (and Sieve is running in my server, Ubuntu 18.04).
Most helpful comment
Have you thought about using a good library for parsing the true sieve rules? I understand that this is probably complicated to implement, but there seems to be some library around, which supports sieve + extensions:
https://github.com/ProtonMail/libsieve-php
This would mean no more rules restricted to an own format with a converter to sieve, but being able to implement all possible sieve rules and parse them.
I did not test it myself, but you could give it a try. Would make your life easier in maintaining the sieve-function and our life easier in using every sieve client we can find and still being able to edit the rules in rainloop.