Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: zoc on May 09, 2009, 05:35:25 AM

Title: Sieverules (managesieve) plugin
Post by: zoc 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:
Title: Sieverules plugin
Post by: JohnDoh 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
Title: Sieverules plugin
Post by: zoc on May 09, 2009, 02:39:30 PM
Thank you for your answers.
Title: Sieverules plugin
Post by: kase 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
Title: Sieverules plugin
Post by: kase 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?
Title: Problems between info and managesieve patch
Post by: vincenth 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,
Title: Sieverules plugin
Post by: JohnDoh 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.
Title: Sieverules plugin
Post by: kase on May 14, 2009, 02:51:33 PM
Hello JohnDoh,

witch setup screen do you mean?

Thanks,
kase
Title: the setup screen
Post by: JohnDoh 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.
Title: Sieverules plugin
Post by: olest on May 16, 2009, 04:15:58 PM
Is this plugin: Roundcube :: Managesieve plugin (http://alec.pl/roundcube/managesieve/) the same as the plugin the this thread?
Title: Sieverules plugin
Post by: JohnDoh on May 20, 2009, 03:32:11 AM
no, Roundcube :: Managesieve plugin (http://alec.pl/roundcube/managesieve/) is the orginial managesieve patch made by Alec (one of the RC developers) this thread is about RoundCube Patches & Plugins (http://www.tehinterweb.co.uk/roundcube/#pisieverules) a plugin which was based on Alec's work but is totally seperate.
Title: Sieverules plugin
Post by: oscar 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.
Title: Sieverules plugin
Post by: Pixel 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?
Title: Sieverules plugin
Post by: Pixel 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..
Title: Sieverules plugin
Post by: JohnDoh 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.
Title: Sieverules plugin
Post by: Pixel on May 22, 2009, 02:18:57 PM
Quote from: JohnDoh;19146
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.
That's correct, I wanted to post the same, because I came to the same conclusion.
I added a filter with the Thunderbird manageSieve plugin. When that one was activated, you're plugin worked again.
I got the errors because I cleared my sieve directory, so all existing rules where gone.

Maybe it's an idea to keep old versions online? So I could install the old one?
Title: Sieverules plugin
Post by: JohnDoh on May 25, 2009, 03:14:40 PM
The problem with first time use should be fixed in the new version please give it a go. I don't want to keep old versions of the plugins knocking around, atleast not until the API is stable.
Title: Sieverules plugin
Post by: Pixel on May 27, 2009, 04:06:26 PM
Great :cool:
Working now.
Maybe it's an idea to set a "enotify" synonym to "notify".
In Dovecot 1.2 notify is replaced by enotify. As far as I can see in the docs, the syntax is the still the same (but still no http support :().

Also I can't create a second rule. Then I get an javascript error on line 420 in the javascript file.
Title: Sieverules plugin
Post by: JohnDoh on May 28, 2009, 04:15:33 AM
ok this should fix the JS error, I dont have time to test it properly right now but I think it will work: sieverules.js line 29
change:
Code: [Select]
rcmail.env.iid && !rcmail.env.eid
to:
Code: [Select]
rcmail.env.iid && rcmail.env.iid < rcmail.sieverules_list.rows.length && !rcmail.env.eid

looking at the Dovecot wiki it seems that they have swapped notify for enotify and added imap4flags. as far as i can see the syntax for imap4flags is the same as imapflags. looking at the RFC i think that is true for enotify too. I will add support to the plugin when i get time.
Title: Sieverules plugin
Post by: johker on May 28, 2009, 11:35:37 AM
Hi there,

i was trying to install this plugin and encountered the following error when clicking on the "Filter" tab:

Code: [Select]
PHP Error in /var/www/webmail.domain.tld/docs/rcube-0.3beta/program/include/rcube_template.php (342): Error loading template for sieverules.setupsieverules

Error loading template for sieverules.setupsieverules


I am using roundcube 0.3-beta and the latest version of this plugin. I followed the README file for installation instructions.

I'd be glad if someone could help me solve this problem!
Title: Sieverules plugin
Post by: JohnDoh on May 28, 2009, 01:15:39 PM
as it says on the site:

Note: These plugins use the plugin skinning functionality added in r2509 - r2519, after 0.3-beta. Due to changes in the core some plugings may only work with the SVN Trunk version of RoundCube.

If I get I will try and get some old versions of the plugins online which work with 0.3b.

UPDATE: The new version is now available on the website as well as a version for 0.3b
Title: Sieverules plugin
Post by: johker on May 28, 2009, 01:39:50 PM
It works. Thanks for your support!
Title: Sieverules plugin
Post by: marklittle on May 29, 2009, 10:32:42 AM
Quote from: JohnDoh;19268
ok this should fix the JS error, I dont have time to test it properly right now but I think it will work: sieverules.js line 29
change:
Code: [Select]
rcmail.env.iid && !rcmail.env.eid
to:
Code: [Select]
rcmail.env.iid && rcmail.env.iid < rcmail.sieverules_list.rows.length && !rcmail.env.eid

looking at the Dovecot wiki it seems that they have swapped notify for enotify and added imap4flags. as far as i can see the syntax for imap4flags is the same as imapflags. looking at the RFC i think that is true for enotify too. I will add support to the plugin when i get time.


Hey John,

FYI - I was hitting the same bug and this fixed it for me - Cheers!

Just want to say - you have done/are doing, an amazing job.. I am currently using change pw, context menu, and now sieveplugin.
Title: small managesieve incompatibilies in 0.3b
Post by: grooverdan on May 31, 2009, 03:40:49 AM
Quote from: JohnDoh;19279
as it says on the site:
UPDATE: The new version is now available on the website as well as a version for 0.3b


Nice - this works well if other setting plugins like the password plugin are not enabled.

The sieverules (30th May 2009) works well with the rc svn (revision 2577) and the password plugin.

Thanks JohnDoh
Title: Sieverules plugin
Post by: JohnDoh on May 31, 2009, 04:45:02 AM
Quote from: grooverdan;19343
Nice - this works well if other setting plugins like the password plugin are not enabled.


:s what passowrd plugin are you using and what exactly doesnt work? I have tried it with all my plugins enabled and didnt see anything obvious.

As long as the latest version works I'm not so bothered, I'm not going to change 0.3b now but it would be interesting to know what when wrong.
Title: what the sieverules/password conflict was
Post by: grooverdan on May 31, 2009, 05:06:53 AM
Quote from: JohnDoh;19346
what password plugin are you using
The one that came with the 0.3beta release.

Quote from: JohnDoh;19346
and what exactly doesnt work? I have tried it with all my plugins enabled and didnt see anything obvious.

The url /?_task=settings&_action=plugin.sieverules displays the error PHP Error: Cannot register template handler plugin.body; already taken by another plugin and the page displays the password plugin display without the localization

Quote from: JohnDoh;19346
As long as the latest version works I'm not so bothered, I'm not going to change 0.3b now but it would be interesting to know what when wrong.
That's ok - I wasn't expecting a fix.
Title: Sieverules plugin
Post by: JohnDoh on May 31, 2009, 05:48:10 AM
ah yes, I can see the error now. I think thats actually a bug in the password plugin, it shouldn't register the template handler when it does. It will stop all other plugins which use the default handler from working. I think the handler should only be registered for the password action or nothing else can add handlers.
Title: Sieverules plugin
Post by: nmgl on June 09, 2009, 09:51:04 AM
Hello.

I'm using roundcube0.3-beta and sieverules associated on a FreeBSD server/php5.2. Sieverules does not work. I have this error:

[error] PHP Fatal error:  Call to a member function show() on a non-object in /usr/local/www/roundcube/plugins/sieverules/sieverules.php on line 1162 when I want to create a new rule. I have a blank page.

Tracing enotices error, I have this:
Code: [Select]
[09-Jun-2009 16:05:20] PHP Notice:  Undefined variable: select_id in /usr/local/www/roundcube/plugins/sieverules/sieverules.php on line 1162
[09-Jun-2009 16:05:20] PHP Fatal error:  Call to a member function show() on a non-object in /usr/local/www/roundcube/plugins/sieverules/sieverules.php on line 1162


Hope this could help you.

Regards,
Title: Sieverules plugin
Post by: JohnDoh on November 30, 2008, 06:00:56 AM
Hi,

Here is a plugin to integrate management of Sieve filter rules into RC. The plugin uses the managesieve protocol to communicate with the server. The original code for this plugin was taken from Alec’s Roundcube managesieve patch Roundcube :: Managesieve plugin (http://alec.pl/roundcube/managesieve/) (now the managesieve plugin available from the RoundCube repo) I just changed the UI and added a new option or two, Alec did all the hard work! The plugin has been tested with Dovecot-managesieve.

The rule files on the server are written in a certain way that this code can understand so editing rules with other clients will not work.

For more information or to download the plugin please visit RoundCube Patches & Plugins (http://www.tehinterweb.co.uk/roundcube/#pisieverules)
Title: Sieverules plugin
Post by: JohnDoh on June 09, 2009, 01:33:48 PM
Is it possible that you do not have any identities setup in your RoundCube account (Personal settings -> Identities)

I was able to get a similar error by removing all my identities, however, I would like to confirm this is the problem.

Thanks
Title: Sieverules plugin
Post by: bouba on June 10, 2009, 07:40:23 AM
great great great plugin! Easy to install, easy to use!

congratulation!
Title: Sieverules plugin
Post by: nmgl on June 12, 2009, 07:42:39 AM
Quote from: JohnDoh;19550
Is it possible that you do not have any identities setup in your RoundCube account (Personal settings -> Identities)

I was able to get a similar error by removing all my identities, however, I would like to confirm this is the problem.

Thanks


Yes, after creating an identity, it works. Maybe it could be better if this 'problem' is fix?
Title: Sieverules plugin
Post by: JohnDoh on June 12, 2009, 09:38:25 AM
Thanks, I just wanted to make sure that was the problem. You are correct the plugin should not error if there are no identities and following the changes I made this morning (available in the repo) it will not.
Title: Sieverules plugin
Post by: bouba on June 13, 2009, 11:31:49 AM
Hi all!

After followed this great tutorial: Howto: ISP-style Email Server with Debian-Etch and Postfix 2.3 (http://workaround.org/articles/ispmail-etch/)
( i've used the also this: Howto: ISP-style Email Server with Debian-Etch and Postfix 2.3 (http://workaround.org/articles/ispmail-etch/#sieve-filtering-out-spam) to filtering spam and it worked well until i enabled the rc's sieverules plugin)

Now, i would like to implement an hidden rule like the old one based on the object of an email for all users. If contain [SPAM] in the object, the message must be moved in the "Spam" folder.

In the README ( http://www.tehinterweb.co.uk/roundcube/plugins/sieverules.README.txt ) i've see that "Predefined rules" should do what i want, but i don't know why it doesn't works

#example
$sieverules_config['predefined_rules'] = array(
    'name' => 'Is Spam',
    'type' => 'header',
    'header' => 'X-Spam-Flag',
    'operator' => 'exists',
    'extra' => '',
    'target' => ''
);

I used the esample posted (and many others), but nothing happen.. never.
So, i ask you, please how can i make a default (hidden for the all users) rule to move spam cheking the object?

Thanks a lot for the attention :)

Marco
Title: Sieverules plugin
Post by: JohnDoh on June 14, 2009, 05:44:29 AM
Hi,

Predefined rules are not "hidden rules" they are more like shortcuts, the show up in the dropdown with the name you give them and allow the user to setup a rule (eg. Is Spam) without needing to know the ins and outs of the conditions which must be matched.

Your global spam filter stopped working becuase that is exactly what it is suposed to do when there are user defined filters.

I think you have 2 choices to get it working the way you want: the first is to always run this "hidden" spam rule before the user filters by setting sieve_before in your dovecot config.

The second is to set your global sieve file as the default_file in your sieverules plugin config then if there are no user defined filters the default file is loaded. This means that everything that is in the global rule file is saved into their rule file and so no rules are lost.

More info about dovecot sieve is available here LDA/Sieve/Dovecot - Dovecot Wiki (http://wiki.dovecot.org/LDA/Sieve/Dovecot).
Title: Sieverules plugin
Post by: bouba on June 14, 2009, 03:20:08 PM
Hi John!

Thank you for supporting a baby idiot! :D

I tried both solutions, but nothing..

The first:

sieve_before in dovecot.conf (plugin section)

sieve_before = /home/vmail/globalsievercc.sieve

I followed this page: LDA/Sieve/Dovecot - Dovecot Wiki (http://wiki.dovecot.org/LDA/Sieve/Dovecot) , so i compiled this file with "sievec"

In this file i put:

#####################
require ["fileinto"];
# Move spam to spam folder
if header :contains "X-Spam-Flag" ["YES"] {
  fileinto "Spam";
  stop;
}

if anyof (header :contains "Subject" ".Spam.")
{
        fileinto "Spam";
        stop;
}

######################

A question: I've used managesieve (ManageSieve - Dovecot Wiki (http://wiki.dovecot.org/ManageSieve)) , is this "sieve plugin" the same thing (http://wiki.dovecot.org/LDA/Sieve/Dovecot)? I use dovecot 1.1 (debian testing). I can't understand the difference between the two sieve.

The second:

$sieverules_config['default_file'] = '/home/vmail/globalsieverc.sieve'; (i tried to use the compiled version and not)

Nothing appears in "roundcube.sieve" of my user.

Thanks!!!! :D

Marco
Title: Sieverules plugin
Post by: JohnDoh on June 15, 2009, 03:22:46 AM
I'm not sure why sieve_before in your Dovecot config as I understand from what it says in the manual it should allways be run before user scripts but I have never tried it myself.

Managesieve and the sieve plugin are not the same thing. Managesieve is a protcol via which a user's sieve rules can be managed. The sieve plugin is the thing that does the work.

For the default_file config option in the plugin, you want the non complied version of the file and make sure it can be read by what ever user your webserver runs as. Then you need to delete the roundcube.sieve file from your .sieve directory. The default file is only checked when non user defined rules exist (and the roundcube.sieve file doesnt exist).
Title: Sieverules plugin
Post by: bouba on June 15, 2009, 04:11:23 PM
Quote from: JohnDoh;19625
I'm not sure why sieve_before in your Dovecot config as I understand from what it says in the manual it should allways be run before user scripts but I have never tried it myself.

Managesieve and the sieve plugin are not the same thing. Managesieve is a protcol via which a user's sieve rules can be managed. The sieve plugin is the thing that does the work.

For the default_file config option in the plugin, you want the non complied version of the file and make sure it can be read by what ever user your webserver runs as. Then you need to delete the roundcube.sieve file from your .sieve directory. The default file is only checked when non user defined rules exist (and the roundcube.sieve file doesnt exist).

:( i don't know where i wrong...
I deleated my "roundcube.sieve" i loaded in default_file my "globalsieverc.sieve" (not the compiled one). chmod 777 it with "www-data" user or "vmail" user.
When i disable the plugin in rc's main.conf.php and enabled back "global_script_path = /home/vmail/globalsieverc.sieve" in dovecot.conf lda , all Spam mails are moved to the Spam folder.
How can i test if sieverules plugin loads my default file?

edit:
--------
Ok another test:
If i use

$sieverules_config['default_file'] = '/home/vmail/nofile.sieve';
or
$sieverules_config['default_file'] = '';

When i open "sieverules" in roundcube nothing appears. If I put:

$sieverules_config['default_file'] = '/home/vmail/globalsieverc.sieve';

He ask me:
"No existing filters detected!
Use default filters: There is a set of default filters available. Would you like to use these filters?"

(if i click "use default filters" the plugin create a roundcube.sieve empty with only a comment in the first row)

So the file can be read from roundcube, but it doesn't read the rules inside.

My lda:

protocol lda {
    log_path = /home/vmail/dovecot-deliver.log
    auth_socket_path = /var/run/dovecot/auth-master
    postmaster_address = pmrb5@email.it
    mail_plugins = quota cmusieve
    global_script_path = /home/vmail/globalsieverc.sieve
    #sieve_global_path = /home/vmail/globalsieverc.sieve
}

if i use "mail_plugins = quota sieve" no mails are delivered

----


thanks again my friend :)
Title: Sieverules plugin
Post by: JohnDoh on June 17, 2009, 01:48:11 PM
hmmm ok so this looks like a bug, it shouldnt create a blank file when setting the default, unless ofcourse the default file is blank. What version of RC are you running? if its trunk then you can try with the lastest versioni of the plugin, I cant remember exactly when it was but I made some improvements to the way the files are loaded. Or could you attach your default sieve file? I can put it in my setup and see if I can figure it out.
Title: Service unavailable
Post by: timtraver on June 25, 2009, 06:25:07 PM
Hey John,

ok, so I installed a fresh copy of rouncube 0.3beta, and your sieve plugin, but when I go to the Filters tab, I get the following error :

SERVICE CURRENTLY NOT AVAILABLE!

Error No. [0x01F5]

I also see this error in the logs :

PHP Error: Error loading template for sieverules.sieverules in /usr/local/apache/htdocs/3/program/include/rcube_template.php on line 342 (GET /3/?_task=settings&_action=plugin.sieverules)

I see the sieverules templates in the default skins area in the sieverules plugins folder. Am I suppose to copy that stuff over to the main default skins area???

but on the same machine, if I run version 0.2.1 with your sieve patches, it works. I can see that the managesieve is listening on port 2000...

Not sure where to look to see what the problem is...

Can you help?

Thanks,

Tim
Title: Sieverules plugin
Post by: JohnDoh on June 26, 2009, 02:33:03 AM
easy, you have to use the 0.3-beta version of the plugin for 0.3-beta RC, not the latest development one. :)
Title: Sieverules plugin
Post by: timtraver on June 26, 2009, 05:23:23 PM
ok, silly question then...

From your plugins page, is that the latest working version for the current codebase then?

If so, then where would I even get the 0.3 beta version of your plugin?

maybe it would be easier to just check out the latest version of roundcube from subversion, and that would get it working, right?
Title: Sieverules plugin
Post by: JohnDoh on June 27, 2009, 04:29:59 AM
On the plugins page there are links to both the latest dev version, and the 0.3b version. The latest dev version works with the latest version of roundcube from subversion. 0.3b tar.gz file (http://tiw.ghost.sitespider.co.uk/roundcube/plugins/sieverules.0_3b.tar.gz)
0.3b Zip file (http://tiw.ghost.sitespider.co.uk/roundcube/plugins/sieverules.0_3b.zip)
Title: Sieverules plugin
Post by: bouba on June 28, 2009, 06:16:12 PM
Quote from: JohnDoh;19691
hmmm ok so this looks like a bug, it shouldnt create a blank file when setting the default, unless ofcourse the default file is blank. What version of RC are you running? if its trunk then you can try with the lastest versioni of the plugin, I cant remember exactly when it was but I made some improvements to the way the files are loaded. Or could you attach your default sieve file? I can put it in my setup and see if I can figure it out.


I JohnDoh, sorry for the delay

I was using roundcube 0.3 beta with Sieverules 0.3 beta.
I've upgraded dovecot to 1.2 rc5 (that uses Sieve plugin). As you told me, with this version of dovecot and Sieve plugin, i can use sieve_before, so i solved my problem :)

thanks for your help! :)
Title: Sieverules plugin
Post by: timtraver on June 29, 2009, 06:39:53 PM
ok, I got the sieverules plugin to work by updating everything to a recent SVN version...

but, it looks like the rule option for imapflags isn't showing any values.

i.e. when I choose to "Mark message as", there is nothing to the right that would let me choose anything...

Tim.
Title: Sieverules plugin
Post by: timtraver on June 30, 2009, 04:24:45 PM
Just verified that I couldn't see any of the "Mark message as" choices in IE as well as Firefox...

It appears that in the source, the values are there, but when selected, it does not activate the menu to choose the imap flag value...

I do not see any javascript errors being produced either...

Tim.
Title: Sieverules plugin
Post by: JohnDoh on July 01, 2009, 03:14:27 AM
i cant recreate this, the drop down shows up just as it should for me in both 0.3b and the latest dev. could you double check there are no JS errors, also try clearing your cache and check the RC error log for any PHP errors? thanks
Title: Sieverules plugin
Post by: timtraver on July 01, 2009, 05:20:41 PM
hmmmmm....

ok, I just got the latest SVN build (2694) and installed it from scratch...

then I got the latest SVN of your sieverules plugin and installed that too...

Still have the problem where it does not show the "Mark message as" list to choose from...

I dont see any javascript errors in the javascript console either, or the errors log in the installation.

I have included a screenshot of what I see.

Kind of baffling...

Tim
Title: Sieverules plugin
Post by: JohnDoh on July 02, 2009, 03:11:03 AM
it is indeed kind of baffling. look at the source of that page, find \\Seen, it should be in there twice, it is one of the options in the imapflags dropdown, make sure the code for both boxes is generated correctly.
Title: Sieverules plugin
Post by: timtraver on July 02, 2009, 02:23:57 PM
ok, It looks like they are generated correctly here is the first one :

Code: [Select]
<select name=_imapflags[]&quot; style=&quot;display: none; width: 398px;&quot;>
<option value=&quot;\\Seen&quot;>Read</option>
<option value=&quot;\\Deleted&quot;>Deleted</option>
<option value=&quot;\\Answered&quot;>Answered</option>

<option value=&quot;\\Draft&quot;>Draft</option>
<option value=&quot;\\Flagged&quot;>Flagged</option>
</select>

and then the second one :

Code: [Select]



they look identical to me...

Like I had mentioned, I'm trying in Firefox (3.011) and IE (7.0.5730.13) and I'm not seeing any errors in the javascript consoles.

Some more odd behaviors. If I select it like you see in the pic i sent you, and then save the rule, the rule gets saved like so :

Code: [Select]
## Generated by RoundCube Webmail SieveRules Plugin ##
require ["imap4flags];
# rule:[test]
if anyof (header :contains "Subject" "test")
{
        setflag "";
}


Then, if I select the rule again, I can then see the action popup for the flag action. But, if I save a different action, it does not save properly (same as above)

But even if I add another rule, and select "Mark message as" again, it is once again blank...

what can I send you to help out with the process of figuring this one out ???

I don't think it matters, but I'm using dovecot's managesieve stuff...

I might be able to get you a login to this test installation, but I'll have to open some ports...

Thanks,

Tim.
Title: Sieverules plugin
Post by: timtraver on July 02, 2009, 08:20:47 PM
I sent you a PM about a test login for our system that hopefully can help you in determining what you think my issue is...

let me know if you need anything else,

Tim.
Title: Sieverules plugin
Post by: JohnDoh on July 12, 2009, 10:08:36 AM
I think the problems timtraver was seeing are now fixed in the latest development release. The problem was support for Dovecot 1.2. Thanks to timtraver for his help in debugging.

Latest development release also includes support for Body and Copy extensions and some other minor bug fixes.
Title: Sieve Body comparison
Post by: timtraver on July 22, 2009, 03:59:27 PM
Hi,

was wondering if you were going to put the RFC 5173 Sieve implementation of searching the body for content in your sieve rule plugin?

Also, it appears that when writing the sieve rules, they are all written as elseif statements, which means that only one rule can be hit. Can those be set up as individual if statements?

Thanks,

Tim.
Title: Sieverules plugin
Post by: JohnDoh on July 23, 2009, 03:28:40 AM
The latest development version of the plugin does allow for filtering on the message body (if it is support by your server). latest development version requires the svn trunk version of RC.

To make the plugin write single if statements rather than elseif please check the readme.
Title: Sieverules plugin
Post by: fgh on July 28, 2009, 05:24:58 PM
if i click on new filter nothing happens

in my apache log i found:
file does not exist: /usr/share/roundcubemail/undefined, referer: http://host/webmail/?_task=settings&_action=plugin.sieverules.add



any ideas, thats wrong?
Title: Sieverules plugin
Post by: timtraver on July 28, 2009, 06:05:08 PM
looks like you haven't added all of the localization text fields needed by your plugin just yet...

When leaving the subject blank on an autoreply, I get the popup with the message :

[sieverules.vacnosubject]

but I can't find any vacnosubject entry in any of the localization files...

just a heads up
Title: Sieverules plugin
Post by: timtraver on July 28, 2009, 06:11:07 PM
fgh,
 
you'll need to give us more information for us to help you. Is your managesieve server up and running?
 
what roundcube software are you running??? and what version of the sieverules dist are you running?
Title: Sieverules plugin
Post by: fgh on July 28, 2009, 06:17:04 PM
Quote from: timtraver;20300

you'll need to give us more information for us to help you. Is your managesieve server up and running?

yes the server is running

cat dovecon/info.log
dovecot: 2009-07-28 22:13:13 Info: managesieve-login: Login: user=, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
dovecot: 2009-07-28 22:13:13 Info: MANAGESIEVE(user@test.local): Connection closed


 
Quote

what roundcube software are you running??? and what version of the sieverules dist are you running?


roundcubemail-0.3-RC1         sieverules.0_3b
Title: Sieverules plugin
Post by: timtraver on July 28, 2009, 08:45:32 PM
hmmm...well, 0.3 is definitely on the cutting edge, and I know there have been lots of improvements and fixes in the latest SVN builds.
 
I'm going to bet that the advice that you'll get from the developer will be to update your SVN build of RC as well as get the latest download of the sieverules plugin.
 
t
Title: Sieverules plugin
Post by: timtraver on July 28, 2009, 08:52:01 PM
JohnDoe,
 
I've got another one for ya...
 
ok, in your header drop down list, you have one labelled as "Sender". What I found is that in the sieverules.php file, on line 24, you have
 
'from' => 'address::Sender',
 
I think you actually meant that field to be a comparator of the "From" field so that when the managesieve writes out the rule, it uses the "From" header, as I do not believe there is a "Sender" header in most emails.
 
When I changed that line to be
 
'from' => 'address::From',
 
then it wrote out the rule in a manner that I think is what you had intended.
 
Let me know if that doesn't sound right...but if it does, then maybe you can change it in your codebase...
 
Thanks,
 
Tim
Title: Sieverules plugin
Post by: timtraver on July 28, 2009, 09:18:07 PM
JohnDoe,
 
ok, let me update that previous post...
 
It appears that you were checking on the address portion of that field, so maybe it would actually be better to have it like this :
 
'from' => 'header::From',
 
so that it checks the entire header field named From for a string.
 
Also, although you have individual entries for each of the To, Cc and Bcc, I know that you can combine them into a singal rule when writing out the sieve rule that looks something like this :
 
address :contains ["To", "Cc", "Bcc"] "me@address.com (me@address.com)"So, maybe in your header selection, you could somehow put that labeled as the option of "Any Recipient". The same may go for "Any Sender"?Tim.
Title: Sieverules plugin
Post by: JohnDoh on July 29, 2009, 03:33:01 AM
Quote from: fgh;20301
roundcubemail-0.3-RC1         sieverules.0_3b

timtraver is right, I suggest you try the sieverules.0_3rc1 version and see if the problem still occurs

Quote from: timtraver;20304
I think you actually meant that field to be a comparator of the "From" field so that when the managesieve writes out the rule, it uses the "From" header, as I do not believe there is a "Sender" header in most emails.

i have had discussions about this before and different people think it should do different things. thats why i made it really easy to change, those headers are set in an array at the top of sieverules.php and you can make it what ever you want. :)

Quote from: timtraver;20306
So, maybe in your header selection, you could somehow put that labeled as the option of "Any Recipient". The same may go for "Any Sender"?Tim.

this sounds interesting, i shall stick it on my list of things to look at

also the thing about the vacation subject message, yea i knew about that. I think I changed my mind half way though and then forgot to take it out everywhere - it was fixed already in rc1 but thanks for letting me know.
Title: ManageSieve howto for RoundCube??
Post by: fms on September 01, 2009, 03:19:17 PM
Hi All.

I'm trying to understand how to put sieve/managesieve in action on my server.

I'm running FreeBSD + PostFix + Dovecot + RoundCube

I activated managesieve plugin, but when I try to access it from RC, I receive the error: cant connect to managesieve server on port 2000.
Title: Sieverules plugin
Post by: JohnDoh on September 02, 2009, 03:12:26 AM
hi,

you need to make sure managesieve is running on your server and that any firewall is allowing connections to it, try telnetting from the machine running RC to your mail server on port 2000 or may be check you dovecot config make sure managesieve isnt running on a different port.
Title: Sieverules plugin
Post by: Rando on September 02, 2009, 04:57:24 AM
Hello,
it seems that the vacation filter isn't created with a default "addresses" value. the aliases help seems to say it should use the "main address".

Is there a way to automatically add the default identity email address or automatically check all aliases (from the advanced options) for the vacation filter to work out of the box ?
(without "addresses", sieve won't use the filter)

thank you for this great plugin,
R.
Title: Sieverules plugin
Post by: JohnDoh on September 02, 2009, 06:06:19 AM
The address option is optional, I checked it with my sieve just now and according to the RFC as well. what imap/sieve server are you using?

If you want to make them all checked by default its easy enough, you'll find where they are generated in sieverules.php around line 1294,

Code: [Select]
$curaddress = in_array($sql_arr['email'], $vacto_arr) ? $sql_arr['email'] : &quot;&quot;;
and just change it to

Code: [Select]
$curaddress = $sql_arr['email'];
Title: Sieverules plugin
Post by: Rando on September 02, 2009, 10:47:21 AM
Quote from: JohnDoh;20892

Code: [Select]
$curaddress = $sql_arr['email'];

thanks, it works.

Quote from: JohnDoh;20892
The address option is optional, I checked it with my sieve just now and according to the RFC as well. what imap/sieve server are you using?


vacation fails to work without "addresses" with
dovecot 1.2.4
sieve (not cmu) 0.1.11 or 0.1.12

sieve 0.1.12 is truly interesting with its implementation of a "date" filter rule
Title: Not importing default_file
Post by: phraktyl on September 11, 2009, 06:27:30 PM
First, let me say that Sievefules has been great! I've got it to where I'm able to edit my rules without any problems and the setup has been straightforward so far. Well done!

However, I'm having a problem getting it to import the default_file when a user doesn't have any previous rules setup.

Here's the relevant portion of my setup:

$sieverules_config['default_file'] = '/home/vmail/globalsieverc';
$sieverules_config['auto_load_default'] = TRUE;


I know the file exists and is readable, as it's the global sieve filter and it's processing other users' email. I've even used my own sieve file build with Sieverules to create the global file so it shouldn't have any issues importing it.

I'm not finding any logs that would be useful in figuring out what the hang-up is. dovecot.log shows the managesieve portion but nothing is showing up in the Roundcube errors file.

What am I missing?

Thanks
Title: Sieverules plugin
Post by: JohnDoh on September 12, 2009, 03:48:59 AM
Thanks! I'm glad you like the plugin.

Check the users .sieve folder on the server and make sure there is no roundcube.sieve file in there, the default file is only coppied if the user doesnt have a roundcube.sieve file. If they have simply deleted their existing rules and have an empty rule file then it will not be coppied.
Title: Sieverules plugin
Post by: phraktyl on September 14, 2009, 12:28:27 AM
Just checked. The mailboxes are virtual so I tried it both without the seive directory created at all, and with an empty directory. In both cases the directory showed up with a ./tmp subdirectory but no default rules.
Title: Sieverules plugin
Post by: JohnDoh on September 14, 2009, 09:24:17 AM
It is working for me, so I am not quite sure what to suggest. Best thing is probably for you to do a bit of debugging and then we can see at what step it fails. You can find the code which coppies the default rule file in sieverules.php around line 208.
Title: Sieverules plugin
Post by: phraktyl on September 14, 2009, 04:16:17 PM
Heh. After some in-depth troubleshooting, I figured out that the main issue was PEBKAC.

Due to what I'm attributing as major cerebral flatulation, all of the checking I did was to ensure that the global sieve file was readable by the dovecot user. Astute readers will note that this by no means indicates whether said file is readable by the web server user. *facepalm*

Now that the file is *really* readable by Sieverules, the default file is imported properly. The only issue I see is that if the roundcube.sieve file doesn't exist, it gets imported, but the newly-imported rules aren't editable (or selectable) until I load the page a second time.
Title: Sieverules plugin
Post by: JohnDoh on September 15, 2009, 03:23:22 AM
I noticed that too, something is wrong there. I will look into it.

D'OH I think i have fixed it, you can see what has to change here http://github.com/JohnDoh/RoundCube-Plugin-SieveRules-Managesieve/commit/f6d27bd4d114757808852f63bfd92fdd189e2996
Title: managesieve_default
Post by: sziki on September 15, 2009, 09:35:29 AM
Hi All!

The 'managesieve_default' variable does not work for me.
I have a global sieve script which handle the spams but it is not included when I create a user script with roundcube. The whole path is world-readable, the filename does not contain any special chars neither dot. I re-generated the global script with roundcube managesieve plugin so it is in "roundcube-like" format with labels, but it does not help.
How should it work? Please advise!

The managesieve plugin works, anyway. This is roundcube 0.3-stable on Debian Lenny Dovecot 1.1.13 from backports. No errors in logs.

Thanks!
Title: Sieverules plugin
Post by: JohnDoh on September 15, 2009, 09:49:02 AM
are you using the plugin from RoundCube Plugins (http://tehinterweb.co.uk/roundcube/) or the one that came with 0.3s? The config variable in sieverules is called default_file not managesieve_default?

This thread is about the sieverules plugin, if you are talking about the one which came with 0.3s then please use a new thread to avoid confusion.
Title: Sieverules plugin
Post by: sziki on September 15, 2009, 11:15:08 AM
Sorry,  I didn't know there are 2 sieve plugins. Yes, I talked about plugin which came with 0.3s called managesieve plugin.

I checked sieverules plugin. Looks better then managesieve, and the default_file works. I tried example_file and it also works but it has some character encoding problem. I created an example file with vacation autoresponse. The subject field contains characters with accents. If I load this example to use, the characters with accents change. I think the encoded version of the characters appears. (or?) This problem is not in the body. The characters are OK in there.
Title: Sieverules plugin
Post by: Nyro on September 15, 2009, 04:53:46 PM
You'll find attached the French translation created using your web interface.

After installing it, all accentuated character looks wrong in roundcube 0.3.
Hope you'll figure out how to fix it ;)
Title: Sieverules plugin
Post by: JohnDoh on September 16, 2009, 03:29:31 AM
Quote
The subject field contains characters with accents. If I load this example to use, the characters with accents change. I think the encoded version of the characters appears. (or?) This problem is not in the body. The characters are OK in there.

This is a known problem with dovecot sieve, nothing I can do about it unfortuantly.

Nyro: Thanks, I will update the file in the plugin. The french chars display ok for me, check the file on your server is saved as UTF8 (without the BOM)
Title: Sieverules plugin
Post by: Nyro on September 16, 2009, 05:37:26 AM
JohnDoh : I tried again and this time it works!
I don't know exactly what I did wrong last time, maybe I was just too tired.

Any idea when this plugin will be included directly in Roundcube?
Title: Sieverules plugin
Post by: mbsouth on September 23, 2009, 04:30:59 PM
Hi!
1st: Thx for this great plugin!

2nd: Vacation (Abwesenheitsnachricht) question:
Some miss configured mailserver doesn't accept from=<> , from= as sender or Return-Path: (no fqname) in mail header. Is it possible to use the logged-in username (email) for this?


Thx mbsouth
Title: managesieve not filtering messages
Post by: scp on September 23, 2009, 08:59:33 PM
New to this forum and Roundcube.  Have Roundcube 0.3 stable with managesieve and sieverules plugins enabled (for comparison) and Dovecot 1.2.5.  Both managesieve and sieverules write the sieve rule ok in the user's directory.  However, the incoming messages are not being filtered to the chosen folder.  They just remain in the In folder.  I possible missed something in the Dovecot or Rouncube configuration.  Any suggestions?
Title: Sieverules plugin
Post by: JohnDoh on September 24, 2009, 02:45:50 AM
Check you dvecot deliver log and the dovecot config, make sure dovecot is looking in the right place for the sieve files etc, a guide to setting it up is here LDA/Sieve/Dovecot - Dovecot Wiki (http://wiki.dovecot.org/LDA/Sieve/Dovecot)
Title: Sieverules plugin
Post by: scp on September 25, 2009, 04:12:11 PM
Thanks for your advice.  I checked everything and edited the configs again - to no avail.  Dovecot makes a link in the root of the users home directory to the rules made by the Roundcube managesieve plugin and placed in the users Sieve folder.  As far as I can tell - this is correct.  However, Incoming mail is not filtered to the chosen folder.  It remains in the INBOX.  Messages can be manually moved (within Roundcube) from the Inbox to a chosen folder.

One thing I have noticed - While I have /var/log/dovecot.log and /var/log/dovecot-info.log - I do not have a /var/log/dovecot-local-deliver.log which I thought woulld be automatically generated.

Obviously, I have missed something in the configuration files or server permissions.  Below are the configs for dovecot and Roundcube Managesieve.  Grateful for any clues.

Roundcube managesieve Config

Quote

// managesieve server port
$rcmail_config['managesieve_port'] = 2000;

// managesieve server address
$rcmail_config['managesieve_host'] = 'localhost';

// use or not TLS for managesieve server connection
// it's because I've problems with TLS and dovecot's managesieve plugin
// and it's not needed on localhost
$rcmail_config['managesieve_usetls'] = false;

// default contents of filters script (eg. default spam filter)
$rcmail_config['managesieve_default'] = '/etc/dovecot/global.sieve';

// I need this because my dovecot (with listescape plugin) uses
// ':' delimiter, but creates folders with dot delimiter
$rcmail_config['managesieve_replace_delimiter'] = '';

// disabled sieve extensions (body, copy, date, editheader, encoded-character,
// envelope, environment, ereject, fileinto, ihave, imap4flags, index,
// mailbox, mboxmetadata, regex, reject, relational, servermetadata,
// spamtest, spamtestplus, subaddress, vacation, variables, virustest, etc.
// Note: not all extensions are implemented
$rcmail_config['managesieve_disabled_extensions'] = array();

?>

Dovecot Config

Quote
protocols = imap managesieve

login_dir = /var/run/dovecot/login
login_chroot = yes
login_user = dovecot

#Mail settings
mail_location = mbox:~/mail:INBOX=/var/mail/%u
mail_privileged_group = mail

# It's nice to have separate log files for Dovecot. You could do this
# by changing syslog configuration also, but this is easier.
log_path = /var/log/dovecot.log
info_log_path = /var/log/dovecot-info.log

# Disable SSL for now.
ssl = no
disable_plaintext_auth = no

protocol imap {
login_executable = /usr/local/libexec/dovecot/imap-login
mail_executable = /usr//local/libexec/dovecot/imap
# login_greeting_capability = yes
}

## protocol pop3 {
## login_executable = /usr/local/libexec/dovecot/pop3-login
## mail_executable = /usr/local/libexec/dovecot/pop3
## pop3_enable_last = no
## }

# LDA specific settings
protocol lda {
        postmaster_address = postmaster@somwhereelse.net
        hostname = somewhereelse.net
   sieve_global_path = /etc/dovecot/global.sieve

## Sieve plugin for local delivery agent
        mail_plugins = sieve
        log_path = /var/log/dovecot-local-deliver.log
        auth_socket_path = /usr/local/var/run/dovecot/
   }

# ManageSieve
protocol managesieve {
   listen = localhost:2000
   mail_debug=yes
   mail_executable = /usr/local/libexec/dovecot/managesieve
   login_executable = /usr/local/libexec/dovecot/managesieve-login
   managesieve_max_line_length = 65536
   managesieve_logout_format = bytes=%i/%o
   }

plugin {
  # Settings for the Sieve plugin
   sieve = ~/.dovecot.sieve
   sieve_dir = ~/sieve
   }
     
auth_executable = /usr/local/libexec/dovecot/dovecot-auth
auth_process_size = 256
auth_cache_ttl = 3600

auth default {
  mechanisms = plain
  user = root
  ssl_require_client_cert = no
  passdb pam {
  }
  userdb passwd {
  }
}
Title: Sievrules problem
Post by: scp on September 26, 2009, 02:38:15 PM
I realized this forum is for Sieverules managesieve plugin and not the managesieve plugin.  So I enabled the Sieverules plugin but have exactly the same problem.  Although the sieve rule is written and dovecot makes an alias to the roundcube sieve rule - no action is taken on incoming mail to filter it to folders.  I should add that I have been using filters in other programs for a long time.  My standard desktop email program is Evolution using bogofilter and SA filters - which work very well. I also use SA on the servers.

As far as I can tell from the dovecot.log and dovecot-info.log - dovecot 1.2 is working without errors.   Also I built dovecot with the the sieve plugin.  So I cannot figure out why Roundcube Sieverule is not acting on the rule.  Is it relying on Roundcube to move the mail to the appropriate folder or is it relying on the Dovecot sieve plugin?  Feeling stupidly baffled.  Would appreciate pointers.
Title: AUTHENTICATE command fix
Post by: speed47 on September 26, 2009, 04:21:27 PM
On my configuration, the sieverules plugin can't authenticate on the dovecot 1.1 managesieve server.
After some debugging and Wiresharking, I noticed that after the plugin sends and AUTHENTICATE "CRAM-MD5" command, the server sends back a challenge, and then sits waiting for an answer. Sieverules never sends any answer back because it's still waiting for others command to arrive, due to the way the _doCmd() function of Net_Sieve.php is written. It's in fact waiting for an "OK", a "NO" or a "BYE", indicating the end of a possibly multiline answer.
The code seems to support challenges, but only if the challenge length is announced with a string-length indicator, as in :

< AUTHENTICATE "CRAM-MD5"
> {30}
> abcdefghijklmnopqrstuvwxyz1234

But the ietf draft (see draft-ietf-sieve-managesieve-09 - A Protocol for Remotely Managing Sieve Scripts (http://tools.ietf.org/html/draft-ietf-sieve-managesieve-09#page-15)) also states that the server can send the challenge between quotes and without a length-indicator, if it's short enough, as in :

< AUTHENTICATE "CRAM-MD5"
> "abcdefghijklmnopqrstuvwxyz1234"

For some reason, my managesieve dovecot server uses the latter form. I wrote a patch to add support for this form to sieverules, and it now works. This is done adding another state to the class : NET_SIEVE_STATE_CONNECTED, which is set right after the TCP connection is established, and until we set either state AUTHORISATION or TRANSACTION, after establishing the TLS layer (if configured) and after querying the capabilities. I added more code than I intended to at first sight, but, well...

It has been tested with auth methods PLAIN, LOGIN, CRAM-MD5 and DIGEST-MD5, with and without TLS.
The "bypass auth" case is however untested.
Managesieve dovecot version : 1.13 (from debian lenny backports)
Roundcube revision : 2987

Patch attached : http://www.roundcubeforum.net/attachment.php?attachmentid=1064&stc=1&d=1253996253
Title: Sieverules plugin
Post by: JohnDoh on September 27, 2009, 04:37:02 AM
Hi,

If it is a bug with Net_Sieve then you should open a bug report here Net_Sieve (http://pear.php.net/package/Net_Sieve/) but some very quick research suggests it might just be a bug in Dovecot 1.1, certainly there are no authentication problems with Dovecot 1.2. Thanks for the patch.
Title: Sieverules plugin
Post by: speed47 on September 27, 2009, 07:25:52 AM
I just tested with Dovecot 1.2.4, and I have the same problem.
It's strange nobody else seems to encounter this issue.
Anyway, I filed a bug at PEAR https://pear.php.net/bugs/bug.php?id=16647

$ wget -q 'http://svn.php.net/viewvc/pear/packages/Net_Sieve/trunk/Sieve.php?view=co' -O Sieve.php  ; cat bug.php ; php bug.php
include('Sieve.php');
new Net_Sieve('user', 'pass', 'localhost' , 2000, '', '', true, false, false, null);

S:"IMPLEMENTATION" "dovecot"
S:"SIEVE" "fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include body variables enotify environment mailbox date"
S:"SASL" "CRAM-MD5"
S:"STARTTLS"
S:"NOTIFY" "mailto"
S:"VERSION" "1.0"
S:OK "Dovecot ready."
C:CAPABILITY
S:"IMPLEMENTATION" "dovecot"
S:"SIEVE" "fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include body variables enotify environment mailbox date"
S:"SASL" "CRAM-MD5"
S:"STARTTLS"
S:"NOTIFY" "mailto"
S:"VERSION" "1.0"
S:OK "Capability completed."
C:AUTHENTICATE "CRAM-MD5"
S:"PDAzNDI5MTA4MjI2MTEwNDEuMTI1NDA1MDY0NEBtZXJjdXJlPg=="
Title: Sieverule problem
Post by: scp on September 27, 2009, 05:40:56 PM
I am using Dovecot 1.2 from source with the Sieve plugin built with it as well as the dovecot managesieve plugin also. You guys are definitely more advanced on this than I am.  It does indeed seem to be a problem with authentication - but I am wondering in my case if the problem lies with Dovecot's "Deliver"  I initially missed the bit about reconfiguring Sendmail to allow for Dovecot as a mailer.  Fixed that - but it still has not resolved the problem.
Title: Sieverules plugin
Post by: SvenK on September 28, 2009, 11:09:13 AM
@speed47

Many thanks for your patch. It was my first problem, too :):)

Quote from: scp;21774
no action is taken on incoming mail to filter it to folders.


This was my second problem. I changed this in the plugins/sieverules/config.inc.php file:

$sieverules_config['folder_delimiter'] = '.';

The delimiter for me is the '.' and not the '/' ;)

Sven
Title: Sieverules plugin
Post by: spracrevi on September 29, 2009, 06:11:47 AM
Thanks so much 4 sharing with us,bros :-)
Title: Sieverules plugin
Post by: henlon on October 11, 2009, 01:13:34 PM
Maybe a stupd question.
Is there any way to use the sieverules plugin with hMailserver and RC0.3

If not, is there another plugin to roundcube to manage filetr funtions?
Title: Sieverules plugin
Post by: Scarabaeus on October 11, 2009, 04:15:05 PM
To my knowledge (which in some circles is considered very limited), hMailServer does not support RFC 3028 style filtering.
It does have its own server side filtering functionality but I am not aware of any RC plug-ins that can leverage it.
Do a search on the hMailServer forums
http://www.hmailserver.com/forum/index.php
Title: Sieverules plugin
Post by: JohnDoh on October 12, 2009, 03:04:04 AM
i have no idea if hMailserver supports managesieve the protocol, there are lots of plugins for it made by rosali, you can see them here Plugin_Repository ? Roundcube Webmail (http://trac.roundcube.net/wiki/Plugin_Repository) may be one of them can help you.
Title: Sieverules plugin
Post by: Scarabaeus on October 12, 2009, 09:41:56 AM
hMailServer does not support managesieve the protocol. It does have its own server side filtering features, accessable via the hMail Administrator and/or scripting, but i am unaware of any RC plug-ins that leverage this functionality.
regards
Title: Sieverules plugin
Post by: gdhgdh on October 20, 2009, 10:28:01 AM
Quote from: JohnDoh;20892


If you want to make them all checked by default its easy enough, you'll find where they are generated in sieverules.php around line 1294,

Code: [Select]
$curaddress = in_array($sql_arr['email'], $vacto_arr) ? $sql_arr['email'] : &quot;&quot;;

and just change it to

Code: [Select]
$curaddress = $sql_arr['email'];


Thanks :) That /nearly/ works (using rcube 0.3 release and the current 'trunk' of sieverules from github)

If I do Filters -> New Filter
Name -> aaaaa
All Messages
Out OF Office MEssage -Period 1 - Message 'z' -> Save

I get this in the user's .dovecot.sieve:
Code: [Select]

require ["vacation"];
# rule:[aaaaa]
if anyof (true)
{
vacation
:days 1
"z";
}



If I click 'Advanced options' I can see the user's email address is already selected, and pressing 'Save'  makes the ':addresses' line appear.

How can I have the 'Advanced options' box selected by default?

Thanks! :)
Title: Sieverules plugin
Post by: JohnDoh on October 20, 2009, 03:56:16 PM
You’re quite right. Try this, a few lines above change
Code: [Select]
$vacto_arr = explode(&quot;,&quot;, $vacto);To
Code: [Select]
$vacto = "";
And add this after the original line you changed
Code: [Select]
$vacto .= ((strlen($vacto) > 0) ? ',' : '') . $sql_arr['email'];
Finally look further up the file for this line
Code: [Select]
if (!empty($vacfrom) || !empty($vacto) || !empty($handle) || $charset != RCMAIL_CHARSET) {And change it to
Code: [Select]
if (true) {
the advanced box should always be ticked and the :addresses line added
Title: Sieverules plugin
Post by: gdhgdh on October 20, 2009, 04:44:33 PM
Hurrah - perfect :) Now may I pick your brain a little more?

If I log into roundcube as 'ar-wbim', the entire email address is populated as ar-wbim@ourdomain.com since I have $rcmail_config['mail_domain'] set to 'ourdomain.com'.

However, we use firstname.lastname@ourdomain.com, so when the vacation message is set, sieve says "discarding vacation response for message implicitly delivered to " because the RCPT TO:<> address doesn't match.

I have LDAP Address Book w/ autocomplete working fine and can search for both usernames + email addresses, so could I trouble you for a couple of magic lines which would do an LDAP search for 'ar-wbim' and populate the 'Aliases' with the results?

Hence, the :addresses in .dovecot.sieve would cater for the real address and so the vacation will actually work :)
Title: Sieverules plugin
Post by: gdhgdh on October 20, 2009, 05:35:16 PM
... just been thinking (yeh, I know..) - if the LDAP lookup was moved to a user's first ever login, the lookup could search for the ar-wbim username and return the user's full name 'Wim Bim' and wim.bim@ourdomain.com email address to accurately populate their primary Identity.

That would mean no hackery at all would be required in sieverules except perhaps setting the :From address - seems a much cleaner solution :) I'm just thinking out loud now :)
Title: Sieverules plugin
Post by: hugo on October 23, 2009, 10:33:32 AM
Quote from: JohnDoh;22412


the advanced box should always be ticked and the :addresses line added


hi JohnDoh

we have a cyrus mailserver, and the vacation rule doesn't work if the :addresses line isn't specified. so i tryed to make the changes you suggested.
It still doesn't work as expected. if i make a new vacation rule, the advanced option box is not ticked by default, only after i hit save. then the box is ticked and also all the aliases, but the rule still doesn't have the :addresses line in it. if i untick an alias, tick it back on and hit save, then it adds the :addresses line and the rule works.

our versions are RC 0.3, and the sieverules plugin is 1.1, php 5.2.8, apache 2.2.14

besides this, i have found another bug: if you select the radiobutton 'all messages' and save the rule, you cannot change that anymore (the radiobuttons are still there but selecting anotherone doen't give you the options to select rules).
btw, very nice plugin ;)

greets
hugo.-
Title: Sieverules plugin
Post by: JohnDoh on October 25, 2009, 10:21:52 AM
I have added a small hack to the repo version of the plugin to make the :addresses line always added when a vacation message is created, see README for more information.

thanks for the bug report, this is also fixed in the repo version
Title: Sieverules plugin
Post by: hugo on October 26, 2009, 07:28:08 AM
yo, works like a charm, thanks :D
btw, horde has a checkbox to not respond to bulk and list mails. can you implement something like that in a future version? 0:)
example horde rule:
Code: [Select]
if allof ( not exists [&quot;list-help&quot;, &quot;list-unsubscribe&quot;, &quot;list-subscribe&quot;, &quot;list-owner&quot;, &quot;list-post&quot;, &quot;list-archive&quot;, &quot;list-id&quot;], not header :comparator &quot;i;ascii-casemap&quot; :is &quot;Precedence&quot; &quot;list,bulk&quot; ) {
    vacation :days 7 :addresses &quot;foo.bar@mail.de&quot; :subject &quot;bin wech&quot; &quot;urlaub&quot;;
}


greets
hugo.-
Title: Sieverules plugin
Post by: JohnDoh on October 27, 2009, 07:49:59 AM
glad it works. about the checkbox, may be in the future but surely you could make a predefiined or example rule to do this, then you can use what ever conditions you want.
Title: Sieverules plugin
Post by: hugo on October 28, 2009, 02:26:29 PM
hey JohnDoh
yep, thanks, already did some predefined rules and an example rule. the predefined ones are ok, but if i put an example rule, it's the same problem again with the identities. to have them show up, i need to put something like this in the example script:
Code: [Select]
require [&quot;vacation&quot;];
# rule:[ABWESEND]
if allof (not exists [&quot;list-help&quot;, &quot;list-unsubscribe&quot;, &quot;list-subscribe&quot;, &quot;list-owner&quot;, &quot;list-post&quot;, &quot;list-archive&quot;, &quot;list-id&quot;],
not header :is &quot;Precedence&quot; &quot;list, bulk&quot;)
{
vacation
:days 7
:addresses [&quot;&quot;,&quot;&quot;]
:subject &quot;ABWESEND&quot;
text:
*NOT AVAILABLE*
;
}

if i omit the ':addresses ["",""]' part, then the advanced options checkbox is again disabled and no identities checked by default. if it is like this, the adv. box is checked but the identities are still unchecked.
any thoughts?
thanks again for the patience ;)
Title: Sieverules plugin
Post by: JohnDoh on October 28, 2009, 03:22:16 PM
hmmm yes example rules should probably override the protection, it cant test it right now but i have put an update in the repo which should fix it.
Title: Sieverules plugin
Post by: hugo on October 29, 2009, 04:48:06 AM
just tryed it out. sorry, no difference, same behaviour.
Title: Sieverules plugin
Post by: JohnDoh on October 29, 2009, 03:23:43 PM
hmmm i have had a chance to try it now, i made a few other changes though. try the repo version, not user if you need to removed the :addresses line or not from your example it worked for me with both.
Title: adding rules to filter by body
Post by: periferral on November 23, 2009, 02:18:58 AM
when i add a new rule to filter by body, i get a message saying it is not supported by the server. im running dovecot 1.2.6 and managesieve server and it seems like filtering by body is supported. what gives?
Title: Sieverules plugin
Post by: periferral on November 24, 2009, 01:24:40 PM
@bambam i did see that but your options seems to be a little different from mine.
plugins/sieverules/config.inc.php

Mine is
$rcmail_config['sieverules_port'] = 2000;

Your seems to be
$sieverules_config['managesieve_port'] = 12000;

Maybe its nothing. but something to look into.

Also, what version of sieverules are you running?

When you start dovecot, do you see any errors? What does 'dovecot -n' return?
Title: Sieverules plugin
Post by: JohnDoh on November 25, 2009, 02:14:56 PM
Quote from: periferral;23274
when i add a new rule to filter by body, i get a message saying it is not supported by the server. im running dovecot 1.2.6 and managesieve server and it seems like filtering by body is supported. what gives?

there is a bug in how it writes the body rule. its fixed in the repo here: Commit 18155a8184960d9a4b023984143703e32f088589 to JohnDoh's RoundCube-Plugin-SieveRules-Managesieve - GitHub (http://github.com/JohnDoh/RoundCube-Plugin-SieveRules-Managesieve/commit/18155a8184960d9a4b023984143703e32f088589)

Just incase there is any confusing about the config variables mentioned in the previous post. They have changed between the last released version and the repo version to fit in better with improvemnts to the RC plugin API.
Title: Sieverules plugin
Post by: periferral on November 25, 2009, 06:45:07 PM
@johndoh. great. upgrading seems to have fixed the problem.

I have a couple of suggestions for this plugin if you would be so kind.

1. Currently the contents within div boxcontent have no margen and hence stick to the edges. Maybe a CSS addition of margin 15px all round would make this more attractive.

2. I quite like how the managesieve plugin (that is checked into roundcube) has the buttons on the top of the filters to add, delete, move up and move down. There are quite attactive rather than having the button below to add filters and the little up down arrows on the filter name and the delete is within the filter details.
   While this request is mostly for asthetic reasons, there is one functional element that is annoying in the current design. Lets say I want to move a filter up a few places. In the way it currently works, I select the filter I want to move and then press the up button. Now the rule has moved up, but I now need to move my mouse up to the new location to click the up button next to move it up again. By having the move up button outside, you just select the rule and click the move up button 3 times and its up 3 locations. No move moves required between moves. I hope this is clear.

3. This is something I'm not entirely sure how things work. If I select a non-default roundcube skin, it seems like I need to add stuff into plugins to add support for this. For example, I tried using mvision and I realized that mvision sources settings.css (when I click on the settings page) to get a consistent look between tabs etc. However, when I click the Filters tab, settings.css isn't sourced because it calls sieverules. I would have thought that roundcube should have sourced settings.css before handing in control to the plugin. But I don't know if there is a consitent rule. Again this is not something you need to do, but I'd like to know more about it.

I can code but php isn't something I'm comfortable with but let me know if you need any help with the plugins.
Title: Sieverules plugin
Post by: JohnDoh on November 26, 2009, 04:10:57 AM
Quote from: periferral;23347
1. Currently the contents within div boxcontent have no margen and hence stick to the edges. Maybe a CSS addition of margin 15px all round would make this more attractive.


I cannot see where exactly you are talking about. What browser are you talking about? Could you attach a screenshot please?

Quote from: periferral;23347
2. I quite like how the managesieve plugin (that is checked into roundcube) has the buttons on the top of the filters to add, delete, move up and move down. There are quite attactive rather than having the button below to add filters and the little up down arrows on the filter name and the delete is within the filter details.
   While this request is mostly for asthetic reasons, there is one functional element that is annoying in the current design. Lets say I want to move a filter up a few places. In the way it currently works, I select the filter I want to move and then press the up button. Now the rule has moved up, but I now need to move my mouse up to the new location to click the up button next to move it up again. By having the move up button outside, you just select the rule and click the move up button 3 times and its up 3 locations. No move moves required between moves. I hope this is clear.


I don't like the buttons at the top, its one of the reasons I made my own version so I wont be adding those. In my opinion the bottons at the top dont fit in with the style of the other settings tabs in the core. About the moving, you dont have to press the arrows, you can drag 'n drop.

Quote from: periferral;23347
3. This is something I'm not entirely sure how things work. If I select a non-default roundcube skin, it seems like I need to add stuff into plugins to add support for this. For example, I tried using mvision and I realized that mvision sources settings.css (when I click on the settings page) to get a consistent look between tabs etc. However, when I click the Filters tab, settings.css isn't sourced because it calls sieverules. I would have thought that roundcube should have sourced settings.css before handing in control to the plugin. But I don't know if there is a consitent rule. Again this is not something you need to do, but I'd like to know more about it.


The plugin was made for the default skin. The skin documentation is still being worked on so right now it is impossible to know what should always be in the skin and what should be in the plugin.
Title: Sieverules plugin
Post by: periferral on November 26, 2009, 11:38:38 AM
@johndoh
Here is the original screenshot
http://dl.dropbox.com/u/163717/roundcube/rcsieve_orig.jpg

Here is after I added this to the skins/default/sieverules.css file
Code: [Select]
.boxcontent {
  margin: 15px;
}
http://dl.dropbox.com/u/163717/roundcube/rcsieve_margin.jpg
Title: Sieverules plugin
Post by: JohnDoh on November 26, 2009, 12:10:33 PM
the boxcontent class is part of the default skin, it is setup in common.css. the sieverules screen will look the same as the settings screen. what browser are you using?

about the links: there is a link to my plugins page in the first post in this thread, and in my sig and on the RC plugins page. my page as links to the repos as well as the translator, screenshots, changelog etc. I am sorry you had to search for the files but I am not sure what more I can do.
Title: Sieverules plugin
Post by: periferral on November 26, 2009, 01:44:56 PM
@johndoh
I'm using firefox 3.5.5

When you say default skin, you mean default skin for sieverules? boxcontent isn't a part of roundcube. For exameple, when I click on the preference tab, I see that the contents are in a div called prefs-details which has a margin of 15px.

Seems like boxcontent is a part of the sieverules default skin and hence should be a part of sieverules.css.

I'm not sure if what you are saying is correct. Looking at the code for the plugin, I see this

plugins/sieverules/skins/default/templates/editsieverule.html:
Title: Sieverules plugin
Post by: periferral on November 26, 2009, 05:06:51 PM
i had the debian version of roundcube. I checked out trunk and the border padding is no longer an issue.
Title: Sieverules plugin
Post by: JohnDoh on November 27, 2009, 12:48:05 PM
There were some posts in this thread about connection issues with the managesieve plugin available in the RoundCube trunk. These posts have been moved to a new thread here http://www.roundcubeforum.net/api-based-plugins/5860-managesieve-connection-problems.html

I would like to keep the two seperate to minimse any confusion between these 2 plugins.
Title: vacation for alias adresses
Post by: kapeka on November 29, 2009, 04:54:26 PM
Hi;


I've managed to get sieverules working with a cyrus imap server, but still have a pb.

A vacation message for the real user (long.name@mydomain.net) is send in reply to the sender, as expected.
But it does not work with aliases (like short@mydomain.net, which is an alias user for long.name@mydomain.net).
I expected that the alias field for addresses while adding a vacation rule can be filled with alias addresses, but I can't edit that field.

Any hints other than the advanced editor to edit the sieve rules? I can do, but I'm afraid my users can't :)

TIA kp
Title: Sieverules plugin
Post by: JohnDoh on November 30, 2009, 02:53:23 PM
if you tick the "advanced options" box under the message box you can select aliases which should be used. the email address has to be one of your identies for it to show up in this list.
Title: Sieverules plugin
Post by: kapeka on November 30, 2009, 03:21:45 PM
Thx, adding an identity for (every) alias did the trick.
A solution that can be explained to users...

kapeka
Title: Sieverules plugin
Post by: Rando on November 30, 2009, 04:25:55 PM
Hi JohnDoh,
thanks again for this usefull plugin.

I wonder if there is an easy way to configure sieverules to add new filters at the top of the list ? or maybe only for vacation filters ?

Thanks !
R.
Title: Sieverules plugin
Post by: JohnDoh on December 01, 2009, 03:12:40 AM
you cant add rules to the top of the list but its really easy to change the order of rules by using the little arrow icons or drag 'n drop.
Title: Sieverules plugin
Post by: Rando on December 02, 2009, 04:01:55 AM
Hi,
it was to prevent people to keep in mind to do this part of the configuration, and only to add a configured vacation example filter.

R.
Title: error on edit rules
Post by: sergest on December 02, 2009, 02:35:45 PM
Hello.

When i try to edit existing sieve rule, i got this error?

Code: [Select]
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/stepkin.net/www/mail/program/include/session.inc on line 82
How to fix this?

i install last version of plugin from where (http://www.tehinterweb.co.uk/roundcube/plugins/sieverules.tar.gz) on clear roundcube installation.


Well. i found a troublemaker.
Then i write something in russian language —*i have this error. When i write only english — all seems OK.
Title: Sieverules plugin
Post by: periferral on December 12, 2009, 10:08:35 PM
for some reason, i can't get the rules to work when I want it parse based on 'from sender'

For example, i tried adding rules saying Sender contains amazon.com move it to a certain folder. But this does not work. It stays in my
inbox. I also tried modifying this to envelope from contains amazon.com and still the same.

Here is what gets written into the sieve file

# rule:[orders from]
elsif anyof (address :contains "Sender" "ebay.com",
        address :contains "Sender" "paypal.com",
        address :contains "Sender" "amazon.com")
{
        fileinto "Orders";
        stop;
}

any help is appreciated
Title: Sieverules plugin
Post by: JohnDoh on December 13, 2009, 04:44:06 AM
I think not all mail servers support the ‘Sender’ header, if you check the headers of the messages you are trying to filter is there a Sender in there? Try using ‘From’ instead of ‘Sender’. You can edit the rule manually or if you are using the latest version of the plugin then just add:

Code: [Select]

$rcmail_config['sieverules_default_headers'] = array('subject' => 'header::Subject',
'from' => 'address::From',
'to' => 'address::To',
'cc' => 'address::Cc',
'bcc' => 'address::Bcc',
'envelopeto' => 'envelope::To',
'envelopefrom' => 'envelope::From'
);


into your config and it will override the defaults. (if you are not using the latest version you need to edit the array at the top of sieverules.php)
Title: sieverules problems
Post by: avious on December 14, 2009, 12:51:11 AM
Hi guys and gals. I've got a problem I can't figure out. I've installed iredos 0.5 and got it working then I upgraded roundcubemail to 0.3.1 and it's working fine with spamassasin plugin, the context menu plugin, and the markasjunk2 plugin. I've been working for days now and I cannot figure out why the sieverules plugin is not working. I've configured the config.inc.php file for my server and added it to the main.inc.php file for roundcube and when I got to settings then filters tab I can make rules and delete them and it tells me the save completed successfully and I can even dig into the server filesystem and find the "roundcube" file it creates under the email address I'm using with the rules in it. But the thing is I can create a simple rule that says if any email contains testing in the subject then move it to the test folder and I save it and it saves correctly but the filter doesn't work. All emails with testing in the subject line that I've sent still show up in the inbox. I am using the sieverules plugin from this site: RoundCube Plugins and I just cannot find wht I'm doing wrong. I can provide any more info that may be needed, I would just greatly appreciate some help on this.
Title: Sieverules plugin
Post by: dennylin93 on December 28, 2009, 07:48:57 AM
Hi, I've been trying out this plugin, and I encountered a problem. I can't import the default rules for some reason.

I have:
Code: [Select]
$rcmail_config['sieverules_default_file'] = '/etc/dovecot/sieve/default';

The permissions should be correct:
Code: [Select]
[root@mail /etc/dovecot/sieve]# ll
total 4
-rw-r--r--  1 root  wheel  86 Dec 28 20:34 default
-rw-r--r--  1 root  wheel  86 Dec 28 20:34 example

Code: [Select]
[root@mail /etc/dovecot/sieve]# cat default
require ["fileinto"];

if header :contains "X-Spam-Flag" "YES" {
  fileinto "Junk";
}

I click yes when I'm prompted with "Would you like to use these filters?" A message appears saying that the filter was imported successfully, but when I open up the file, it's empty. I can add new rules, but the default one just won't get imported.

Can someone point me in the right direction? Thanks.
Title: Sieverules plugin
Post by: JohnDoh on December 31, 2009, 05:19:59 AM
I think the problem is that your default rule file is not in a format which the plugin understands. Try:
Code: [Select]
require [&quot;fileinto&quot;];

# rule:[Junk]
if header :contains &quot;X-Spam-Flag&quot; &quot;YES&quot; {
  fileinto &quot;Junk&quot;;
}


You need to add the # line with the name of the rule to what you had originally.
Title: Sieverules plugin
Post by: dennylin93 on December 31, 2009, 07:25:18 AM
Thanks. That fixed the problem.
Title: Sieverules plugin
Post by: adlerweb_ on January 14, 2010, 02:38:44 PM
Quote from: sergest;23566
When i try to edit existing sieve rule, i got this error?

Code: [Select]
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/stepkin.net/www/mail/program/include/session.inc on line 82


This seems to happen when special characters are used - i get the same problem with german umlauts (äöüß…) - the mentioned message is displayed and the users' session killed
Title: Sieverules plugin
Post by: JohnDoh on January 15, 2010, 03:31:32 AM
I cannot recreate this problem. could you give me some more info? may be an example rule file or a screen shot of what you have entered. also please provide some info about your environment... what version of rc are you running, what verstion of php etc.

also if you are not running the latest svn trunk version of rc it might be worth giving that a try just to make sure its not something in the core which has been fixed.

thanks
Title: Sieverules plugin
Post by: minusme on January 18, 2010, 02:30:40 PM
Hi all...

I've been reading through these posts and working on getting the sieverules plugin working for most of the morning and I've just about reached the end of my rope.

I would appreciate any suggestions on how to get it running.  Here are my details:

1) Using latest version of roundcube (downloaded a few days ago)
2) Using fedora 10, dovecot 1.1.20, dovecot sieve 1.1.20, dovecot-managesieve 1.1.20
3) Using latest version of managesieve plugin from authors site

4) Dovecot and roundcube are working fine, I can log in and check emails
5) Install of managesive plugin went fine
6) sieve directory is correctly created in user mail section, .dovecot.sieve is symlinked correctly to sieve/roundcube.sieve
7) I am able to add filters in roundcube and the correctly show up in sieve/roundcube.sieve
8) I have tested almost every filter option and none of them are actually forwarding correctly.
9) I have confirmed that 'localhost' is listening on port 2000 which is setup in plugin
10) Dovecot is otherwise working as expected

