Author Topic: Sieverules (managesieve) plugin  (Read 212920 times)

Offline zoc

  • Newbie
  • *
  • Posts: 2
Sieverules (managesieve) plugin
« on: May 09, 2009, 05:35:25 AM »
Hi

I'm using the sieverules plugin with roundcube trunk and It works like a charm. The lack of sieve support was one of the things that kept me using squirrelmail & avelsieve for months. I have to say that last week I trashed squirrelmail, and now roundcube is the only webmail I use on my server.

(The last thing I'm missing is the ability to manage spamassassin setting into an LDAP tree instead of SQL, but this is another story...).

So, first of all, many thanks to the sieverules author(s).

I have some questions/remarks about the plugin:
  • The plugin generates a big if/elseif rule. So in my mind, the "stop processing more rules" action is useless because when entering an "action" block, no other block will ever be entered.
  • Thinking about the previous remark, how can I execute 2 rules, for example: Mark every incoming mail as important if it contains specific words in the subject field, and then move the mail to a folder dedicated to each sender ?
  • The "Sender" address does not work on my postfix/cyrus-imap server. It does not match the "From" header. How could I add the "Sender" header with postfix ?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Sieverules plugin
« Reply #1 on: May 09, 2009, 12:21:18 PM »
Hi,

Thanks for the feedback, I’m glad you like the plugin :D.

Quote from: zoc;18928

1. The plugin generates a big if/elseif rule. So in my mind, the "stop processing more rules" action is useless because when entering an "action" block, no other block will ever be entered.


You’re right, the way the rules are currently written there is no point in having a stop action. It is there for historical reasons and also from completeness. Whilst it will have no effect it does not do any harm. If you want you can turn it off in the config so it won’t appear in the UI.

Quote from: zoc;18928

2. Thinking about the previous remark, how can I execute 2 rules, for example: Mark every incoming mail as important if it contains specific words in the subject field, and then move the mail to a folder dedicated to each sender ?


If you check the readme in the next version (should be out tomorrow I hope) you will find some instructions on how to make the plugin writes the rules as separate if statements rather than if … elsif. Changing the way the rules are written would be the only way to achieve this.

Quote from: zoc;18928

3. The "Sender" address does not work on my postfix/cyrus-imap server. It does not match the "From" header. How could I add the "Sender" header with postfix ?


I’m sorry I have no idea, I know nothing about Postfix
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline zoc

  • Newbie
  • *
  • Posts: 2
Sieverules plugin
« Reply #2 on: May 09, 2009, 02:39:30 PM »
Thank you for your answers.

Offline kase

  • Newbie
  • *
  • Posts: 3
Sieverules plugin
« Reply #3 on: May 13, 2009, 09:48:48 AM »
Hello,

I'm very impressed about the script but I have a problem.


I have a global sieve rule to move spam into the Junk folder. Not very impressing. But when I add a custom sieve rule in roundcube the global rule has no effect anymore.


Maybe someone can help me?

Dovecot deliver, amavis, sieve (of couse :D )

If you need further informations, ask :)

thanks,
kase
« Last Edit: May 13, 2009, 02:49:36 PM by kase »

Offline kase

  • Newbie
  • *
  • Posts: 3
Sieverules plugin
« Reply #4 on: May 14, 2009, 04:35:13 AM »
Maybe it's possible to put this in the user sieve rule file:

Code: [Select]
require ["include"];
include :global "/home/vmail/global-spam.sieve";


But I don't know in witch file I have to add this?

Offline vincenth

  • Newbie
  • *
  • Posts: 1
Problems between info and managesieve patch
« Reply #5 on: May 14, 2009, 06:03:26 AM »
Hello JohnDoe

You plugin is  wonderful, I have just one problem. I can't import ingo scripts with your importer by default.

Can you explain to what is the problem ? Because I have more than 20 sieve rules in ingo and they are not recognized by the plugin.

It's successful if I add them but it overwrite my rules, but I can't import them.

Is there a solution ?

I'm very sorry for my bad english.

Regards,

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Sieverules plugin
« Reply #6 on: May 14, 2009, 01:10:07 PM »
kase: the plugin does not support the include extension but in recent versions of the plugin you have been able to specify a default rule file in the config, this was originally loaded automatically if you had no rule file of you own but in the latest version you are shown a setup screen which lets you “use default rules”. This will save the default rules to your rule file, meaning you don’t loose anything when you start adding your own. I’m guessing you lost your original ones because the server only uses the global rule file if you don’t have any of your own.

vincenth: the import filters are no where near perfect but I did make one little change to the INGO one that isn’t on the website yet which seems to help it pick up more rules. (attached file: ingo.txt should be renamed ingo.php and put in the importfilters folder, replacing the existing one).