I have a couple of questions.

1) I use mbox instead of maildir (does that matter?)
2) I'm using aliases for login to roundcube (does that matter?)

Is there anything else I can try to make the filters take effect?

Thanks in advance.
Title: Sieverules plugin
Post by: JohnDoh on January 18, 2010, 02:59:02 PM
ok so first are you using the managesieve plugin or the sieverules plugin? although similar they are seperate plugins and so this is important.

it sounds like may be you have just missed something on your dovecot config so it isnt actuall reading the rule file, check in the instalation and configuration section here LDA/Sieve - Dovecot Wiki (http://wiki.dovecot.org/LDA/Sieve) and make sure you have got everything in your config you need.

as for your 2 questions, i dont think it makes any difference, both managesieve and your imap is run by dovecot so as long as that works it should be ok i think but i dont know alot about mbox you might be better off asking the dovecot community
Title: Sieverules plugin
Post by: adlerweb_ on January 18, 2010, 03:28:14 PM
hello

so first my system: rc is 0.3.1, php 5.2.12 (suhosin/eaccelerator)

the generated sieve was:
Code: [Select]
## Generated by RoundCube Webmail SieveRules Plugin ##
require [&quot;fileinto&quot;];

# rule:[test]
if anyof (header :contains &quot;Subject&quot; &quot;test&quot;)
{
        fileinto &quot;INBOX&quot;;
}
# rule:[test2]
elsif anyof (header :contains &quot;Subject&quot; &quot;t<C3><A4>st&quot;)
{
        fileinto &quot;INBOX&quot;;
}


looks for me like a utf8/escaping-problem - the second subject should be
"täst". Im trying to get a testsystem without suhosin/eaccelerator and
with rc-trunk up tomorrow and will check it again.
Title: Sieverules plugin
Post by: JohnDoh on January 19, 2010, 01:07:05 PM
i think the file is written in UTF8 without a BOM, check what encoding the progam you are using to read it is using.

a quick search suggests that may be its dovecot's sieve plugin which is at fault, what version are you using? I think cmu-sieve does not get along with UTF8 very well, or may be its only pre version 1.1 i'm not sure.

an easy test would be to manual create a rule file which you know has everything correctly encoded and see if it works that would help figure out where the problem is.
Title: Sieverules plugin
Post by: get.the.MaX on January 20, 2010, 04:54:19 PM
Rules from sieverules stored in
Code: [Select]
/home/vmail/domain.com/username/sieve

dovecot.conf
Code: [Select]
 
  sieve = ~/dovecot.sieve
  sieve_dir = ~/sieve


Now dovecot looks for dovecot.sieve in the users homefolder, but the sieverules is stored in homefolder/sieve.

Managesieve will automaticly set a sysmlink in homefolder
dovecot.sieve to sieve/roundcube.sieve. Sieverules dont do that, and that is my problem. Any suggestions?
Title: Sieverules plugin
Post by: JohnDoh on January 21, 2010, 06:52:28 AM
Could you tell me a little bit more about your setup please to help trace the problem?

If you have sieverules setup to use a single ruleset then that ruleset will be actiated when you press save, if you are using multiple rulesets then you need to press the activate button in the top right.

Could you tell me if you are using an existing ruleset which is not being activated or a new one? Also what version of dovecot sieve are you running?

thanks
Title: Sieverules plugin
Post by: get.the.MaX on January 21, 2010, 07:55:25 AM
Dovecot Version 1.2.7
Sieve Version Dovecot 1.2 Sieve 0.1.9

For testing i had only a single ruleset. This rule is saved to myhomefolder/sieve.
Now the only problem is, that sieverules dont set a link from the homefolder to sieve/roundcube.sieve.

In my dovecot.conf i have to set:
Code: [Select]

  ### Sieve per User ###
  sieve = ~/dovecot.sieve #The location of the user's active script:

   # directory.
  sieve_dir = ~/sieve #The include extension fetches the :personal scripts from this
   # directory.


Code: [Select]

protocol lda {
..
  mail_plugins = sieve
}
Title: Sieverules plugin
Post by: JohnDoh on January 21, 2010, 08:06:56 AM
sorry to ask you to repeat yourself again but when you said "Managesieve will automaticly set a sysmlink in homefolder" where you talking about dovecot managesieve or the rc plugin called manage sieve.

In the sections you posted from your config above the frist one is in plugin { } section correct?

if you were not talking about the other rc plugin earlier then please do one other quick test, try hard codiging this path  sieve = ~/dovecot.sieve #The location of the user's active script just to make sure there isnt some problem with diecting the home dir.
Title: Sieverules plugin
Post by: get.the.MaX on January 21, 2010, 09:22:18 AM
Yes the roundcubeplugin sets the link, not dovecots managesieve.

Code: [Select]

sieve = ~/sieve/roundcube.sieve


When you click on filters in roundcube, there is a loop. Here is the error from mail.log

Code: [Select]

sieve-storage: Active sieve script symlink /home/vmail/example.com/max/sieve/roundcube.sieve is no symlink.
Title: Per user filtering
Post by: pela020 on January 22, 2010, 08:27:52 AM
I'm running dovecot IMAP with virtual domains and users.

I got sieverules working on a domain level but I just can't figure out how to make it work per user. When I log in as one user I can make filters and they will work just fine.

The problem is when I log in as another user on the same virtual domain i see the same set of rules and can change them. Does anyone ever had a similar problem?

Roundcube 0.3.1-20091031
Dovecot 1.1.11
Sieverules 1.5

Here is my output from dovecot -n if anybody can se a problem there.

# 1.1.11: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.31-17-generic-pae i686 Ubuntu 9.10 ext4
base_dir: /var/run/dovecot/
log_path: /var/log/dovecot
info_log_path: /var/log/dovecot-info.log
log_timestamp: %Y-%m-%d %H:%M:%S
protocols: imap pop3 imaps pop3s managesieve
ssl_cert_file: /etc/ssl/smtpd.crt
ssl_key_file: /etc/ssl/smtpd.key
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(pop3): /usr/lib/dovecot/pop3-login
login_executable(managesieve): /usr/lib/dovecot/managesieve-login
valid_chroot_dirs: /var/spool/vmail
mail_location: maildir:/home/vmail/%d/%n
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
mail_executable(managesieve): /usr/lib/dovecot/managesieve
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3
mail_plugin_dir(managesieve): /usr/lib/dovecot/modules/managesieve
sieve_storage(default):
sieve_storage(imap):
sieve_storage(pop3):
sieve_storage(managesieve): ~/sieve
sieve(default):
sieve(imap):
sieve(pop3):
sieve(managesieve): ~/.dovecot.sieve
auth default:
  mechanisms: plain login
  verbose: yes
  passdb:
    driver: passwd-file
    args: /etc/dovecot/passwd
  userdb:
    driver: passwd-file
    args: /etc/dovecot/users
  socket:
    type: listen
    client:
      path: /var/spool/postfix/private/auth
      mode: 432
      user: postfix
      group: postfix
    master:
      path: /var/run/dovecot/auth-master
      mode: 384
      user: vmail
      group: vmail
plugin:
  sieve: ~/.dovecot.sieve
  sieve_dir: ~/sieve
Title: Per user filtering
Post by: pela020 on January 22, 2010, 08:29:09 AM
I'm running dovecot IMAP with virtual domains and users.

I got sieverules working on a domain level but I just can't figure out how to make it work per user. When I log in as one user I can make filters and they will work just fine.

The problem is when I log in as another user on the same virtual domain i see the same set of rules and can change them. Does anyone ever had a similar problem?

Roundcube 0.3.1-20091031
Dovecot 1.1.11
Sieverules 1.5

Here is my output from dovecot -n if anybody can se a problem there.

Code: [Select]
# 1.1.11: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.31-17-generic-pae i686 Ubuntu 9.10 ext4
base_dir: /var/run/dovecot/
log_path: /var/log/dovecot
info_log_path: /var/log/dovecot-info.log
log_timestamp: %Y-%m-%d %H:%M:%S
protocols: imap pop3 imaps pop3s managesieve
ssl_cert_file: /etc/ssl/smtpd.crt
ssl_key_file: /etc/ssl/smtpd.key
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(pop3): /usr/lib/dovecot/pop3-login
login_executable(managesieve): /usr/lib/dovecot/managesieve-login
valid_chroot_dirs: /var/spool/vmail
mail_location: maildir:/home/vmail/%d/%n
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
mail_executable(managesieve): /usr/lib/dovecot/managesieve
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3
mail_plugin_dir(managesieve): /usr/lib/dovecot/modules/managesieve
sieve_storage(default):
sieve_storage(imap):
sieve_storage(pop3):
sieve_storage(managesieve): ~/sieve
sieve(default):
sieve(imap):
sieve(pop3):
sieve(managesieve): ~/.dovecot.sieve
auth default:
  mechanisms: plain login
  verbose: yes
  passdb:
    driver: passwd-file
    args: /etc/dovecot/passwd
  userdb:
    driver: passwd-file
    args: /etc/dovecot/users
  socket:
    type: listen
    client:
      path: /var/spool/postfix/private/auth
      mode: 432
      user: postfix
      group: postfix
    master:
      path: /var/run/dovecot/auth-master
      mode: 384
      user: vmail
      group: vmail
plugin:
  sieve: ~/.dovecot.sieve
  sieve_dir: ~/sieve
Title: Sieverules plugin
Post by: internalkernel on January 22, 2010, 09:16:32 AM
I just got all this installed and configured... and having a slight problem getting the rules to "stick".

They seem to work fine, according to testing I did to make sure the headers information was working - i.e filter according to sender, recipient, copy, etc.

However, when I make the filters... sometimes it works and sometimes it doesn't. I have a large amount of filter criteria for a certain folder, maybe 20 criteria (for mailing lists). I'll got through and enter each criteria, select the destination folder and hit save... it reports filter saved. Then on a refresh, the filter is either gone or empty.

Looking in the %u/sieve/roundcube.sieve file, I see part of the filter has been saved. It seems to only record about 12 to 13 of the entries, and misses the fileinto directive.

This is dovecot 1.1.11, ubuntu 9.10, rcube 0.3.1 - latest download of sieverules

I was also looking at trying to enable the ingo filter importer, but I didn't see the option for it. I have a working Ingo installation side by side with this (trying to migrate to Rcube as I think it will be easier on my users). If you want any help testing that, I'd be happy to work with it. My php kung-fu is not exactly street worthy though...

Thanks for the work!

After working with this some more... 12 is the magic number... once more than 12 entries are made, the filter rule is created but it cuts off the fileinto directive. As an aside, I can directly edit the file and add the extra rule criteria after which it will show up in rcube properly.
Title: Sieverules plugin
Post by: adlerweb_ on January 22, 2010, 12:05:17 PM
OK, i think i found the bug…

Before roundcube r731 (think release 0.1-r1) it used ASCII as default character encoding for its session-table. It was changed (bug #1484456) but they only updated the initial SQL, the update.sql does not contain any conversion. As long as you don't disable caching the plugin will save rules inside the session - if there any UTF8-Chars the SQL-query breaks and rc killes the session.

Quick and dirty fix:
Code: [Select]
ALTER TABLE `session`  ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
ALTER TABLE `session` CHANGE `sess_id` `sess_id` VARCHAR( 40 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
CHANGE `ip` `ip` VARCHAR( 15 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
CHANGE `vars` `vars` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL


If you have a database that was created with a early rc-version you should recreate all tables - there are more changes that are not inside the update.sql (e.g. MyISAM -> InnoDB)
Title: Sieverules plugin
Post by: JohnDoh on January 23, 2010, 10:41:56 AM
pela020: if you are using the repo version go into rcube_sieve.php and set $cache to false on line 37 and then try again, may be the cache doesnt work right. if that doesnt work then check your dovecot config and where the sieve files are acually being written on the server, make sure they are not all in the same place.

internalkernel: i have setup a rule with 20 tests and then a fileinto and it saves just fine. could you post an example of one which doesnt work for you please?
Title: Sieverules plugin
Post by: pela020 on January 23, 2010, 10:52:47 AM
Quote from: JohnDoh;24801
pela020: if you are using the repo version go into rcube_sieve.php and set $cache to false on line 37 and then try again, may be the cache doesnt work right. if that doesnt work then check your dovecot config and where the sieve files are acually being written on the server, make sure they are not all in the same place.

There's a symlink in /home/vmail/domain

Code: [Select]
.dovecot.sieve -> sieve/roundcube.sieve
I've changed the cache value to false but it doesn't do anything different what i can see. It still writes the filters in the same file for all users
Title: Sieverules plugin
Post by: JohnDoh on January 23, 2010, 11:29:36 AM
looks like your dovecot config is wrong then the symlink should be in the user's directry along with a dir containing the sieve files.
Title: Sieverules plugin
Post by: internalkernel on January 23, 2010, 11:38:55 AM
Quote from: JohnDoh;24801
internalkernel: i have setup a rule with 20 tests and then a fileinto and it saves just fine. could you post an example of one which doesnt work for you please?

As you request... I have attached a screenshot of the rule set I attempted to make, and the result after hitting save... as well as the code produced in roundcube.sieve.

I've made no changes in the sieverules folder (aside from copying config.inc.php.dist to config.inc.php).

~~
I ended up resolving my issue with it, in part by figuring out the "List-ID" header and splitting the rules into different entries.
~~
I just came across this entry in my logcheck files, seems to coordinate with the time I tried to save the filters:

Code: [Select]
line has bad date <[Sat Jan 23 11:24:42 2010] [error] [client xxx.xxx.xxx.xxx] ALERT - configured POST variable limit exceeded - dropped variable '_advoperator[]' (attacker 'xxx.xxx.xxx.xxx', file '/var/www/roundcube/index.php'), referer: https://my.domain.com/?_task=settings&_action=plugin.sieverules.add&_framed=1>
Title: Sieverules plugin
Post by: pela020 on January 23, 2010, 01:39:25 PM
Quote from: JohnDoh;24803
looks like your dovecot config is wrong then the symlink should be in the user's directry along with a dir containing the sieve files.


Yes, that did the trick.
I changed from
Code: [Select]
sieve=~/.dovecot.sieve to
sieve=/home/vmail/%d/%n/.dovecot.sieve
in the dovecot config :D
Thank you for pointing me in the right direction.
Title: problems with regular expressions (replacement of slashes)
Post by: user20100124 on January 24, 2010, 03:37:08 AM
In SieveRules regular expressions do not seem to be 100% working ... like "\" should be "\\" in the dovecot.sieve file. Is anybody facing similar problems?


version information:

Dovecot: 1.2.9
RoundCube: 0.3.1
SieveRules: 1.5
Title: Sieverules plugin
Post by: JohnDoh on January 24, 2010, 04:45:51 AM
internalkernel and pela020 glad you got your problems sorted

user20100124: there is nothing done to what you enter in the UI, if you want to escape a character you have to do it yourself. altering a test string behind the scenes seems a little dangerous to me, for example how would I knoww when you want \\n or \n?
Title: Sieverules plugin
Post by: user20100124 on January 24, 2010, 05:47:54 AM
Example of a dovecot.sieve file:

------------------------------ snip ------------------------------
require ["regex"];

if allof (header :contains ["to", "cc"] "centos-announce@centos.org",
        header :regex "Subject" "^\\[CentOS-announce\\] .* CentOS (2|3|4) .*")
{
        discard;
        stop;
}
------------------------------ snip ------------------------------

When loading a file like this one in the frontend i get the (correct) single slash I want ... saving is however not possible since there is a missing slash. If I use the advanced editor this is of course possible to fix ...


edit: i have *lots* of rules with regex and it does not only break the current one you are working at.
Title: Sieverules plugin
Post by: JohnDoh on January 24, 2010, 06:55:20 AM
ahh i see. check out the latest change in the repo. it should fix the disapearing slash.
Title: Sieverules plugin
Post by: user20100124 on January 24, 2010, 11:35:36 AM
The disappearing slash fix works fine - thanks. I found another bug:

With imapflags when editing a saved rule, the filter action "Mark message as" is not preselected (it's always Move message to, which is the first one).
Title: Sieverules plugin
Post by: JohnDoh on January 24, 2010, 01:56:20 PM
i cant recreate the problem with imapflags. make sure in your config you have imapflags set to true in sieverules_allowed_actions.
Title: Sieverules plugin
Post by: user20100124 on January 24, 2010, 02:07:11 PM
The action is enabled (I created the rule with sieverules):

------------------------------ snip ------------------------------
...
$rcmail_config['sieverules_allowed_actions'] = array(
   'fileinto' => TRUE,
   'vacation' => TRUE,
   'reject' => FALSE,
   'redirect' => FALSE,
   'keep' => TRUE,
   'discard' => TRUE,
   'imapflags' => TRUE,
   'notify' => FALSE,
   'stop' => TRUE
   );
...
------------------------------ snip ------------------------------

And a example file looks like this:

------------------------------ snip ------------------------------
## Generated by RoundCube Webmail SieveRules Plugin ##
require ["fileinto","imap4flags"];

# rule:[foo]
if allof (header :contains "X-List" "foo")
{
        fileinto "INBOX.foo";
        setflag "\\Seen";
        stop;
}
------------------------------ snip ------------------------------
Title: Sieverules plugin
Post by: JohnDoh on January 25, 2010, 03:07:16 PM
thanks for the examples. I have tied them with both the repo and released versions of the plugin and i cannot see any problem. sorry but i dont know what else to tell you.
Title: Buggy escaping of comparators?
Post by: bjoh on February 06, 2010, 04:57:41 PM
I just recently installed your sieverules plugin and like it very much, so thanks a lot for it!

That said, I think I found a bug in the recent version (from 2010/01/29).

When I configure a new Spam rule in roundcube that tests if X-Spam-Score is >= 10, the following file is generated and then saved by the managesieve daemon:
Code: [Select]
## Generated by RoundCube Webmail SieveRules Plugin ##
require [&quot;relational&quot;,&quot;comparator-i;ascii-numeric&quot;];

# rule:[Spam]
if anyof (header :value \&quot;ge\&quot; :comparator &quot;i;ascii-numeric&quot; &quot;X-Spam-Score&quot; &quot;10&quot;)
{
discard;
}


Notice the escaped \"ge\" comparator.
sievec throws an error when trying to compile the script, and sieverules itself seems not to be able to re-import the rule, as it just disappears when the Filters screen is reloaded.

The same happens with the "gt" comparator, possibly also others.

Can you reproduce this and if yes, could you tell me where to fix it?

Thank you!
Title: Sieverules plugin
Post by: JohnDoh on February 07, 2010, 06:02:41 AM
I can't reproduce it. It could be something to do with your PHP settings.

The values for the operators dropdown should be htmlencoded so lets check they are. Please goto the new/edit rule screen and view the source, search for `value &` and you should find them all, if you dont try searching for `value "` and see if that finds them.

If that is ok then double check you have magic_quotes_gpc turned off in your php config (should be done by default in the .htaccess file in the rc root).
Title: Sieverules plugin
Post by: bjoh on February 07, 2010, 12:25:30 PM
Quote from: JohnDoh;25274

If that is ok then double check you have magic_quotes_gpc turned off in your php config (should be done by default in the .htaccess file in the rc root).


That was it - magic_quotes_gpc was turned on in apache2's php.ini. Now it works like a charm.

Thank you for your quick help!
Title: Sieverules plugin
Post by: Granada on February 12, 2010, 05:52:16 AM
Sieverules works quite fine, but I found an annoying misfeature in NetSieve.php. I know, this is not the sieverules author's concern, but maybe someone has a solution to it. We currently have three frontend machines handling the mailaccounts and NetSieve needs to follow the referrals it gets to e.g. mail1.server.net or mail2.server.net to login to the timsieved. Giving it the correct loginserver by hand it works perfectly, but otherwise I get the following error in the log:

Code: [Select]
[12-Feb-2010 11:10:22] Connection timed out (145):
[12-Feb-2010 11:10:22] Can't follow referral to mail2, The error was= Connection timed out (5):


google has only one answer that is not only five years old but also long solved inside NetSieve.php. But that did not fix my problem. Did any of you ran into this problem and could give me a hint?

Kind regards
Ruediger
Title: Sieverules plugin
Post by: JohnDoh on February 13, 2010, 04:18:38 AM
I'm not sure if it helps but since version 1.2 you can use %h instead of an actual hostname and then what ever imap host RC is connected too will be used.
Title: Sieverules plugin
Post by: Granada on February 15, 2010, 07:49:22 AM
setting "sieverules_host" to %h does not solve the problem. But I got somewhat closer to a solution: editing Net_Sieve.php and inserting three new lines at the start of authPLAIN() makes it work:

Code: [Select]

    function _authPLAIN($user, $pass , $euser )
    {
        $this->_data['user']=$user;
        $this->_data['pass']=$pass;
        $this->_data['port']='2004';
        if ($euser != '') {
            $cmd=sprintf('AUTHENTICATE &quot;PLAIN&quot; &quot;%s&quot;', base64_encode($euser . chr(0) . $user . chr(0) . $pass ) ) ;
        } else {
            $cmd=sprintf('AUTHENTICATE &quot;PLAIN&quot; &quot;%s&quot;', base64_encode( chr(0) . $user . chr(0) . $pass ) );
        }
        return  $this->_sendCmd( $cmd ) ;
    }


This is the whole function authPLAIN(). The three new lines are the definitions of the array $this->_data[] with $user, $pass and port 2004. The problem seems to be that the first call of sendCmd is done with $user, $pass, $port and so on, but the second one when following the given referral (inside the function doCmd() ) it uses $this->data['host'], $this->data['user'] and so on. This array is unset at that very moment, so the connect fails.

It seems to be a bug in Net_Sieve.php that has never been discovered before since noone used the script to connect to a referred host. Maybe this once worked with PHP 4 when more global variable definitions were still common.

Kind regards
Ruediger
Title: Sieverules plugin
Post by: JohnDoh on February 15, 2010, 02:12:25 PM
I dont really want to branch from the stable version of Net:Sieve, i suggest you open a bug report here Net_Sieve (http://pear.php.net/package/Net_Sieve)
Title: Sieverules plugin
Post by: zelegolas on February 19, 2010, 09:25:43 AM
Hi

I installed sieverules plugin with RoundCube.
I can put some some rules but none of them are executed. :confused:

I have scrupulously followed the instructions in the README file as well as those provided in the wiki dovecot and sieve.

Someone has already had such problems?
Title: Sieverules plugin
Post by: JohnDoh on February 19, 2010, 11:53:51 AM
If the plugin is working, reading and writing rules then it sounds like a problem in your dovecot config. I think you might be better off talking to the dovecot guys they probably be able to tell you whats wrong quicker.
Title: Sieverules plugin
Post by: fritz001 on February 19, 2010, 01:56:50 PM
I have a working installation of Qmail+dovecot 1.2.10+sieve plugin+manage sieve, and everything is working fine so far.
Title: Sieverules plugin
Post by: zelegolas on February 21, 2010, 06:02:05 PM
Quote from: JohnDoh;25648
If the plugin is working, reading and writing rules then it sounds like a problem in your dovecot config. I think you might be better off talking to the dovecot guys they probably be able to tell you whats wrong quicker.


ok thanks JohnDoh
I will check with them
Title: Vacation :from "address"
Post by: PetePann on February 24, 2010, 10:05:03 AM
Hello,

Appears all is working well with the Sieverules plugin except I can not for the life of me figure out how to add a :from "address" to a Vacation rule.

The front end UI displays Aliases, Days, Subject, etc... for Vacation rule creation, however, it doesn't display an option to select a From address.

It appears the code is written in rcube_sieve_script.php and sieverules.php to support the submission and creation of a :from address, however, I just don't see the option in the UI for adding one.

Any thoughts ?!?
Title: Sieverules plugin
Post by: PetePann on February 24, 2010, 11:34:41 AM
Quote from: PetePann;25786

...
I can not for the life of me figure out how to add a :from "address" to a Vacation rule.
...


FWIW, changing line 1590 in sieverules.php from:
Code: [Select]
$vacs_table->set_row_attribs(array('class' => 'disabled', 'style' => 'display: none'));

to:
Code: [Select]
$vacs_table->set_row_attribs(array('class' => 'advanced', 'style' => $vacadvstyle));

appears to do the trick.
Title: Sieverules plugin
Post by: JohnDoh on February 24, 2010, 01:27:59 PM
yep that sounds about right, its a little lower down in the latest version. its disabled by default coz not all servers support it and there is no way to detect if they do or not. just out of interest what imap server are you using?
Title: Sieverules plugin
Post by: PetePann on February 24, 2010, 02:23:39 PM
Quote from: JohnDoh;25793
just out of interest what imap server are you using?



  Using Dovecot.  And thanks for your contributions to the SieveRules plugin ... makes mail administrators and their users quite happy :)
Title: array_merge problem
Post by: mstar on March 01, 2010, 08:58:40 AM
HI Folks,

I always get logged out after klicking the first time on the filter tab. This is what I found in logfile of apache:
--
Code: [Select]

01 12:32:54 2010] [error] [client 192.168.64.1] PHP Warning:  array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #1 is not an array in /workdir/confspace/webmail/program/include/session.inc on line 82

--

What can I do against this - I want to use your perfect plugin!

Cheers
Title: Sieverules plugin
Post by: mstar on March 01, 2010, 10:05:47 AM
Hi,

found by myself: :-)))

Code: [Select]
rcube_sess_serialize(array_merge((array)$a_oldvars, (array)rcube_sess_unserialize($vars)))


Please file a bug for me and change this. Here the info from php:

PHP: array_merge - Manual (http://php.net/manual/en/function.array-merge.php)

Thanks & Regards
Title: Problem with the display
Post by: mstar on March 02, 2010, 04:29:22 PM
Hi,

I have tested sieverules with IE8 and Firefox and I have several problems. Please view the attached pictures.

When I add a filter and click on save the filter is not displayed in the left panel. When I delete a filter, the entire screen is displayed in the right box. It's slightly better in Mozilla but also there not perfect. Specially the filter panel on the left side is often not updated correctly. do we have a apache or php problem?! Has anybody an idea how to solve this?!

Thanks & Regards,

mstar
Title: Sieverules plugin
Post by: JohnDoh on March 03, 2010, 02:47:23 AM
mstar: the issue with the session has been dicussed before, see here for the solution http://www.roundcubeforum.net/7-third-party-contributions/46-api-based-plugins/4878-sieverules-plugin-15.html#post24784. about the display, may be its casued by the errors, or could there be a caching problem (did you have a previous version of the plugin installed?) what version of rc are you using? what version of the plugin? and what version of php? I can see from the screenshots that there are some JS errors, could you tell us what they are please?
Title: Sieverules plugin
Post by: mstar on March 03, 2010, 04:58:36 AM
Hi,
this is the message:

Code: [Select]
 'null' is Null or no Objekt  sieverules.js?s=1267551002, line 679 char 4

Thanks :)
Title: Sieverules plugin
Post by: zelegolas on March 04, 2010, 08:16:34 AM
Quote from: JohnDoh;25648
If the plugin is working, reading and writing rules then it sounds like a problem in your dovecot config. I think you might be better off talking to the dovecot guys they probably be able to tell you whats wrong quicker.


It's working now.
For that I had to configure Sieverules plugin, Dovecot and Postfix and it was not obvious at all :(
Title: Sieverules plugin
Post by: dtchky on March 04, 2010, 11:03:49 PM
Quote from: zelegolas;25975
It's working now.
For that I had to configure Sieverules plugin, Dovecot and Postfix and it was not obvious at all :(


I don't suppose you care to tell us what you did to correct this at all?

I have the same problem.
Title: Sieverules plugin
Post by: jdrachenfels on April 07, 2010, 01:18:54 PM
Hi,

I have installed the plugin directly from github:
---
author PhilW
 Tue, 6 Apr 2010 07:28:57 +0000 (08:28 +0100)
committer PhilW
 Tue, 6 Apr 2010 07:28:57 +0000 (08:28 +0100)
---

but now I receive an error:

[07-Apr-2010 18:22:02] PHP Fatal error:  Call to a member function connect() on a non-object in /workdir/confspace/webmail/program/include/rcmail.php on line 408

whenever I click on "new filter". What did I wrong?!

Thanks & Regards,

Johannes
Title: Sieverules plugin
Post by: JohnDoh on April 07, 2010, 02:39:27 PM
what version of RC are you using? development version of the plugin requires svn trunk verion of rc.
Title: Filters not working
Post by: vimalkumar on April 08, 2010, 01:27:48 AM
Hello sir,
    I'm using Exim 4.x server and the managesieve is not working for me. I would like to implement Filters. Please help me regarding this. I installed roundcube 0.3.1
Title: Sieverules plugin
Post by: jdrachenfels on April 08, 2010, 04:53:49 AM
Quote from: JohnDoh;26662
what version of RC are you using? development version of the plugin requires svn trunk verion of rc.


Hi,

done - and the error is gone! But now I have another problem:

After adding a new filter the list on the left hand sidebar is not updated until we reload the entire page!

After deleting of one filter the entire page is shown cascaded in the right hand frame.

Please see the pictures from mstar some days ago in this thread regarding this problem. We are testing with ie7, ie8 and firefox.

Thanks for fast help - if you can make it happen we would like to donate... how?!

Cheers,

Johannes :-)
Title: Sieverules plugin
Post by: jdrachenfels on April 08, 2010, 05:13:14 AM
Hi,

we did some more testings and found the following:

When testing with Firefox - everything is perfect!

When testing with browser IE7 (document standards...) we get the problem
   

Meldung: 'null' ist Null oder kein Objekt
Zeile: 679
Zeichen: 4
Code: 0
URI: http://xx.xx.xx.xx/webmail/plugins/sieverules/sieverules.js?s=1270656105



When testing with browser IE8 - everything is perfect!

Thanks for fast help!

Johannes

Quote from: jdrachenfels;26683
Hi,

done - and the error is gone! But now I have another problem:

After adding a new filter the list on the left hand sidebar is not updated until we reload the entire page!

After deleting of one filter the entire page is shown cascaded in the right hand frame.

Please see the pictures from mstar some days ago in this thread regarding this problem. We are testing with ie7, ie8 and firefox.

Thanks for fast help - if you can make it happen we would like to donate... how?!

Cheers,

Johannes :-)
Title: Sieverules plugin
Post by: jdrachenfels on April 09, 2010, 04:50:23 AM
Hi John Doh,

thanks for solving our issue so fast! Please let me know howto donate :-)

But we found another issue. When you do the following you will reproduce errors:

1.) Klick on "New Filter"
2.) Klick on any "MoveUp" or "MoveDown" link in the left hand list of filters
3.) See the java script erros:

Code: [Select]
Details zum Fehler auf der Webseite

Benutzer-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Zeitstempel: Fri, 9 Apr 2010 08:48:39 UTC


Meldung: 'this.rows[...].obj' ist Null oder kein Objekt
Zeile: 640
Zeichen: 5
Code: 0
URI: http://johannes.intern.drachenfels.de/webmail/program/js/list.js?s=1270708941


Meldung: 'this.rows[...].obj' ist Null oder kein Objekt
Zeile: 640
Zeichen: 5
Code: 0
URI: http://johannes.intern.drachenfels.de/webmail/program/js/list.js?s=1270708941


Meldung: 'this.rows[...].obj' ist Null oder kein Objekt
Zeile: 640
Zeichen: 5
Code: 0
URI: http://johannes.intern.drachenfels.de/webmail/program/js/list.js?s=1270708941



Hope this helps!

Thanks again,

Johannes
Title: Sieverules plugin
Post by: JohnDoh on April 09, 2010, 07:59:44 AM
yea, i know its not quite fixed yet, hopefully i will have some time to sort it over the weekend. thanks for the errors though, i will make sure to fix that too.