I don’t have access to an INGO system so I can only work with the limited examples I have and I do not have much time to work on the filters. If you have the time perhaps you would like to create a better one.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline kase

  • Newbie
  • *
  • Posts: 3
Sieverules plugin
« Reply #7 on: May 14, 2009, 02:51:33 PM »
Hello JohnDoh,

witch setup screen do you mean?

Thanks,
kase

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
the setup screen
« Reply #8 on: May 16, 2009, 07:11:51 AM »
when a use loads the filters screen the plugin first checks to see if they already have a rule file (even if it is empty). If they have nothing then the plugin checks for the presence of a default rule file (set in the config) and if it can read it then it gives the user to option to load these default rules (screenshot attached).

The plugin also looks in the user's sieve folder to see if they have any other rule files and tests these against the import filters to see if they can be used. In the attached screenshot you will see that the plugin found a rule file from INGO and so the user has the choice to use the default file, the INGO one, or skip and start a fresh set of rules. If no default rule file is defined and no filters are available for import then no message is displayed. The user just has the option to create new rules like normal.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline olest

  • Newbie
  • *
  • Posts: 5
Sieverules plugin
« Reply #9 on: May 16, 2009, 04:15:58 PM »
Is this plugin: Roundcube :: Managesieve plugin the same as the plugin the this thread?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Sieverules plugin
« Reply #10 on: May 20, 2009, 03:32:11 AM »
no, Roundcube :: Managesieve plugin is the orginial managesieve patch made by Alec (one of the RC developers) this thread is about RoundCube Patches & Plugins a plugin which was based on Alec's work but is totally seperate.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline oscar

  • Newbie
  • *
  • Posts: 6
Sieverules plugin
« Reply #11 on: May 20, 2009, 05:50:40 AM »
A little feedback with the latest plugin and current trunk.

1. I had to change sieverules.php line 683 to $rcmail->decrypt($_SESSION['password']).

2. It would be great to be able to customize the Filter drop-down, "Sender" doesn't work for me, I have to use "Envelope From".. (What's the difference between these anyway?)

3. I still can't use the "Mark message as" function (debug från pysieved):
=== S: 'NO "Info: line 80: flag \'\\\\flagged\': not a system flag"\r\n'

Changing line 1310 in sieverules.php to only \\Flagged instead of \\\\Flagged worked for me. The rule doesn't show up correctly when editing it though, it selects the first alternative instead of the Flagged alternative. But it saved ok, and filtered ok.
« Last Edit: May 20, 2009, 06:09:26 AM by oscar »

Offline Pixel

  • Newbie
  • *
  • Posts: 5
Sieverules plugin
« Reply #12 on: May 21, 2009, 06:48:25 PM »
Since I updated Dovecot to 1.2, this plugin doesn't work anymore.
When I click New Filter nothiing happens, also when I click on Advanced editor nothing happens.. I still see the roundcube logo and "No filters found".
So no errors. Tested managesieve manually with a terminal connection and there it works fine.

How can I best debug this?

Offline Pixel

  • Newbie
  • *
  • Posts: 5
Sieverules plugin
« Reply #13 on: May 21, 2009, 06:53:37 PM »
Also found that rcmail::get_instance()->action always returns plugin.sieverules.setup while I'm at the page webmail/?_task=settings&_action=plugin.sieverules.advanced or add filter page.. that's why I get no GUI update..
« Last Edit: May 21, 2009, 07:12:35 PM by Pixel »

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Sieverules plugin
« Reply #14 on: May 22, 2009, 02:08:45 PM »
Quote from: oscar;19070
1. I had to change sieverules.php line 683 to $rcmail->decrypt($_SESSION['password']).


Yep, the function changed a couple of days ago, it will be updated in the next version of the plugin.

Quote from: oscar;19070
2. It would be great to be able to customize the Filter drop-down, "Sender" doesn't work for me, I have to use "Envelope From".. (What's the difference between these anyway?)

3. I still can't use the "Mark message as" function (debug från pysieved):
=== S: 'NO "Info: line 80: flag \'\\\\flagged\': not a system flag"\r\n'


In the new version I have moved the arrays which define those headers and the flags and also the operators to the top of the sieverules.php file so you can change them if you need to.

Pixel: I think there was a problem with start up in the case when you have no existing file, no default file, and no files to import. This will be fixed in the new version. I use Dovecot version 1.0.15, did your rules show up before you upgraded dovecot, do you still have your rule file etc or are you starting over?

New version should be done this weekend sometime I hope.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…