EDIT: All the JS problems should be fixed in the repo now
Title: Sieverules plugin
Post by: Rando on April 14, 2010, 05:30:29 AM
Hi John Doh,
do you plan to implement the currentdate filter type into sieverules (with a datepicker) ?
for vacation filters, for example :
Code: [Select]
require [&quot;date&quot;, &quot;relational&quot;, &quot;vacation&quot;];
if allof (currentdate :value &quot;ge&quot; &quot;date&quot; &quot;2010-04-18&quot;,
 currentdate :value &quot;le&quot; &quot;date&quot; &quot;2010-04-22&quot;)
{
vacation
:days 7
:addresses [&quot;test@test.fr&quot;]
:subject &quot;Out of office&quot;
&quot;vacation message&quot;;
}


Cheers,
R.
Title: Sieverules plugin
Post by: JohnDoh on April 14, 2010, 03:39:38 PM
I'll put the date extension on the todo list!
Title: Sieverules plugin
Post by: Rando on April 15, 2010, 04:55:48 AM
thank you :)
Title: Sieverules plugin
Post by: kir on April 16, 2010, 05:05:48 AM
I have some bugs to report.

1) When specifying a regex for a rule, if the regex includes a " character, it's not saved correctly and log shows:
Code: [Select]
PHP Warning:  htmlspecialchars() expects parameter 1 to be string, array given in xxxx/plugins/sieverules/sieverules.php on line 1202
I am trying to filter messages with exe attachments, using a regex like this: filename=".*?\.exe" Is this the best way to filter for attachments?

2) In the vacation settings, when a charset is chosen other than UTF-8, umlauts in the vacation message do not display correctly.
Title: Sieverules plugin
Post by: JohnDoh on April 17, 2010, 03:43:32 AM
Quote from: kir;26832
I have some bugs to report.

1) When specifying a regex for a rule, if the regex includes a " character, it's not saved correctly and log shows:
Code: [Select]
PHP Warning:  htmlspecialchars() expects parameter 1 to be string, array given in xxxx/plugins/sieverules/sieverules.php on line 1202


fixed in the repo

Quote from: kir;26832
I am trying to filter messages with exe attachments, using a regex like this: filename=.*?\.exe" Is this the best way to filter for attachments?


I'm not sure, a little searching suggests your server needs to support the body or x_body extension and then you can use a regex to find the name and filter on it. Re: filter attachments with sieve - msg#00012 - ietf.mta-filters (http://osdir.com/ml/ietf.mta-filters/2002-05/msg00012.html)

[QUOTE="kir;26832]2) In the vacation settings, when a charset is chosen other than UTF-8, umlauts in the vacation message do not display correctly.[/QUOTE]

The charset is an advanced option for users who want to use a different one from normal, UTF-8, if a differen't one doesnt work then dont change it. This is something handeled by the server, my plugin just rights the files it has no affect on what the server does with them.
Title: Sieverules plugin
Post by: bjorntj on April 20, 2010, 04:06:31 PM
I am trying to use this sieve plugin but can't seem to make it work... I have been using Horde and Ingo sieve module before and want to import my Ingo sieve rules... But when I go to the filter tab, I don't get asked if I want to import my old rules, as it looks like I should be...

What am I missing?


Edit: I updated to the latest version in Git and now it runs better... But a lot of rules are missing from the gui... But what's strange, is that when I see in the roundcube.sieve file, all my rules seems to be there but they are just not all displayed on the gui?
Also, nothing happens when I click on a rule in the gui, except for that the whole roundcube webapp seems to lock up....


Regards,

BTJ
Title: Sieverules plugin
Post by: JohnDoh on April 21, 2010, 02:30:32 AM
Quote
Edit: I updated to the latest version in Git and now it runs better... But a lot of rules are missing from the gui... But what's strange, is that when I see in the roundcube.sieve file, all my rules seems to be there but they are just not all displayed on the gui?
Also, nothing happens when I click on a rule in the gui, except for that the whole roundcube webapp seems to lock up....

could you post your rule file?
Title: Sieverules plugin
Post by: bjorntj on April 21, 2010, 02:33:18 AM
Which one, the ingo one or the new roundcube one?


BTJ
Title: Sieverules plugin
Post by: JohnDoh on April 21, 2010, 02:46:36 AM
the rc one please
Title: Sieverules plugin
Post by: bjorntj on April 21, 2010, 02:53:19 AM
Here you go....

BTJ
Title: Sieverules plugin
Post by: JohnDoh on April 21, 2010, 03:11:27 AM
thanks. the culprit is the `address :all`, sieverules doesn't understand the :all. If you go through the file manually and take that out (so you just have `address :contains ....`) then the rules will be visible in the plugin and my understanding is that :all is the default behaviour so it shouldnt effect what the filters do.
Title: Sieverules plugin
Post by: bjorntj on April 21, 2010, 03:41:53 AM
Ok, now all the rules are displaying to the left... But still nothing happends when I click on rules... It says loading in the browser but the content portion is just empty?
 
And whatever I click after clicking a rule, nothing happens... I have to refresh the url without the sieve part to make roundcube work again...

BTJ
Title: Sieverules plugin
Post by: JohnDoh on April 21, 2010, 05:56:34 AM
you said you were using the repo version of the plugin, what version of RC are you using? the repo version will probably only work right with the svn trunk version of RC, or 0.4b which should be out shortly
Title: Sieverules plugin
Post by: bjorntj on April 21, 2010, 06:22:56 AM
I am using the released version of RC, 0.3.1 so I guess that's the reason.... But when I use the released version of sieverules plugin, if I click preferences after looking at a rule, I always get kicked out and have to login again... Is this a known problem?

BTJ
Title: Sieverules plugin
Post by: bjorntj on April 21, 2010, 06:34:39 AM
Btw, how stable is the svn version of RC, is it ok to use?

BTJ
Title: Sieverules plugin
Post by: JohnDoh on April 21, 2010, 09:29:34 AM
Quote
I am using the released version of RC, 0.3.1 so I guess that's the reason.... But when I use the released version of sieverules plugin, if I click preferences after looking at a rule, I always get kicked out and have to login again... Is this a known problem?

need a little more to go on than that, it could be a known bug - if you look in [rc root]/logs/errors is there anything about the session? if so then you need to make sure the tables in your database are set to UTF8

Quote
Btw, how stable is the svn version of RC, is it ok to use?

that depends what you are using it for in a full production environment its prolly not what you want but if its just for your use and you dont mind updating regularly then it would be ok. on a side note 0.4b will be realsed this week i think
Title: Sieverules plugin
Post by: bjorntj on April 21, 2010, 09:35:03 AM
Nothing in the error log about session, but my PostgreSQL tables are not using UTF-8, they are using ISO-8859-1, is that a problem?

BTJ
Title: Sieverules plugin
Post by: JohnDoh on April 21, 2010, 09:46:57 AM
i dont know about postgresql, i know in mysql it should be UTF8 its in sql scritps for RC. you could also try looking in rcube_sieve.php in the plugin folder and setting private $cache = true; to false near the top and see if that make any difference, if it doesnt than you are talking about a different, unknown bug.
Title: Sieverules plugin
Post by: bjorntj on April 21, 2010, 09:53:47 AM
Setting private cache = false solved it... Thx... :)

BTJ
Title: Sieverules plugin
Post by: JohnDoh on April 24, 2010, 04:39:39 AM
Rando: I have added the basics for creating rules using the date extension and the currentdate operator to the repo version of the plugin. There is no date picker but there are input masks.

Based on the information in the RFC I think it is writing valid rules but I don't have access to a mail server which supports the date extension and so I can't be sure, you would be able to test it? (the current repo version requires 0.4-beta or svn-trunk version of RC)
Title: Sieverules plugin
Post by: Schmatze on April 25, 2010, 07:08:39 AM
Hi, I want a rule for spam. This rule should be used by every user.

So I made a file /etc/deovecot/sieve/default with this code inside:

require ["fileinto"];
# Move spam to spam folder
if header :contains "X-Spam-Flag" ["YES"] {
  fileinto "Spam";
  stop;
}

But Roundcube doesn't recognise this file. I can't see it on the homepage. What is wrong?
Title: Sieverules plugin
Post by: dziobak on April 25, 2010, 07:19:22 AM
try to use file names ending with *.sieve default.sieve
did you compile this file with 'sievec'?
Is this mistake on forum or in config files '/etc/deovecot/sieve/default'?

global sieve is used when theres no user sieve file.
if global sieve doesn't work you can try with 'sieve_before'
sieve_before = /etc/dovecot/sieve/default.sieve

this is a global reuleset and users won't see it
Title: Sieverules plugin
Post by: Schmatze on April 25, 2010, 07:41:00 AM
Thanks for your answer.

Now I think "example" would be the better choise for me. But this doen't work too.

I tried example.sieve and example.sievec (compiled version). Nothing works.

And deovecot was a mistake in the forum.
Title: Sieverules plugin
Post by: dziobak on April 25, 2010, 07:44:49 AM
in dovecot.conf you have:

Code: [Select]
sieve_global_path = /etc/dovecot/sieve/example.sieve
sieve_global_dir = /etc/dovecot/sieve

add this after
Code: [Select]
sieve_before = /etc/dovecot/sieve/example.sieve
now it should work
Title: Sieverules plugin
Post by: Schmatze on April 25, 2010, 08:01:45 AM
Mh ... no it doesn't work :(

I added
  sieve_global_dir = /etc/dovecot/sieve/
  sieve_global_path = /etc/dovecot/sieve/example.sieve
  sieve_before = /etc/dovecot/sieve/example.sieve

under plugin {

and restartetd dovecot. Nothing changed. Maybe it doesn't work with debians 1.0 dovecot? But userdefined rules work.
Title: Sieverules plugin
Post by: dziobak on April 25, 2010, 08:07:20 AM
yes, it doesn't work with 1.0... the newest version of dovecot is dovecot-1.2.10, so in your place I would think about an update...
Title: Sieverules plugin
Post by: dziobak on April 25, 2010, 08:26:37 AM
If you want to upgrade see this:

Upgrading/1.1 - Dovecot Wiki (http://wiki.dovecot.org/Upgrading/1.1)
Upgrading/1.2 - Dovecot Wiki (http://wiki.dovecot.org/Upgrading/1.2)
LDA/Sieve/Dovecot - Dovecot Wiki (http://wiki.dovecot.org/LDA/Sieve/Dovecot#Migration_from_CMUSieve)
Title: Sieverules plugin
Post by: Rando on April 26, 2010, 11:32:04 AM
Hi John,
thank you for this quick update.
the generated code worked fine with dovecot-1.2 and dovecot-sieve-0.1.15
date, time and weekday. tested with vacation, copy, reject, ..

---

an error occured when creating a new filter : (rc 0.4b, last sieverules version)
matching all (or any) of the rules
1st rule : subject, contains, any content
2nd rule : Arrival date filter, weekday, any day
when saving, a pop-up said "Please enter a value to test the header against"

---

the default operators' list don't match for date and time, and only 2 do for weekday
here is the list of the main operators that could fit as a default list (and an alternate display name)
*date and time : (case-insensitive string)
"value is greater than" ("After")
"value is greater than or equal to" ("After (inclusive)")
"value is less than" ("Before")
"value is less than or equal to" ("Before (inclusive)")

*date and weekday :
"is equal to" ("is")
"is not equal to" ("is not")

cheers,
Rando.

edit: updated
Title: Sieverules plugin
Post by: JohnDoh on April 29, 2010, 06:32:22 AM
great, the validation bug is fixed in the repo. i'll see what i can do about the operators.
Title: Sieverules plugin
Post by: kondybas on May 14, 2010, 08:16:51 AM
Quote from: Schmatze;27036
Mh ... no it doesn't work :(

I added
  sieve_global_dir = /etc/dovecot/sieve/
  sieve_global_path = /etc/dovecot/sieve/example.sieve
  sieve_before = /etc/dovecot/sieve/example.sieve

under plugin {

and restartetd dovecot. Nothing changed. Maybe it doesn't work with debians 1.0 dovecot? But userdefined rules work.


See Dovecot manual for sieve: LDA/Sieve/Dovecot - Dovecot Wiki (http://wiki.dovecot.org/LDA/Sieve/Dovecot)

It says literally:

"...The extra scripts can be executed before and after the user's private script. For example, this allows executing global Sieve policies before the user's script. This is not possible using the sieve_global_path  setting, because that is only used when the user's private script does not exist..."

Default "global sieve" executed ONLY if user's sieve is absent. If user's sieve exists, global sieve ignored.


If you want sequentially execute multiple sieves, you need
sieve_before=/a/b/before/before.sieve
and
sieve_after=/a/b/after/after.sieve

If you need more than one sieve in before an after phases, just omit filenames in config:
sieve_before=/a/b/before/
sieve_after=/a/b/after/

Then ALL scripts in dirs will be executed if alphabetical order.
Title: Filter Actions: Move message to
Post by: pixilla on May 26, 2010, 10:22:12 AM
If you create a mailbox, say "Spam" for example, and create a rule with "Filter Actions: Move message to Spam" and then remove the mailbox and review the sieve rule, "Filter Actions: Move message to" will display the first mailbox in the list ("Inbox" in my case) as the move to target while the sieve rule source still has "Spam" as the target.

I am checking this out to find if dovecot/sieve-plugin automatically creates Mailboxes as needed.
Title: Sieverules plugin
Post by: JohnDoh on May 26, 2010, 12:11:06 PM
yep, thats meant to be like that, if the folder doesnt exist then it wont be listed and so cant be selected by default.
Title: Sieverules plugin
Post by: pixilla on May 26, 2010, 07:11:56 PM
It's misleading. The script moves to "Spam" which does not exist. Only the visual representation of the script says "Inbox".

Reproduce:
1. Make folder "DeleteMe"
2. Make rule moving to "DeleteMe"
3. Delete folder "DeleteMe"
4. Rule shows move to "Inbox"
5. Looking at source code for sieve rule says move to "DeleteMe" not "Inbox"

So you are mislead without looking at source.
Title: Sieverules plugin
Post by: JohnDoh on May 27, 2010, 02:53:47 AM
I do not belive it is misleading, if a folder doesn't exist then normally the message will stay in the inbox (there is no where for it to go).
Title: Sieverules plugin
Post by: pixilla on June 03, 2010, 04:50:23 PM
Sorry for the letting so much time lapse.

Quote from: JohnDoh;27686
I do not belive it is misleading, if a folder doesn't exist then normally the message will stay in the inbox (there is no where for it to go).


On my dovecot system this is not what I observe. Using my example if the mailbox DeleteMe does not exist it is created and the rule delivers into DeleteMe.
Title: Sieverules plugin
Post by: JohnDoh on June 04, 2010, 12:30:37 PM
I tried it again and you're right, it does create the folder, not sure what I was doing different before, sorry about that. Unfortantly the fact still remains the plugin uses the folder list from the server so if the folder doesn't exist it cant be listed, its a limitation of the way it works.
Title: Sieverules plugin
Post by: pixilla on June 04, 2010, 01:22:26 PM
I'm sure this is a rare thing but I could see someone deleting a folder and getting frustrated that it keeps coming back, checking the rules shows no rule referencing deleted folder.

Since the interface to the rules has the folder selected if it exists, the RC SieveRules plugin has the folder name parsed from the script in a var. Check if that var is in the folder list array and if not append it to the end of the array and possibly add "missing" like "DeleteMe (missing)" in the folder list, under or to the right in bold red. DeleteMe is the folder name I've been using in my examples.

Sorry, I don't know if I can follow my own message :) but no time to rewrite.

Thanks,
Brad
Title: Sieverules plugin
Post by: JohnDoh on June 05, 2010, 05:20:56 AM
If the missing folder is manually added to the list then you'll get questions like "where has this folder come from?" "why can't I see this folder in my list?" and "how come the DeleteMe folder is only available for one rule?".

Possibly there should also be a new config option because the RCF says:  
Quote
If the specified mailbox doesn't exist, the implementation MAY treat it as an error, create the mailbox, or deliver the message to an implementation-defined mailbox.
Then admins can select the behaviour appropriate for their setup.

The plugin already contains an "Advanced editor" which allows more experienced users to skip the limitations of the UI and manually create rule files. I understand your point about users being confused by folders re-appearing apparently for no reason but I think this is a very rare case and the user should of created the rule to put messages in that folder and hopefully when they see the folder and the message inside it then it will give their memory a little jog and they'll go and change the rule!
Title: Sieverules plugin
Post by: pixilla on June 05, 2010, 11:24:05 AM
I agree with your last paragraph. As a developer I am used to reporting possible errors and/or inconsistencies when I observe them. Weighing their impact is always part of way forward.

I wasn't clear enough in my previous post. I was suggesting adding the message to the list WITH an error message.

Either append "(does not exist)" to the select option label, or better, add to the right of select object "Error: This folder does not exist."

// Brad
Title: Sieverules plugin
Post by: pixilla on June 05, 2010, 11:25:16 AM
I agree with your last paragraph. As a developer I am used to reporting possible errors and/or inconsistencies when I observe them. Weighing their impact is always part of way forward.

I wasn't clear enough in my previous post. I was suggesting adding the message to the list WITH an error message.

Either append "(does not exist)" to the select option label, or better, add to the right of select object "Error: This folder does not exist."

As far as auto-creation of missing folders, I think this varies between MDA configurations.


// Brad
Title: Sieverules plugin
Post by: JohnDoh on June 06, 2010, 09:43:36 AM
Adding anything to the folder name in the drop down is a little tricky but adding the missing folder itself is easy. But I'm still not sure it's worth it. I agree depending on your setup the current way it works can be a little misleading BUT only until the first mail arrives, then the folder exists and then the problem is gone.

I have been playing with it a little and I cannot think of a clear way of adding something to the UI which will explain to a user what is going on. A message like "Error: This folder does not exist." will only lead to questions, it is misleading. Also as I said before it would need to be configurable for different setups.

I'm not saying I can't be added or I won't added just that at the moment I can't find a nice way of doing it and that I'm not sure it's worth the additional complication. I think it should be left on the wish list for now, lets atleast see if there is any more feedback - if its worthwhile.
Title: Sieverules plugin
Post by: ender on June 10, 2010, 04:20:41 AM
I'm having some trouble with the sieverules plugin: it shows up in the configuration, but when I click the New filter button (or if I click an existing rule that was created by the managesieve plugin), nothing happens (in Firefox, the right pane stays empty, while in Opera I get an error message from Opera). Looking at the server logs, I can see it responds with an empty 500 document.

The RoundCube log shows this:
Jun 10 10:14:35 [roundcube] PHP Fatal error:  Call to a member function connect() on a non-object in /var/www/localhost/htdocs/roundcube/program/include/rcmail.php on line 408

Any ideas what's happening?

I'm running RoundCube 0.3.1, sieverules from April 19th, apache 2.2.15 and php 5.2.13 on Gentoo Linux.
Title: Sieverules plugin
Post by: JohnDoh on June 10, 2010, 05:30:43 AM
it sounds like you are probably using the wrong version of the plugin, one designed for a newer version of RC. please take a look in the repo under "switch branches" and you can switch to the 0.3.1 branch.
Title: Sieverules plugin
Post by: birger on July 26, 2010, 02:08:34 PM
hi, i am having problems importing an ingo script. the sieverules plugin doesn't ask if i want to import the script. i wrote a test script to check if the ingo.sieve file can be imported by the srimport_ingo()->importer and that works.
do i have to enable the importer feature somewhere?
Title: Sieverules plugin
Post by: JohnDoh on July 27, 2010, 11:42:00 AM
The importer is only called the very first time a user access the filters page (when no sieve filter file exists on the server) if there is nothing to import or the user chooses not to then a blank file is created so the importer is not trigger a second time. I'm not sure what srimport_ingo()->importer but I would like to say the import filters which SieveRules ships with are only proof on concept they are a long way from perfect.
Title: Sieverules plugin
Post by: birger on July 27, 2010, 12:19:29 PM
i cannot reproduce this behaviour. i removed all sieve script files from a test user and then there was no import option and there hasn't been created a blank file.
if the import filters are only a proof of concept thats okey, i can work on that, but only if i can test the filter ;)
Title: Sieverules plugin
Post by: JohnDoh on July 28, 2010, 08:08:48 AM
hmmm what version of the plugin are you using? iirc the inital setup was a little buggy in some versions. also (sorry this is a stupid question) but if you have delete all the sieve script files then did you also delete the ingo one?

may be if you take a look in sieverules.php at the _startup and gen_setup functions you can find the point at which its failing. if there no existing rule file found in _startup then gen_setup should be triggered. in gen_setup there is a call to $this->sieve->check_import() thats what checks if there is anthing to import.
Title: Sieverules plugin
Post by: birger on July 28, 2010, 08:48:57 AM
Quote from: JohnDoh;28998
hmmm what version of the plugin are you using?


head CHANGELOG says 2010 04 19

Quote
but if you have delete all the sieve script files then did you also delete the ingo one?

first no, but when you said "The importer is only called the very first time a user access the filters page (when no sieve filter file exists on the server)" i tried with no sieve file at all (i thought maybe it has to be uploaded by hand).

Quote
may be if you take a look in sieverules.php at the _startup and gen_setup functions you can find the point at which its failing. if there no existing rule file found in _startup then gen_setup should be triggered. in gen_setup there is a call to $this->sieve->check_import() thats what checks if there is anthing to import.

i will do that. with 'no existing rule file' you mean no own rule file?
Title: Sieverules plugin
Post by: JohnDoh on July 29, 2010, 02:56:45 AM
I'm sorry yes, I did make that very confusing. What I meant was that no rule file with the same name as specified in your sieverules config (roundcube.sieve by default) exists. Other files can remain there without a problem.

It sounds like you have the plugin version for 0.4b, if you have access to an SVN trunk version of RC then I suggest you give the repo version of sieverules a try.
Title: Sieverules plugin
Post by: birger on July 29, 2010, 06:13:04 AM
Quote from: JohnDoh;28998
may be if you take a look in sieverules.php at the _startup and gen_setup functions you can find the point at which its failing.


function gen_setup, line 367 is
Code: [Select]

if (sizeof($this->sieve->list) > 1) {

but i thihnk it should be
Code: [Select]

if (sizeof($this->sieve->list) > 0) {


with that change it works for me
Title: Sieverules plugin
Post by: JohnDoh on July 29, 2010, 01:12:18 PM
hmm yea i guess it should be. well spotted, thanks!
Title: Sieverules plugin
Post by: birger on August 17, 2010, 04:38:21 AM
i added some str_replace in the ingo.php import filter
                                elseif (isset($name[$i])) {
                                        $token = str_replace(":comparator \"i;ascii-casemap\" ", "", $token);
                                        $token = str_replace(":comparator \"i;octet\" ", "", $token);
                                        $token = str_replace(":all ", "", $token);
                                        $token = str_replace("not header :is \"Precedence\" [\"list\", \"bulk\", \"junk\"], ", "", $token);

the last line helps to parse the vacation notice rules from ingo. ingo always adds the following sieve code:
Code: [Select]

if allof ( not exists [&quot;list-help&quot;, &quot;list-unsubscribe&quot;, &quot;list-subscribe&quot;, &quot;list-owner&quot;, &quot;list-post&quot;, &quot;list-archive&quot;, &quot;list-id&quot;, &quot;Mailing-List&quot;], not header :comparator &quot;i;ascii-casemap&quot; :is &quot;Precedence&quot; [&quot;list&quot;, &quot;bulk&quot;, &quot;junk&quot;], not header :comparator &quot;i;ascii-casemap&quot; :matches &quot;To&quot; &quot;Multiple recipients of*&quot; ) {

and the Precedence-Header ist the only one that isn't being parsed properly by the sieverules plugin.
i don't know if it makes sense to use all of these sieve rules in an vacation notice; dovecot sieve does some filtering in vacation anyway (LDA/Sieve - Dovecot Wiki (http://wiki.dovecot.org/LDA/Sieve#Vacation_auto-reply)).

what really would be great: if i could add an alias in the 'out of office' filter without having the alias to be an identity. if i have a lot of email addresses i don't want to configure an identity for everyone of them to have vacation notices sent for them.
Title: Sieverules plugin
Post by: JohnDoh on August 19, 2010, 02:42:02 PM
Thanks for the code for the import filter.

For the vacation aliases, I understand that if you have alot of aliases that it could be difficult, but then not all implementations require the :addresses option. So it kinda depends on your setup a bit. I'll keep the idea in mind.
Title: rcube_parse_host() error with 0.3.1
Post by: roe1234 on August 26, 2010, 04:15:51 PM
[26-Aug-2010 15:36:35] PHP Fatal error:  Call to undefined function rcube_parse_host() in /var/lib/roundcube/plugins/sieverules/sieverules.php on line 1133


I downloaded the latest version of sieverules.

Top of the changelog:

2010 07 03
==========
 * Update to Net_Sieve 1.3.0


And I get the top error.
Title: Sieverules plugin
Post by: JohnDoh on August 27, 2010, 12:39:07 PM
The latest version of the Sieverules plugin requires RC 0.4 stable.
Title: Older release available?
Post by: roe1234 on August 27, 2010, 01:23:48 PM
Is there a release available for use with the version of roundcube I am using.  I am not ready to upgrade yet.  Thanks
Title: Sieverules plugin
Post by: JohnDoh on August 27, 2010, 01:44:17 PM
yep, older versions are available in the repo: JohnDoh's RoundCube-Plugin-SieveRules-Managesieve at 0.3.1 - GitHub (http://github.com/JohnDoh/RoundCube-Plugin-SieveRules-Managesieve/tree/0.3.1)
Title: European Portuguese (pt_PT) translation for Sieverules plugin
Post by: lingfude on September 02, 2010, 06:53:13 AM
New European Portuguese (pt_PT) translation for Managesieve plugin.
Title: Sieverules plugin
Post by: JohnDoh on September 02, 2010, 12:52:03 PM
thats great, thanks very much.
Title: Sieverules plugin
Post by: JohnDoh on September 19, 2010, 05:50:00 AM
birger: the latest repo version of the plugin has an option to allow free entry of vacation aliases, it will work with 0.4-stable too.
Title: Create Default Filter? CMUsieve / sieverules
Post by: osterhase on September 24, 2010, 05:10:03 AM
Hi there,

I'am still hunting down my spam problems and need some help. What I basically want to acieve is, that if a message header contains X-Spam-Flag = Yes / or the message subject contains "[*****SPAM*****]" it should be moved to the Junk folder, but this should work "out of the box" - so the user should not have to create a Spam-Filter.

I've realized user-filter via sieverules (Changelog 2010 07 03), cmusieve and dovecot 1.0.15 (I use debian lenny - so I'm bound to this version of dovecot). According to this post (http://www.roundcubeforum.net/7-third-party-contributions/46-api-based-plugins/4878-sieverules-plugin-4.html#post27037) - it is not possible to apply a global sieverule with cmusieve, when userprefs exist. So I've to stick to the userprefs...

Is there a possibility to create this default Filter? Can I achieve this by using the "$rcmail_config['sieverules_predefined_rules'] = array();" in config.inc.php ../sieverules?

Thanks for any help!

Best regards
osterhase
Title: Sieverules plugin
Post by: JohnDoh on September 25, 2010, 04:23:27 AM
It sounds like you want to use the sieverules_default_file option rather than the predefined rules, and set auto_load_default to true. then if/when a user opens the filter page they will see the spam rule already active.
Title: Sieverules plugin
Post by: osterhase on September 25, 2010, 08:47:27 PM
Indeed. Thanks again.
Title: latest sieverules and no Move Message To
Post by: shaynej on October 01, 2010, 03:04:32 AM
I had both a similar issue with Managesieve.

There is no Move Message To action when I want to move a message to a specific mailbox.

When I edit my Spam filter (which was made manually on the server) the action that shows up in the box is Redirect Message To and then a dropdown box containing all my IMAP folders.
Trying to submit this fails saying to please enter an email address.

I am using Dovecot 2.0.4 and the latest Dovecot Pigeonhole.

Anyone got any pointers?
Title: Sieverules plugin
Post by: JohnDoh on October 01, 2010, 01:17:11 PM
If you wrote the rule manually then chances are the plugin just doesnt understand it. If you post the rule I might be able to see the problem.
Title: Sieverules plugin
Post by: shaynej on October 02, 2010, 03:59:15 AM
The rule is as follows:

Code: [Select]
require &quot;fileinto&quot;;
# rule:[Spam]
if header :contains &quot;X-Spam-Flag&quot; &quot;YES&quot; {
  fileinto &quot;Junk&quot;;
}

Even when I attempt to add a new rule I have no "move message to" to the action dropdown box. I have included a screen shot of what I mean.

This is the all the relevant (that i can see) in the config file:
Code: [Select]
// allowed actions
$rcmail_config['sieverules_allowed_actions'] = array(
                                                                       'fileinto' => TRUE,
                                                                       'vacation' => TRUE,
                                                                       'reject' => TRUE,
                                                                       'redirect' => TRUE,
                                                                       'keep' => TRUE,
                                                                       'discard' => TRUE,
                                                                       'imapflags' => TRUE,
                                                                       'notify' => TRUE,
                                                                       'stop' => TRUE
                                                                       );
Title: Sieverules plugin
Post by: JohnDoh on October 02, 2010, 07:03:16 AM
oh right, thats a different problem. your managesieve server is not returning fileinto in the list of supported extensions... if you telnet to to server you should see something like this:

Code: [Select]
&quot;IMPLEMENTATION&quot; &quot;dovecot&quot;
&quot;SASL&quot; &quot;PLAIN LOGIN&quot;
&quot;SIEVE&quot; &quot;fileinto reject envelope vacation imapflags notify subaddress relational comparator-i;ascii-numeric regex&quot;
&quot;STARTTLS&quot;
OK &quot;Dovecot ready.&quot;

see line 3 all the extensions support by the server are listed, the plugin checks these so it doesnt allow users to create rules which arent supported.
Title: Sieverules plugin
Post by: shaynej on October 02, 2010, 08:03:25 AM
got it sorted thanks JohnDoh.

telnet'ed to the managesieve server and got empty lines, so went back to read the documentation and this caught my eye.

Code: [Select]

  # Explicitly specify the SIEVE and NOTIFY capability reported by the server before
  # login. If left unassigned these will be reported dynamically according to what
  # the Sieve interpreter supports by default (after login this may differ depending
  # on the user).
  #managesieve_sieve_capability =
  #managesieve_notify_capability =


I had both lines uncommented without setting anything. Should really read the configuartion examples better before asking for help.

Cheers again :)
Title: Sieverules plugin config
Post by: ramsrm on October 05, 2010, 01:39:53 AM
After i installed and set configuration, Filters tab is shown in Settings, unable to connect managesieve server msg is shown while click the filter tab. Please reply with your comments.

Thanks in advance...:)
Title: Sieverules plugin
Post by: JohnDoh on October 05, 2010, 01:00:36 PM
ok lets start with the basics... have you configured the problem correctly with the right host address for the managesieve server and the right port? have you checked there is no firewall or anything in the way? can you telnet from your webserver to the managesieve server?
Title: Sieverules plugin
Post by: starm on October 10, 2010, 05:07:38 AM
just completed the first install, the only issues were human error
Title: Sieverules plugin
Post by: corrigan on October 12, 2010, 07:08:34 PM
I really like this plugin, but have a couple issues...

Smartsieve support:
Up until now, we have been using smartsieve to create our filters, and the only reason it can't be just be used is the lack of rule names (and the filename).   It would be great to have it just work without having to do an import, but I understand if I have to import.

Importing- Active ruleset:
I've written an import filter for smartsieve files, and it works fine, but I've noticed that when you do the import it writes out the new sieve file (roundcube.sieve for me), but it does not change the default sieve file until you click the save button inside of a rule.  It should change the default ruleset when the import happens, assuming sieverules_multiplerules is false.

Importing - setting default import:
As we migrate from smartsieve to sieverules, I'd like to avoid the 'No existing filters detected!' screen.  It would be great if there was a setting that let you automatically import the users sieve file, and set it to be active.

Vacation filters:
if you use the 'sieverules_use_elsif' setting, it makes vacation filters really hard or impossible to use.  If it's at the top of your rules, it will intercept all messages and reply to them, but not perform the other rules.  If it's at the bottom, then if any of your other rules applies, then the vacation filter doesn't reply.  I'd like to see the vacation functionality always be an IF, outside of the main if/elseif statement.  This way, the vacation filter could reply to my mails, and my mail could still be filtered (some thought would need to done regarding spam filtering).  Yes, I can change the 'sieverules_use_elsif' setting to be false, but it still feels like a problem.
Title: Sieverules plugin
Post by: JohnDoh on October 13, 2010, 02:22:22 PM
Quote
Vacation filters:
if you use the 'sieverules_use_elsif' setting, it makes vacation filters really hard or impossible to use. If it's at the top of your rules, it will intercept all messages and reply to them, but not perform the other rules. If it's at the bottom, then if any of your other rules applies, then the vacation filter doesn't reply. I'd like to see the vacation functionality always be an IF, outside of the main if/elseif statement. This way, the vacation filter could reply to my mails, and my mail could still be filtered (some thought would need to done regarding spam filtering). Yes, I can change the 'sieverules_use_elsif' setting to be false, but it still feels like a problem.
-1 from me. i'm not sure how you would explain to some one that some rules work one way while others work completely differently. i think that for the more advanced user there is the advanced user or set elsif to false and use the stop action when you want the script to stop.
Title: Sieverules plugin
Post by: bjorntj on October 13, 2010, 04:23:39 PM
I am just about to switch our webmail system from Horde to Roundcube and was wondering it care should be taken when installing Sieverules? Will the upgrade from horde sieve files to Sieverules go ok or should I monitor the process carefully? Also, can I see any log of the upgrade process?


Regards,

BTJ
Title: Sieverules plugin
Post by: JohnDoh on October 14, 2010, 02:25:08 AM
As with any upgrade process you should always take care. If I were you I'd get several different existing sieve filter rule files so I can create and test the import filter. There is no logfile of the import by default although your import filter can write one, both the old and new rule files will exist after the import do you can switch back if needed.
Title: Sieverules plugin
Post by: bjorntj on October 14, 2010, 05:29:10 PM
Here are a few examples...:

Code: [Select]
# Sieve Filter
# Generated by Ingo (http://www.horde.org/ingo/) (16. aug. 2010, 09:02:55)

require [&quot;vacation&quot;, &quot;regex&quot;];

# Vacation
if allof ( not exists [&quot;list-help&quot;, &quot;list-unsubscribe&quot;, &quot;list-subscribe&quot;, &quot;list-owner&quot;, &quot;list-post&quot;, &quot;list-archive&quot;, &quot;list-id&quot;, &quot;Mailing-List&quot;], not header :comparator &quot;i;ascii-casemap&quot; :is &quot;Precedence&quot; [&quot;list&quot;, &quot;bulk&quot;, &quot;junk&quot;], not header :comparator &quot;i;ascii-casemap&quot; :matches &quot;To&quot; &quot;Multiple recipients of*&quot; ) {
    if header :regex &quot;Received&quot; &quot;^.*(2010) (\\(.*\\) )?..:..:.. (\\(.*\\) )?(\\+|\\-)....( \\(.*\\))?$&quot; {
    if header :regex &quot;Received&quot; &quot;^.*(Jul) (\\(.*\\) )?.... (\\(.*\\) )?..:..:.. (\\(.*\\) )?(\\+|\\-)....( \\(.*\\))?$&quot; {
    if header :regex &quot;Received&quot; &quot;^.*(19|20|21|22|23|24|25|26|27|28|29|30|31) (\\(.*\\) )?... (\\(.*\\) )?.... (\\(.*\\) )?..:..:.. (\\(.*\\) )?(\\+|\\-)....( \\(.*\\))?$&quot; {
    vacation :days 7 :addresses &quot;xxx@domain.no&quot; :subject &quot;God sommer!  &quot; &quot;Jeg er på ferie nå og er tilbake 16.august. Vennligst kontakt sentralbord pr tlf.nr xx xx xx xx eller på e-post yyy@domain.no og vi skal hjelpe deg med din henvendelse. &quot;;
}
}
if header :regex &quot;Received&quot; &quot;^.*(Aug) (\\(.*\\) )?.... (\\(.*\\) )?..:..:.. (\\(.*\\) )?(\\+|\\-)....( \\(.*\\))?$&quot; {
    if header :regex &quot;Received&quot; &quot;^.*([0 ]1|[0 ]2|[0 ]3|[0 ]4|[0 ]5|[0 ]6|[0 ]7|[0 ]8|[0 ]9|10|11|12|13|14|15) (\\(.*\\) )?... (\\(.*\\) )?.... (\\(.*\\) )?..:..:.. (\\(.*\\) )?(\\+|\\-)....( \\(.*\\))?$&quot; {
    vacation :days 7 :addresses &quot;xxx@domain.no&quot; :subject &quot;God sommer!  &quot; &quot;Jeg er på ferie nå og er tilbake 16.august. Vennligst kontakt sentralbord pr tlf.nr xx xx xx xx eller på e-post yyy@domain.no og vi skal hjelpe deg med din henvendelse. &quot;;
}
}
}

}
Code: [Select]
# Sieve Filter
# Generated by Ingo (http://www.horde.org/ingo/) (09. aug. 2010, 10:42:56)

# Svartelistet adresser
if address :all :comparator "i;ascii-casemap" :is ["From", "Sender", "Resent-From"] ["perchlorate@revitalizace.eu", "excitor@offout.com", "codpieces@natlink.com", "crenelate@chiarion.com"]  {
    discard;
    stop;
}
Code: [Select]
# Sieve Filter
# Generated by Ingo (http://www.horde.org/ingo/) (20. sep. 2010, 06:09:46)

# Videresendinger
if true {
    redirect "xxx@gmail.com";
    stop;
}
BTJ
Title: imap4flags Support
Post by: sbriesen on October 23, 2010, 06:12:38 AM
Hello!

I desperately need support for custom imap(4)flags. Here's an example:

require ["imapflags","fileinto"];

if allof (header :is "X-Spam-Flag" "YES") {
   addflag "Junk";
   fileinto "Spam";
}

For my internal workflow, it's necessary to set the "Junk"-Flag additionally to the move to the Spam-Folder.

Currently, sieverules only allows the predefined Flags like \\Flagged, etc. It would be nice, if I could define extra flags like "Junk", "NonJunk" or "$LABEL1", etc. in the config.inc.php. Also an "other..." option would be cool, so the user can set own flags like "$MyOwnFlag".

Would be REALLY nice to see that (easy to implement) feature in one of the next versions. Thanks!

regards,
Stefan
Title: Additional info:
Post by: sbriesen on October 23, 2010, 06:32:36 AM
changed for testing:

[sieverules.php]

        private $flags = array('flagread' => '\\\\Seen',
                                        'flagdeleted' => '\\\\Deleted',
                                        'flaganswered' => '\\\\Answered',
                                        'flagdraft' => '\\\\Draft',
                                        'flagflagged' => '\\\\Flagged',
                                        'flagjunk' => 'Junk',
                                        'flagnonjunk' => 'NonJunk',
                                        'flaglabel1' => '$Label1',
                                        'flaglabel2' => '$Label2',
                                        'flaglabel3' => '$Label3',
                                        'flaglabel4' => '$Label4',
                                        'flaglabel5' => '$Label5'
                                        );

works (almost) perfectly. The only odd thing is, that the new flags are displayed as e.g. "[flagnonjunk]". It would be better to display not localized flags with the flagname, i.e. "NonJunk".
Title: Sieverules plugin
Post by: JohnDoh on October 23, 2010, 09:36:38 AM
you need to define the text for the flagnonjunk label in your localisation file. also you can define the flag array in your config file already, check the readme.
Title: Sieverules plugin
Post by: boomertsfx on November 02, 2010, 10:25:22 AM
how do I get the sieverules plugin to write the sieve file using imap4flags instead of imapflags?  I tried making imapflags FALSE and imap4flags TRUE but that didn't work.  Right now I just enabled the legacy imapflags in the dovecot.conf but wondering what the proper way is...
Title: Sieverules plugin
Post by: JohnDoh on November 02, 2010, 03:57:04 PM
you should not need to change anything in the config for that. the plugin uses imapflags or imap4flags based on the extentions given by the server
Title: updated avelsieve import plugin
Post by: alavaliant on November 16, 2010, 01:18:57 AM
Greetings,  I'm a support team member of a company who is working on migrating from squirrelmail/avelsieve to roundcube/sieverules.

One of the common feedbacks I've received is that after migrating having 30 rules called 'Unnamed rule X' is a bit hard to sort though  so I've recoded the default avelsieve import plugin provided to the one attached to this message.    This one extracts bits of information from the actions to give a name to each rule.
It seems to work well enough in my testing so I'd like to release it since other people might find it useful.   (gpl2 if you want to worry about license, I don't personally think it's enough code to really work about - mainly mentioning it incase JohnDoh thinks it's useful enough to stick in the repo).



On a side note - the horde/ingo filter I've found is a bit greedy in it's matching,   it kept matching my squirrelmail filter sets until I removed it from my install.    I've not bothered patching it though since I don't have a horde/ingo install on hand to find a better detector function rule with.
Title: debugging filter import failures
Post by: alavaliant on November 16, 2010, 01:26:13 AM
Now on a less fun note with both my updated avelsieve import plugin and the default one I'm finding some filter sets are not always importing.   The odd thing is that if I delete the roundcube sieve rule, then change the rules order in squirrelmail and do the import again it often then works.

I'm trying to dig up more information on what fails and why when the rules are in a certain order.   However even with $rcmail_config['sieverules_debug'] = true;
set in my config file I don't seem to get any debugging output in the log file about the actual import itself - I see the avelsieve rule get read in full,  then a truncated squirrelmail rule gets written out with just the requires line and nothing else.

There are no errors in the webserver logs either that I can see,   is there any thing more I can do debugging wise short of patching the code to add a bunch more debug output lines in the import part of the code?
Title: Sieverules plugin
Post by: JohnDoh on November 17, 2010, 02:37:44 PM
Thanks for the improved import script. there is no debugging stuff in the import filters by default, they are really only proof on concept.

Its hard to say what might be wrong, could you send me an example file perhaps and may be I can see if its a problem in the import filter or inside the plugin its self.

If it helps a quick way to write info to log files for debuggin in RC is to use the write_log function:
Code: [Select]
write_log('filename', 'value to log');
Title: Sieverules plugin
Post by: alavaliant on November 19, 2010, 12:47:04 AM
Thanks,  I'll do some testing with that logging line and get back to you with a sample if I don't make progress next week (right now I'm having trouble narrowing things down to a consistent working example)
Title: Sieverules plugin
Post by: alavaliant on November 22, 2010, 05:39:08 PM
for now it's looking like my filter import problems was actually something I was somehow creating?   I'd been testing several of my user's filters by coping their sieve rules into a test account (using the thunderbird sieve extension for the editing) and then running the import on them.    

Via that method I was having trouble but I had a user try doing the import on their account and it worked.    I suspect the thunderbird sieve editor was adding extra white space/odd line returns or some other X factor that the import system got upset at.  (and changing the order of rules in squirrelmail was removing whatever that odd factor was hence why it looked like rule order was effecting things initially)    I'll return to debugging if I see future imports fail but for now it's looking good.
Title: sieve plugin configuration problem
Post by: totoche on December 01, 2010, 02:35:24 AM
hello
I am new and I have a problem roundecube plugin configuration sieve
I installed the plugin by modifying the line
Quote
$ Rcmail_config ['plugins'] = array ('sieverules');


tab appears in
Quote
preferences


but when I click on the tab, the displayed page is empty

ps: excuse my English googlelisé :)

thank you
Title: Sieverules plugin
Post by: OlivierShop on December 04, 2010, 07:09:43 AM
Hi

I'm a new RC user and I have installed "Sieverules plugin" (thank you for this plugin) but I have a problem to install.

My configuration :
RC : 0.4.2
Sieverules plugin : 1.9

I have install RC in my server :
"/etc/roundcube" and "/etc/roundcube/plugins/sieverules"

For main.inc.php, I've active :
// List of active plugins (in plugins/ directory)
$rcmail_config['plugins'] = array('sieverules');

I've rename "config.inc.php.dist" on "config.inc.php"

If I connect in RC, I've "Filter" but the error message is "Impossible to connect on server sieve"
And no filters appear.

Can you help me to configure this ?

Thanks you very much :)

Olivier
Title: Sieverules plugin
Post by: JohnDoh on December 04, 2010, 07:24:16 AM
have you changed $rcmail_config['sieverules_host'] in /plugins/sieverules/config.inc.php to the correct hostname for your managesieve server and similarly the correct port in $rcmail_config['sieverules_port']? also please check the rc error log for any other information.
Title: Sieverules plugin
Post by: OlivierShop on December 04, 2010, 09:13:06 AM
I have no changed this, I don't know what I must change :(

$rcmail_config['sieverules_host'] = 'localhost';
$rcmail_config['sieverules_port'] = 2000;

And I don't know where the Log RC is ! I must configure it ?
Title: Sieverules plugin
Post by: JohnDoh on December 05, 2010, 04:50:25 AM
sieverules is a managesieve client, it connects to your server and allows you to setup filtering rules which are used when delivering mail. I can't tell you what the values for these config options should be since it depends entrily on your setup the sieverules_host is probably going to be the same as your imap host though.

Quote
And I don't know where the Log RC is ! I must configure it ?

by default the logs are written in [rc root]/logs/
Title: Sieverules plugin
Post by: modules on January 13, 2011, 03:03:47 PM
Greate plugin :)

Is it possible to have a "Filter messages like this" button(like in gmail). After selecting a mail (or multiple) you will get the "add new filter" form with prefilled header informations.
Title: Sieverules plugin
Post by: madal on January 14, 2011, 03:31:22 AM
The sieverules is good and works. But i come up with one issue. we have a squirell mail earlier so i setup up lots of rules there. When I connect rouncube to imaphost and click on filter plugin it detects the sieverules on the server so it asked to import those rules and message pops up as this :

No existing filters detected!

Import filters: Another set of filters from Squirrelmail (Avelsieve) has been found. Would you like to import these filters into your current set?

Then when I click on Import Filters it does not do anything.

Here is the error message when importing filter rules:

14-Jan-2011 08:21:21] {57}script errors: line 3: syntax error, unexpected HEADER (3):
[14-Jan-2011 08:21:31 +0000]: PHP Error: SieveRules plugin: Unable to open default rule file in /var/www/html/roundcube/plugins/sieverules/sieverules.php on line 407 (GET /roundcube/?_task=settings&_action=plugin.sieverules.setup&_framed=1)
[14-Jan-2011 08:29:54] {57}script errors: line 3: syntax error, unexpected HEADER (3):

can anybody give me some hint on this or this is a bug too.

Madal
Title: Sieverules plugin
Post by: ambolt on January 14, 2011, 05:37:06 AM
I can't get this plugin to work. When I click the "Filters" tab, I get a blank window. I haven't changed anything in the default settings.

I'm pretty much a newbie when it comes to sieve, but I did get the managesieve plugin to work without any problems. I'm using Roundcube 0.4.2, running on a Mac OS X Server.
Title: Sieverules plugin
Post by: JohnDoh on January 14, 2011, 07:01:23 AM
medal: looks like you have 2 problems 1. the import - you just have to fiddle with the importfilter for that, the one that distributed is very simple proof of concept. 2. "SieveRules plugin: Unable to open default rule" in your config you have specified a default rule file that the webserver cant read.

ambolt: a few people have posted this, if you look back though this tread you'll see that downloading the right version of the plugin for your version of RC usually sorts it ;)
Title: Sieverules plugin
Post by: ambolt on January 17, 2011, 06:46:48 AM
Thanks - that did it. :-)
Title: Sieverules plugin
Post by: madal on January 19, 2011, 05:29:19 AM
Hello JohnDoh

thanks for your prompt response. I am assuming managesieve and sieverules are not the same pluginn. I tried both to see the outcome. With the sieverules is there a working import file config ??

With managesive, when i enable this pluginn - I can see all my message filter that I added in sqirellmail and works but then when i go back to my squirell mail message filter there are no filters listed and message looks like this :

Debug: Using Backend: ManageSieve.

Is there a way to keep these rules in both roundcube and squirell mail or maybe not

Madal
Title: Sieverules plugin
Post by: JohnDoh on January 19, 2011, 09:04:18 AM
yes sieverules and managesieve are different. you could try this version of the import filter, not sure if its better or worse https://github.com/JohnDoh/Roundcube-Plugin-SieveRules-Managesieve/blob/a9fe874a184ec16e17d12ca00387655a44795c4b/importFilters/avelsieve.php

sieverules was based on the managesieve plugin so they both use the same structure for the rule file. the squirrelmail plugin wont understand it. for the same reason as you have to do an import to get the filters created by squirrelmail into something sieverules/managesieve can understand.
Title: foder autocreation and autosubmit use also default rule
Post by: fritz001 on January 23, 2011, 09:01:24 AM
Hello JohnDoh

Finally I've managed to find howto enable folder autocreation if not exists::

require ["fileinto","mailbox"];

# rule:[important]
if anyof (header :contains "From" "postmaster")
{
   fileinto :create "INBOX.admin";
}

My second problem is : the use of default rule:

cat /etc/dovecot/sieve/global.sieve

require ["fileinto","mailbox"];

# rule:[[spam]]
if (header :contains "X-Spam-Flag" "YES")
{
   fileinto :create "INBOX.Spam";
#   stop;
}

cat /srv/www/mailcube/plugins/sieverules/config.inc.php

.....
// Allow users to use multiple rulesets
$rcmail_config['sieverules_multiplerules'] = TRUE;

// Default (or global) sieve rule file
$rcmail_config['sieverules_default_file'] = '/etc/dovecot/sieve/global.sieve';

// Auto load default sieve rule file if no rules exist and no import filters match
$rcmail_config['sieverules_auto_load_default'] = TRUE;
......

So, if both default rule exist ( global.sieve) and user defined rules, default rule is not load and not applied.

Am I missing something ?!!?!
Title: Sieverules plugin
Post by: JohnDoh on January 23, 2011, 09:15:43 AM
Quote
So, if both default rule exist (global.sieve) and user defined rules, default rule is not load and not applied.

Thats right, sounds like you are talking about global seive rules, not default ones. Take a look here LDA/Sieve/Dovecot - Dovecot Wiki (http://wiki.dovecot.org/LDA/Sieve/Dovecot) at the sieve_before/after options
Title: Sieverules plugin
Post by: fritz001 on January 23, 2011, 04:22:30 PM
Quote from: fritz001;32674
Hello JohnDoh

Finally I've managed to find howto enable folder autocreation if not exists::

require ["fileinto","mailbox"];

# rule:[important]
if anyof (header :contains "From" "postmaster")
{
   fileinto :create "INBOX.admin";
}




Thanks, second problem solved, now about folder autocreation, in order to make this possible I have to enable advance editor and to add by hand require ["fileinto","mailbox"]; and file :create "mailbox_name".

So can you add this as a future feature to sieverules plugin ?
Title: Sieverules plugin
Post by: JohnDoh on January 24, 2011, 03:22:20 AM
At the moment you can only select from folders which already exist so there is no need for the create option. In the future if the possibility to add what ever folder you want is added I will add a create option.
Title: Sieverules plugin
Post by: Pausen on January 30, 2011, 06:20:04 AM
Hi i have a problem with the apereance of the plugins
it looks like the css have an error.
i use roundcube .5 and the lastest siverules plugin

someone know a fix for this
Title: Sieverules plugin
Post by: JohnDoh on January 30, 2011, 07:11:50 AM
have you cleared your browser cache and double checked that all the skin files for the plugin are up to date?
Title: Sieverules plugin
Post by: Pausen on January 30, 2011, 07:25:49 AM
i tried it with diffrent browsers (firefox,ie) und clear cache jeah but same
an i think the files are all uptodate

installed folders



Code: [Select]

 ls -latr skins
drwxr-xr-x 2 root root 4096  8. Jun 2010  templates
-rw-r--r-- 1 root root  747  8. Jun 2010  rename.png
-rw-r--r-- 1 root root  537  8. Jun 2010  enable.png
-rw-r--r-- 1 root root  568  8. Jun 2010  enablePas.png
drwxr-xr-x 3 root root 4096  8. Jun 2010  ..
-rw-r--r-- 1 root root  279  9. Okt 12:53 up_arrow.png
-rw-r--r-- 1 root root  285  9. Okt 12:53 down_arrow.png
-rw-r--r-- 1 root root  775  9. Okt 12:53 delete.png
-rw-r--r-- 1 root root  752  9. Okt 12:53 deletePas.png
-rw-r--r-- 1 root root  733  9. Okt 12:53 add.png
-rw-r--r-- 1 root root 5123 30. Jan 11:19 sieverules.css
-rwxr--r-- 1 root root  114 30. Jan 11:19 safari.css
-rwxr--r-- 1 root root 1577 30. Jan 11:19 iehacks.css
-rwxr--r-- 1 root root  193 30. Jan 11:19 ie6hacks.css
-rwxr--r-- 1 root root 2361 30. Jan 11:19 icons.png
-rwxr--r-- 1 root root 1584 30. Jan 11:19 icons.gif
-rw-r--r-- 1 root root 1024 30. Jan 11:19 help.gif
drwxr-xr-x 3 root root 4096 30. Jan 11:19 .



Code: [Select]

 ls -latr templates/
insgesamt 28
drwxr-xr-x 2 root root 4096  8. Jun 2010  .
-rw-r--r-- 1 root root 5042 30. Jan 11:19 sieverules.html
-rw-r--r-- 1 root root  814 30. Jan 11:19 setupsieverules.html
-rw-r--r-- 1 root root 1520 30. Jan 11:19 editsieverule.html
-rw-r--r-- 1 root root 2707 30. Jan 11:19 advancededitor.html
drwxr-xr-x 3 root root 4096 30. Jan 11:19 ..




folder from the zipfile.
Code: [Select]

drwxr-xr-x 3 root root 4096 30. Mai 2009  ..
drwxr-xr-x 2 root root 4096  9. Okt 13:28 templates
-rwxr--r-- 1 root root 2361  9. Okt 13:33 icons.png
-rwxr--r-- 1 root root 1584  9. Okt 13:33 icons.gif
-rwxr--r-- 1 root root 1024  9. Okt 13:33 help.gif
-rwxr--r-- 1 root root 5123 12. Jan 22:16 sieverules.css
-rwxr--r-- 1 root root  114 12. Jan 22:16 safari.css
-rwxr--r-- 1 root root 1577 12. Jan 22:16 iehacks.css
-rwxr--r-- 1 root root  193 12. Jan 22:16 ie6hacks.css
drwxr-xr-x 3 root root 4096 12. Jan 22:16 .

Title: Sieverules plugin
Post by: JohnDoh on January 30, 2011, 07:31:34 AM
you are definatly running rc 0.5 right?

try checking these 2 files are the same as the ones you have
https://github.com/JohnDoh/Roundcube-Plugin-SieveRules-Managesieve/blob/master/skins/default/templates/sieverules.html
https://github.com/JohnDoh/Roundcube-Plugin-SieveRules-Managesieve/blob/master/skins/default/sieverules.css
Title: Sieverules plugin
Post by: Pausen on January 30, 2011, 08:21:03 AM
Quote from: JohnDoh;32842
you are definatly running rc 0.5 right?

yes im sure
Quote from: JohnDoh;32842
try checking these 2 files are the same as the ones you have
https://github.com/JohnDoh/Roundcube-Plugin-SieveRules-Managesieve/blob/master/skins/default/templates/sieverules.html
https://github.com/JohnDoh/Roundcube-Plugin-SieveRules-Managesieve/blob/master/skins/default/sieverules.css

i copied the two files now
but the same error
do i have to move these into the roundcube skins folder ?
Title: Sieverules plugin
Post by: JohnDoh on January 30, 2011, 08:44:53 AM
Quote
do i have to move these into the roundcube skins folder?

nope, they go in the sieverules skin folder, the path for each file is printed just above the code on those links i posted before.

I just downloaded a frech copy of rc 0.5 and the 0.5 version of sieverules and I have no problem with the skin. I dont know what you've done but I would guess somewhere you have forgotten to update either some of the sieverules files or the rc ones (was it a fresh install or an upgrade?). only the default skin of rc is supported.
Title: Sieverules plugin
Post by: Pausen on January 30, 2011, 08:48:55 AM
it was an update from roundcube 0.4.2

hmm maybe i have to do a clean install ... this would be very annoying

###
Update
i did now a new clean installation
this fixed now the error.

very weird
Title: Sieverules plugin
Post by: JohnDoh on January 30, 2011, 11:20:37 AM
gald you got it all sorted.
Title: i dont see "Filters" tab on settings
Post by: atno on April 15, 2011, 11:46:57 AM
Hi,

I've installed the plugins but i don't see the Filters tab on settings. I don't get any errors on log files. Can someone guide me to fix this?
Title: Sieverules plugin
Post by: JohnDoh on April 16, 2011, 04:20:37 AM
Hi,

Please give a little more information about your setup.... things like:

What version of RC are you running?
What version if sieverules have you installed?
Did you actually enable it in your config or just dump the dir in?
Are there any JS errors on the page when you goto the settings section?
Title: thank you
Post by: hailang on April 16, 2011, 05:52:27 AM
I just wanted to comment & say keep up the quality work. I’ve bookmarked your froums just now and I’ll be back to read more in the future my friend! Also well-chosen colors on the theme it goes well with the blog in my modest opinion
(yhm20110416)
Title: filter size limits?
Post by: cbrace on May 02, 2011, 04:30:28 PM
Hi all,

I have the lastest sieverules (Apr 21) installed under roundcube v0.5.2 and dovecot v2.0.11. As far as I can tell it works fine, except for one particular filter statement, and I am wondering whether I am encountering an internal limitation.

In Thunderbird, I had a large filter set up to move all "bulk" mail (not junk, just non-personal mail) to a separate folder named Bulk.

Rather than retype everything, I copied the relevant Thunderbird entries in an editor, formatted them accordingly, and recreated the filter statement by hand in the sieve file.

The roundcube plugin can open and display this sieve statement, but if any changes are made to it and I try to save it, an error message is displayed:
Code: [Select]
The action you requested is not supported by the server

In the roundcube error log, I see this:
Code: [Select]
{115}roundcube: line 59: error: expecting ',' or end of test list ')', but found ':'. roundcube: error: parse failed. (3):

As far as I can tell, there is no syntax error in the this particular statement.

This statement is (the bit between the parentheses) 166 lines, 9532 bytes. Is this exceeding some limit? FWIW, here is it (contains no private info): pastebin - sieve filter statement - post number 2053021 (http://pastebin.ca/2053021)

Thanks.
Title: Sieverules plugin
Post by: JohnDoh on May 03, 2011, 03:13:43 AM
Do you know what the php setting post_max_size is set to on your server? I can't remember exactly which one it is right now but I know I have seen this problem before and it was caused by a PHP restriction on how much data could be submitted via the form.
Title: Sieverules plugin
Post by: cbrace on May 04, 2011, 10:58:29 AM
Thanks for the quick reply. post_max_size is set to 8MB, so I guess the problem must lie elsewhere.
Title: Sieverules plugin
Post by: JohnDoh on May 05, 2011, 03:34:28 AM
do you have suhosin enabled with your php? i was researching the problem on the net, trying to find the php setting and i saw something about suhonsin, i turned it off on my server and i can save your rule just fine. i guess there is some setting or something you can change rather than just turn it off if you want
Title: Sieverules plugin
Post by: cbrace on May 07, 2011, 03:48:45 PM
Ah... yes, susohsin is indeed the culprit. If I comment it out from ../php/extensions.ini, this filter can be be saved.

I have been running suhosin using the default settings. According to this page (http://www.webhostgear.com/416.html), the following are optional suhosin configuration parameters which can be added to php.ini. Any idea what might apply in this case?
Code: [Select]
Advanced Suhosin Configuration
Configuring Suhosin – example suhosin configuration
 
You can manually configure options for Suhosin in the php.ini for PHP.  This is the most confusing part that most people get lost at.
If you want advanced configuration to change the default settings form Suhosin you can edit the PHP.ini and add in these values below the extension=suhosin.so
 
Note this part isn’t required, only for your own liking.
 
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;
[suhosin]
; Logging Configuration
suhosin.log.syslog.facility = 9
suhosin.log.use-x-forwarded-for = Off
 
; Executor Options
suhosin.executor.max_depth = 0
suhosin.executor.include.max_traversal = 4
suhosin.executor.disable_emodifier = Off
suhosin.executor.allow_symlink = Off
 
; Misc Options
suhosin.simulation = Off
 
;
suhosin.apc_bug_workaround = Off
suhosin.sql.bailout_on_error = Off
suhosin.multiheader = Off
suhosin.mail.protect = 1
suhosin.memory_limit = 20
 
; Transparent Encryption Options
suhosin.session.encrypt = On
suhosin.session.cryptua = On
suhosin.session.cryptdocroot = On
suhosin.session.cryptraddr = 0
suhosin.cookie.encrypt = On
suhosin.cookie.cryptua = On
suhosin.cookie.cryptraddr = 0
 
; Filtering Options
suhosin.filter.action = 406
suhosin.cookie.max_array_depth = 100
suhosin.cookie.max_array_index_length = 64
suhosin.cookie.max_name_length = 64
suhosin.cookie.max_totalname_length = 256
suhosin.cookie.max_value_length = 10000
suhosin.cookie.max_vars = 100
suhosin.cookie.disallow_nul = On
suhosin.get.max_array_depth = 50
suhosin.get.max_array_index_length = 64
suhosin.get.max_name_length = 64
suhosin.get.max_totalname_length = 256
suhosin.get.max_value_length = 512
suhosin.get.max_vars = 100
suhosin.get.disallow_nul = On
suhosin.post.max_array_depth = 100
suhosin.post.max_array_index_length = 64
suhosin.post.max_totalname_length = 256
suhosin.post.max_value_length = 65000
suhosin.post.max_vars = 200
suhosin.post.disallow_nul = On
suhosin.request.max_array_depth = 100
suhosin.request.max_array_index_length = 64
suhosin.request.max_totalname_length = 256
suhosin.request.max_value_length = 65000
suhosin.request.max_vars = 200
suhosin.request.max_varname_length = 64
suhosin.request.disallow_nul = On
suhosin.upload.max_uploads = 25
suhosin.upload.disallow_elf = On
suhosin.upload.disallow_binary = Off
suhosin.upload.remove_binary = Off
suhosin.session.max_id_length = 128

Thanks
Title: Sieverules plugin
Post by: JohnDoh on May 08, 2011, 05:33:40 AM
i would guess its these ones
Code: [Select]
suhosin.post.max_array_depth = 100
suhosin.post.max_array_index_length = 64
suhosin.post.max_totalname_length = 256
suhosin.post.max_value_length = 65000
suhosin.post.max_vars = 200
suhosin.post.disallow_nul = On
but may be some one else knows something about suhosin
Title: Sieverules plugin
Post by: №rd on May 11, 2011, 09:22:49 AM
Hi, guys! Help me with my problem please.
Can I use this plugin with bracket "Postfix+Cyrus(with Sieve)"?

My RoundCube said "Unable to connect to the server sieve" although i have succesful connect to it on server console (on port 4190):

bsd:~# telnet localhost sieve
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
"IMPLEMENTATION" "Cyrus timsieved v2.2.13-Debian-2.2.13-19"
"SASL" "PLAIN"
"SIEVE" "fileinto reject envelope vacation imapflags notify subaddress relational comparator-i;ascii-numeric regex"
OK


Where is the reason of my problem? Thank you..

Sorry for my bad English.
Title: Sieverules plugin
Post by: dieterh on July 01, 2011, 06:19:09 AM
Hi,

I receive the following error after installing the sieverules plugin:

PHP Fatal error:  Call to undefined function rcube_idn_to_ascii() in /var/lib/roundcube/plugins/sieverules/sieverules.php on line 1155


PHP 5.3.3-7+squeeze1 with Suhosin-Patch
Roundcube Version: 0.3.1-6
Title: Sieverules plugin
Post by: JohnDoh on July 01, 2011, 12:51:51 PM
you've got the wrong version of the plugin, there are instructions on the website, please make sure you've downloaded the right version.
Title: Sieverules plugin
Post by: fritz001 on August 05, 2011, 01:20:20 PM
hello John,

Well create folder option it's a little buggy::

Tested on latest version of dovecot + qmail/postfix!!
lda_autocreate and lda_autosubscribe are set to YES


Here is default behaviour::

require ["imap4flags","fileinto"];

# rule:[filter1]
if anyof (address :contains "From" "user100@gmail.com")
{
        setflag "\\Flagged";
        fileinto "[GMAIL]";
}

So, in this case folder is not created and sieve is delivering the message to INBOX


however the corect filter should be like this

require ["imap4flags","fileinto","mailbox"];

# rule:[filter1]
if anyof (address :contains "From" "user100@gmail.com")
{
        setflag "\\Flagged";
        fileinto "INBOX.[GMAIL]";
}
Title: Sieverules plugin
Post by: JohnDoh on August 06, 2011, 04:11:20 AM
please try the latest repo version
Title: Sieverules plugin
Post by: fritz001 on August 06, 2011, 07:44:43 AM
John,

Even with latest repo still buggy

require ["imap4flags","fileinto","mailbox"];

# rule:[filter1]
if anyof (address :contains "From" "user100@gmail.com")
{
        setflag "\\Flagged";
        fileinto :create "Debug";
}

cat dovecot.sieve.log
sieve: info: started log at Aug 05 14:59:20.
error: msgid=: failed to store into mailbox 'Debug': Unknown namespace.

I was testing both versions and the "latest repo version" fails to include IMAP root at the creation of filter for all actions COPY to FOLDER or CREATE Folder.


$rcmail_config['sieverules_include_imap_root'] = true;
 
Also :create option is not necessary ;  dovecot 2.xx supports lda_autocreate
Title: Sieverules plugin
Post by: JohnDoh on August 06, 2011, 12:33:03 PM
It adds the namespace fine for me. Does your sieve implementation and your IMAP use the same namespace settings? If you select an existing folder is the namespace added?

Quote
Also :create option is not necessary ; dovecot 2.xx supports lda_autocreate

True but :create is how it says to do it in the RFC, I'm trying not to make it Dovecot specific.
Title: Sieverules plugin
Post by: fritz001 on August 06, 2011, 01:44:45 PM
Well ,

With old plugin

require ["imap4flags","fileinto"];

# rule:[filter1]
if anyof (address :contains "From" "xxx@gmail.com")
{
        setflag "\\Flagged";
}
# rule:[filter2]
elsif anyof (address :contains "From" "yyy")
{
        fileinto "INBOX.Yahoo1";
}


...and with updated plugin


require ["imap4flags","fileinto"];

# rule:[filter1]
if anyof (address :contains "From" "xxx@gmail.com")
{
        setflag "\\Flagged";
}
# rule:[filter2]
elsif anyof (address :contains "From" "yyy")
{
        fileinto "Yahoo1";
}


!!FIXED by myself :) !!  take a look at old sieverules.php and  modified a little the new one !!
Title: Sieverules plugin
Post by: Cyrille on August 10, 2011, 03:13:44 AM
Hi to all,

I just have installed the sieverules plugin and I have a bug when I import script form Ingo, the script imported is empty. Here is the log :

[10-Aug-2011 08:57:01 +0200]: C: GETSCRIPT "ingo"
[10-Aug-2011 08:57:01 +0200]: S: {251}
[10-Aug-2011 08:57:01 +0200]: S: # Sieve Filter
# Generated by Ingo (Ingo - The Horde Project (http://www.horde.org/ingo/)) (June 21, 2011, 11:00 am)

require "fileinto";

# cyrille
if address :all :comparator "i;ascii-casemap" :contains "From" "cyrille.chalier"  {
    fileinto "INBOX/cyrille";
    stop;
}


[10-Aug-2011 08:57:01 +0200]: S: OK
[10-Aug-2011 08:57:01 +0200]: C: PUTSCRIPT "roundcube" {247+}^M
# rule:[Sieve Filter]

# rule:[Generated by Ingo (Ingo - The Horde Project (http://www.horde.org/ingo/)) (June 21, 2011, 11:00 am)]

require "fileinto";


# rule:[cyrille]
if address :all :contains "From" "cyrille.chalier"  {
    fileinto "INBOX/cyrille";
    stop;
}



[10-Aug-2011 08:57:01 +0200]: S: OK
[10-Aug-2011 08:57:01 +0200]: C: PUTSCRIPT "roundcube" {18+}^M
/* empty script */
[10-Aug-2011 08:57:01 +0200]: S: OK
[10-Aug-2011 08:57:01 +0200]: C: SETACTIVE "roundcube"
[10-Aug-2011 08:57:01 +0200]: S: OK
[10-Aug-2011 08:57:01 +0200]: C: LISTSCRIPTS
[10-Aug-2011 08:57:01 +0200]: S: "ingo"
[10-Aug-2011 08:57:01 +0200]: S: "roundcube" ACTIVE
[10-Aug-2011 08:57:01 +0200]: S: OK
[10-Aug-2011 08:57:01 +0200]: C: GETSCRIPT "roundcube"
[10-Aug-2011 08:57:01 +0200]: S: {18}
[10-Aug-2011 08:57:01 +0200]: S: /* empty script */
[10-Aug-2011 08:57:01 +0200]: S: OK
[10-Aug-2011 08:57:01 +0200]: C: LOGOUT
[10-Aug-2011 08:57:01 +0200]: S: OK "Logout Complete"

All is correct exept when the script is writen on the server (not on the localhost, it's a cyrus) it writes the empty script

Can you help me ?

Thanks in advance,
Cyrille
Title: Sieverules plugin
Post by: JohnDoh on August 10, 2011, 02:42:31 PM
Hi. Using the example you gave I have made a very minor adjustment to the example file but for it to work for you it will need a lot more work. You could try creating some of your rules in sieverules and the checking what it generates and then write the import filter so it makes the same. Sorry I cant be more help, the import filters really are only in there as proof of concept. I don’t have any real world examples of rule files generated by other systems or the need for the import myself.
Title: Sieverules plugin
Post by: RonG on August 12, 2011, 04:55:37 PM
Quote from: kase;18990
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

 
Problem is you're using a global sieve rules file.  It's not supposed to be executed if the user has their own sieve rules.  What you want to do is rename the rules file from global.sieve, which is executed only in the absence of user rules, to before.sieve, which is executed for all users.
Title: Wrap Vacation rule
Post by: RonG on August 12, 2011, 05:07:12 PM
Hi, I just discovered that the vacation rule created by Sieverules replies to all incoming mail.  Replying to mailing list mail is what's called being a bad neighbor, and tends to get the person using the autoresponder disabled from their mailing lists along with angry notes from other subscribers.

I'd like to alter my Sieverules plugin to generate out-of-office rules as noted here Correct sieve vacation filtering (http://www.bsdunix.ch/serendipity/index.php?/archives/379-Correct-sieve-vacation-filtering.html) (with the exception that Precedence: Junk should also be included, as well as null senders, MAILER-DAEMON, and DSNs (delivery status notifications)), and I was wondering if someone could point me in the right direction.
Title: Sieverules plugin
Post by: JohnDoh on August 13, 2011, 04:24:12 AM
what exactly do you want to know? you can use the top half of the form, the "filter rules" section to put tests in which have to be passed before the vacation message is sent. the example you linked they have the line
Code: [Select]
if not header :contains &quot;Precedence&quot; [&quot;bulk&quot;,&quot;list&quot;] { so on the form you select "other header" in the first box, type "Precedence" (without the quotes) in the text box which appears next to it. then select "does not contain" and finally "bulk" (without the quotes). and then press the add button and make another row but with "list" in the final box.
Title: Sieverules plugin
Post by: RonG on August 15, 2011, 12:13:18 AM
Quote from: JohnDoh;36148
what exactly do you want to know? you can use the top half of the form, the "filter rules" section to put tests in which have to be passed before the vacation message is sent. the example you linked they have the line
Code: [Select]
if not header :contains &quot;Precedence&quot; [&quot;bulk&quot;,&quot;list&quot;] { so on the form you select "other header" in the first box, type "Precedence" (without the quotes) in the text box which appears next to it. then select "does not contain" and finally "bulk" (without the quotes). and then press the add button and make another row but with "list" in the final box.

 
If I have to try and explain the need to do this to users, it's never going to happen, at least not until they've inconvenienced a lot of people including themselves.  I want to generate out of office rules that comply with community standards without having to explain things like Precedence: Bulk to users.  They shouldn't have to remember that autoresponders should *never* respond to mailing lists or automatic notices and how not to, they expect that to be taken care of by the software, and it was pretty surprising to me to learn that Sieve vacation doesn't try to handle this on its own.  Since it doesn't, it falls to me to take care of this for my users by having Sieverules do it by generating a proper autoresponder rule for them instead.
Title: Sieverules plugin
Post by: JohnDoh on August 15, 2011, 03:03:10 AM
The simple answer is that everyone has different mail server setups and different times when they want their vacation messages sent out so doing it out of the box is impossible. I think you have 4 options:
1) Use a simple predefined rule and just select that every time.
2) Create a more complex rule in an example rule file and use that ever time.
3) Mod the plugin code to do what you want.
4) Use a different plugin.
Title: Sieverules plugin
Post by: osterhase on August 16, 2011, 05:19:20 AM
Hi there!

I'm using roundcube & sieverules on our mailservers for about half a year now and we are really convinced! Because the server-landscape expanded we had to move to ISPConfig3 to administrate our servers. This software also provides the possibility to edit filterrules but the mechanism of ISPConfig3 and sieverules do not like each other and both keep overwritting each others files.

So I want to customize sieverules and wanted to ask for a feedback if my line of thought is generally possible or completly of the track and would appreciate a couple of starting-points:

1. I want that sieverules writes the rules that are installed by the users into the file roundcube.sieve but it should leave the file dovecot.sieve alone (due this is the file in that the rules are actually written by ispconfig). Where (e.g. in which file) can I disable the linkage of roundecube.sieve to dovecot.sieve?

2. I would like to have a custom php-script/code run each time a user edits / saves a filter rule. This piece of code establishes a connection to ISPConfig (API) and writes the roundcube.sieve file as a ruleset into the database of ISPConfig which than applies this into the actual dovecot.sieve-filter-file. Where do I have to add this code-snippet (in which file(s))?

3. I would like to use the $user-variable in the script - is this possible and is the output the format "somename@somedomain.net"?

I'm thankful for any help and suggestions.

Best regards.
Title: Sieverules plugin
Post by: JohnDoh on August 16, 2011, 07:58:37 AM
Quote
1. I want that sieverules writes the rules that are installed by the users into the file roundcube.sieve but it should leave the file dovecot.sieve alone (due this is the file in that the rules are actually written by ispconfig). Where (e.g. in which file) can I disable the linkage of roundecube.sieve to dovecot.sieve?
2. I would like to have a custom php-script/code run each time a user edits / saves a filter rule. This piece of code establishes a connection to ISPConfig (API) and writes the roundcube.sieve file as a ruleset into the database of ISPConfig which than applies this into the actual dovecot.sieve-filter-file. Where do I have to add this code-snippet (in which file(s))?

it might be possible to solve both of these in the same (possibly slightly ineligant) solution. the roundcube ruleset is activated each time save is pressed unless there the multiple ruleset feature is enabled. when the save is completed a hook could be executed to allow any one to do anything they want, in this case, set the active one back to the ispconfig one and copy the rules into ispconfig. what do you think?

if not you just need to modify the save function, somewhere around line 920 in the repo version of sieverules.php

Quote
3. I would like to use the $user-variable in the script - is this possible and is the output the format "somename@somedomain.net"?

do you mean the sieve variables extension? there is limited support for that when doing fileinto and for setting the the from address on vacation messages but thats about it.
Title: Sieverules plugin
Post by: osterhase on August 18, 2011, 04:45:17 AM
Quote from: JohnDoh;36190
it might be possible to solve both of these in the same (possibly slightly ineligant) solution. the roundcube ruleset is activated each time save is pressed unless there the multiple ruleset feature is enabled. when the save is completed a hook could be executed to allow any one to do anything they want, in this case, set the active one back to the ispconfig one and copy the rules into ispconfig. what do you think?


I'm not quite sure if I understood what you meant. But I rather think it's the right way to modify the save function. (What do you mean with multiple ruleset feature? That more than one condition / rule is applied to one filter?)

Quote
if not you just need to modify the save function, somewhere around line 920 in the repo version of sieverules.php

Yeah - we found that line and tried to modify it by inserting a function. A set of problems arised (to be honest: we are not php-godlords):

We defined our script as function at the beginning of sieverules.php:

and then called the function:

Code: [Select]
if ($save && $result === true) {
$this->api->output->command('display_message', $this->gettext('filtersaved1'), 'confirmation');
//osterhase inserted:
$user = 'testen@domain.net';
api_ispconfig($user);
// end of insert
if ($script['disabled'] == 1)
$filter_name = $script['name'] . ' (' . $this->gettext('disabled') . ')';
else
$filter_name = $script['name'];


The function was actually executed but we stumbled over the security concept of our servers:

Code: [Select]
Aug 18 10:23:01 flux01 roundcube: PHP Warning:  file(/var/vmail/domain.net/testen/sieve/roundcube.sieve): failed to open stream: Die Operation ist nicht erlaubt in /var/www/clients/client7/web45/web/plugins/sieverules/sieverules.php on line 56

The problem there is that the user which executes the script is not allowed to leave his web-directory and so we cannot read in the roundcube.sieve-file. This lead us to the general question how the sieverule-plugin is doing that (I assumed that it would do that via connecting to the managesieve-server and let this one do the changes in the maildir) - is that correct?

This is the first and major problem we have in customizing the sieverule-plugin - how to bypass our own security concept. Actually sounds weird... :D

My only idea at the moment is to get sieverules.php to save the roundcube.sieve file temporarlly in the tmp directory of roundcube until it is read in by the api_ispconfig function. Any other suggestions?

Edit: Is it possible to catch the content of roundcube.sieve before it is actually written? If yes, with which variable can it be called? So it would be possible to replace $spamfilter with that.


Quote from: JohnDoh;36190
do you mean the sieve variables extension? there is limited support for that when doing fileinto and for setting the the from address on vacation messages but thats about it.


As you can see in the inserted lines we actually need the email-address of the current email-user to determine the correct database entry - my question was rather directed into this direction.

I've attached the modified sieverules.php (the "prints" are for debugging - obviously) and would be really thankful if you would have further suggestions.
Title: Sieverules plugin
Post by: JohnDoh on August 20, 2011, 03:22:52 AM
Quote
The problem there is that the user which executes the script is not allowed to leave his web-directory and so we cannot read in the roundcube.sieve-file. This lead us to the general question how the sieverule-plugin is doing that (I assumed that it would do that via connecting to the managesieve-server and let this one do the changes in the maildir) - is that correct?

Yes, the plugin connects to the managesieve server. It uses the Pear Net_Sieve lib for all the communication stuff.

In the repo version of the plugin I have just added the hook `sieverules_saved` so now you don’t need to modify the sieverules code directly. You can make a new plugin which uses hook and then do whatever you want. I have attached an example of how to use it.

UPDATE 20110824: The sieverules_saved has been updated to make it more reliable. the attached example has been updated to reflect the changes, more information is available in the readme.

UPDATE 20110828: The hook is run BEFORE the save process completes (it can be used to abort a save) so the hook has been changed to sieverules_save to reflect this.
Title: Sieverules plugin
Post by: osterhase on August 20, 2011, 10:30:14 AM
F*** YEAH! Thanks! Gonna check it out...
Title: Sieverules plugin
Post by: osterhase on August 22, 2011, 05:35:12 AM
Hey John,

thanks again for your work! Your file really helped us to understand (really small scale though) how it's actually possible to write a plugin. A couple of questions arised because we also tried to implement the log functionality. The function reads:

Code: [Select]
write_log('errors', 'sieverules_saved login failed');

We figured that we could exchange 'errors' with 'log' - so it actually logs things even it is not an error:

Code: [Select]
write_log('log', "ispconfig: login successful. Session-ID: $session_id");

But we would not like to spam the logfiles everytime a user changes his spamfilter-settings with things like that. Is there an option like "debug" so it's just written in the log if a high log level is defined in the main-configuration file? (We tried 'debug' but it obviously did not work out.)

The second problem arised when the user is deleting a spamfilter. Because there's no hook in the sieverules.php sieverules_saved does not react on that. Do you think it's possible to add another hook there?

Attached is the current code of the plugin (we even set up an config.inc.php) :cool:

Thanks mate for your great work!
Title: Sieverules plugin
Post by: lolomin on August 23, 2011, 03:36:30 AM
Hi,

just installed latest sieverules plugin : 1.14 but got an error reported in error_log when trying to access Settings menu in RoundCube :
PHP Fatal error:  Call to undefined method rcube_plugin_api::load_plugin() in /var/www/html/roundcubemail-0.6-beta/program/include/rcube_plugin.php on line 96, referer:

Do I forgot something ? I can't figure why I'm having this error, all is working properly with version 1.9 of the plugin ...

If anyone is having a clue about the cause, thks by advance for your help.

Laurent
Title: Sieverules plugin
Post by: JohnDoh on August 23, 2011, 07:51:19 AM
thats an error from the rc core, not the plugin. which version of rc are you running? v1.14 of sieverules requires 0.6b
Title: Sieverules plugin
Post by: lolomin on August 23, 2011, 08:30:52 AM
Hi JohnDoh,

Thks for your reply.

Using RoundCube 0.6beta here, just upgraded it from 0.5.2 to 0.6beta with the help of bin/installto.sh script.
Is there any information I can provide you that can be useful ?

Laurent
Title: Sieverules plugin
Post by: JohnDoh on August 24, 2011, 02:47:41 AM
Quote
But we would not like to spam the logfiles everytime a user changes his spamfilter-settings with things like that. Is there an option like "debug" so it's just written in the log if a high log level is defined in the main-configuration file? (We tried 'debug' but it obviously did not work out.)

easiest way is just to put the write_log call inside an if statement which checks the log level from the config. there are lots of examples in my code and others of how to read values from the config.

Quote
The second problem arised when the user is deleting a spamfilter. Because there's no hook in the sieverules.php sieverules_saved does not react on that. Do you think it's possible to add another hook there?

you are correct, the new improved version in the repo does a much better job and ensures the hook is called every time something is saved to the server. there is also a new example of how to use it in my earlier post.
Title: Sieverules plugin
Post by: JohnDoh on August 24, 2011, 02:53:42 AM
Quote
Using RoundCube 0.6beta here, just upgraded it from 0.5.2 to 0.6beta with the help of bin/installto.sh script. Is there any information I can provide you that can be useful ?

as i said its nothing to do with the plugin. may be you didnt copy some files when doing the update to 0.6b or something.
Title: Sieverules plugin
Post by: osterhase on August 25, 2011, 11:01:21 AM
Hey John,

thanks again. Did not come to my mind at first to do it with an if-statement but it worked out fine. Thanks for that!

But we came across another problem:

Code: [Select]
$sieve->getScript($args['ruleset']);

Gets the current content of roundcube.sieve (and not the new content that is written). F.e. if the user has not defined (or deleted) all filters the roundcube.sieve content is:

/* empty script */

If a new filter is created the content that is passed by

Code: [Select]
$sieve->getScript($args['ruleset']);

is /* empty script */ but the new roundcube.sieve contains the newly created filter-rule (but is obviously overwritten by ispconfig).

Can you confirm that behavior? Any suggestions on that?
Title: Sieverules plugin
Post by: JohnDoh on August 26, 2011, 03:07:54 AM
are you still using the old example? the raw script is now passed as an argument, check the updated example from the other post.
Title: Sieverules plugin
Post by: osterhase on August 26, 2011, 03:11:29 AM
Missed that one sorry - gonna check it out.
Title: isp_sieverules - plugin completed
Post by: osterhase on August 26, 2011, 07:42:09 AM
Heya,

problems solved and it runs like a charme - thanks again, you really got me through it. We had a bit of difficulties because our servers run the stable version (0.5) so we had to do a couple of changes in the sieverules.php - but as soon as the stable version of 0.6 is out we could use this. Attached is the actual plugin which enables the communication between the sieverules-plugin and ispconfig. It's heavily based on John's example file. It actually should work also in the 0.6beta version.

Thanks!
Title: Sieverules plugin
Post by: JohnDoh on August 28, 2011, 07:26:35 AM
osterhase please note in the latest revision I have changed the name hook to sieverules_save (dropped the d) this is because it is run before the save has completed so its a more accurate name. sorry about all the changes this week, this should be the last one.
Title: Sieverules plugin
Post by: osterhase on August 29, 2011, 05:50:03 AM
Hey John - thanks for the information. I've updated the plugin. Furthermore I was able to get rid of the db_function which makes the plugin easier to install. File attached.

Best regards
Title: Problem
Post by: mahdi75 on August 29, 2011, 06:31:13 PM
Hello!

I'm new to roundcube.
I want to use Roundcube webmail client on my shared hosting account, and my mail server is Horde or MailEnable (I can choose one of them)

I have installed RoundCube successfully and it's great.
but I don't know how to add special rules for message Header and Title and text... ManageSieve don't add new rule, and new rule button of Sieverules plugin not work...


Is there anything needed to install on server? or how can I use it?



Please help!!

Best Regards!
Mahdi
Title: Sieverules plugin
Post by: JohnDoh on August 30, 2011, 03:20:32 AM
Hi, please bare in mind that i have no idea about your setup so simply saying
Quote
and new rule button of Sieverules plugin not work...
is totally useless. there is almost ways some form a feedback to point you in the right direction may be a message in a red box at the top of the screen or a javascript error or something in the rc error log. i would hazard a guess that since neither of the plugins work you have failed to configure them to connect to your managesieve server.
Title: Sieverules plugin
Post by: naveen28187 on August 31, 2011, 07:23:20 AM
Yes,this is quite possible
Title: one bug and one minor change request
Post by: alavaliant on September 06, 2011, 06:01:37 PM
Hi,

I've found a bug in sieverules - one of my users keeps putting spaces on the end of their folder names.   (Can't do that in roundcube it strips trailing spaces, need to use a client like thunderbird).   If a folder ends with a space even though it's selectable in sieverules as a folder to filter into if you select it and press save the folder selection snaps back to Inbox.   Checking the html source of the page the space is in the combobox html so it looks like the failure point is in the code that does the actual save.   I'd assume the space is being stripped from the end of the folder name in some function stopping the folder from being found correctly while saving.      A minor deal but I thought I'd mention it in case it's not too hard to fix since I can't seem to stop that user from ending folder names with spaces and then getting confused as to why they can't select them to filter into.

There I have some feedback on the 'out of office message'  rule layout,   I think it would make more sense if 'advanced options' was unticked by default.   My users don't need to see those options and find them slightly confusing - as it stands the ability to hide some options to me doesn't really add up - you have to hide them after they show up but that doesn't save and to keep them hidden you'd need to hide them again each time you load the rule back up.  (would anybody actually bother doing that each time they edit the rule?)      I had a go at writing a patch to have advanced options unticked by default,  I worked out where to do it when loading a previously saved rule but couldn't work out where to alter the javascript for when a new rule is created.     Any chance you'd consider making the advanced options tick box be unticked by default when creating out of office messages?

Thanks
-J
Title: Sieverules plugin
Post by: JohnDoh on September 07, 2011, 01:26:35 AM
Hi,

You are correct whitespace is trimmed off the folder name when the rule is saved. If you wanted to stop it doing that then search for the line
Code: [Select]
$folder = $this->_strip_val($folders[$idx]);. I guess removing it wouldn't make that much difference since the values are all pre filled any way.

The advanced options box in the out of office message is unticked by default, its only ticked if the plugin is configued to show them by default or of your rule uses them.
Title: Sieverules plugin
Post by: alavaliant on September 08, 2011, 03:29:04 AM
Quote from: JohnDoh;36475
Hi,

You are correct whitespace is trimmed off the folder name when the rule is saved. If you wanted to stop it doing that then search for the line
Code: [Select]
$folder = $this->_strip_val($folders[$idx]);. I guess removing it wouldn't make that much difference since the values are all pre filled any way.


Thank you,  changing that line to
Code: [Select]
$folder = $folders[$idx];

fixes the bug in my testing and so far I'm not finding any negative side effects.   Think about it this may help me with other future cases as well.  I know some other users at my company tend to put spaces at the start of folder names to manually force them to be indented in their folder list so I suspect such a folder name would trigger the same bug if selected as a folder to filter into. (if _strip_val removes whitespace at both ends of the string like I assume?)

Quote from: JohnDoh;36475
Hi,


The advanced options box in the out of office message is unticked by default, its only ticked if the plugin is configued to show them by default or of your rule uses them.


Ahh I never noticed that before,   I've got a cyrus server so I've always had
Code: [Select]

// Force the :addresses line to always be added to new vacation rules
// Some sieve setups require that the :address part of a vacation rule is always present for the message to be sent
// Cyrus setups need this to option set to true
$rcmail_config['sieverules_force_vacto'] = TRUE;


which now I trace though the code I see changes how advanced options are shown.   I happen to also have
Code: [Select]

$rcmail_config['sieverules_limit_vacto'] = TRUE;

though so the address option isn't much use as the users only have one option and we want it shown so now I see how the code controls it I'll write a little patch for myself so those checks always end up with the advanced options set off.


Thanks for the help.
-J
Title: Re: Sieverules (managesieve) plugin
Post by: literakl on April 24, 2013, 04:05:45 AM
Hi,

I miss "time condition" feature of this great plugin. E.g. I plan vacancy, so I create a filter to send out of office message for every new person. But I have to activate it last minute I leave the office and I must deactivate it, when I return. In fact I deactivate it, once my colleagues remind me. It would be great to have two filter's input fields - valid from and valid until.

Thanks

Leo
Title: Re: Sieverules (managesieve) plugin
Post by: JohnDoh on April 24, 2013, 09:05:31 AM
there is already the arival date option for tests so long as your sieve implementation supports the date extension.
Title: Re: Sieverules (managesieve) plugin
Post by: literakl on May 02, 2013, 04:57:38 AM
No, this is something different. I want to configure following scenario:

For every message that I receive between 1.5. and 3.5. send reply with message: "Sorry I am on vacation, contact me on monday". And I do not want this automatic response to be sent on 30.4. or 4.5 and further. Such feature exists in Outlook / Exchange and I consider it as one of few useful features that MS delivered.

Title: Re: Sieverules (managesieve) plugin
Post by: JohnDoh on May 02, 2013, 12:59:27 PM
how is that not covered with the arivial date tests? see the attached screenshot for what i mean.
Title: UTF-8 Bug in SieveRules 1.18
Post by: rcru on May 07, 2013, 10:58:04 AM
Hi!

There is a bug in v 1.18 with latest RC and dovecot backend.  Dovecot uses UTF-8 for managesieve.  Set SieveRules to use UTF-8 for folder names.  Created an imap folder like this "Ü18".  What happens is that SieveRules reads the available folders from RC and the sieve script from the server.  It converts the folder names read from RC to the desired encoding (here UTF-8 for dovecot).  After that it checks if the folder already exists.  If it does not exist it shows "create folder".
The problem is that for the comparison if the folder exists it asks RC that uses mUTF7 (internally) but gives RC the already to UTF-8 converted folder name to do the comparison.  So this always fails and SieveRules always shows "create folder" even if the folder already exists.
Did attach a quick and dirty fix.

Cheers!
-ru-

Title: Re: Sieverules (managesieve) plugin
Post by: shearer on June 13, 2013, 05:19:43 AM
Hi John

i have some problem getting this plugin to work.

when i click on filter. i get a massages that says: $rcmail_config['sieverules_host'] = 'localhost';

in the config file, i the host i this.
$rcmail_config['sieverules_host'] = 'localhost';
Title: Re: Sieverules (managesieve) plugin
Post by: JohnDoh on June 13, 2013, 09:09:38 AM
did you make a typo?

Quote
when i click on filter. i get a massages that says: $rcmail_config['sieverules_host'] = 'localhost';
Title: Re: Sieverules (managesieve) plugin
Post by: shearer on June 14, 2013, 04:12:01 AM
typo ?
Title: Re: Sieverules (managesieve) plugin
Post by: JohnDoh on June 15, 2013, 11:35:00 AM
yea. is this really true:

Quote
when i click on filter. i get a massages that says: $rcmail_config['sieverules_host'] = 'localhost';

i've never heard of anything like that before and i have no idea how you could of made it happen.