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

Offline bouba

  • Jr. Member
  • **
  • Posts: 11
Sieverules plugin
« Reply #30 on: June 10, 2009, 07:40:23 AM »
great great great plugin! Easy to install, easy to use!

congratulation!

Offline nmgl

  • Newbie
  • *
  • Posts: 6
Sieverules plugin
« Reply #31 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?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Sieverules plugin
« Reply #32 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.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline bouba

  • Jr. Member
  • **
  • Posts: 11
Sieverules plugin
« Reply #33 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
( i've used the also this: Howto: ISP-style Email Server with Debian-Etch and Postfix 2.3 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

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Sieverules plugin
« Reply #34 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.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline bouba

  • Jr. Member
  • **
  • Posts: 11
Sieverules plugin
« Reply #35 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 , 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) , 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

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Sieverules plugin
« Reply #36 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).
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline bouba

  • Jr. Member
  • **
  • Posts: 11
Sieverules plugin
« Reply #37 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 :)
« Last Edit: June 16, 2009, 07:15:22 AM by bouba »

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Sieverules plugin
« Reply #38 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.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline timtraver

  • Jr. Member
  • **
  • Posts: 36
Service unavailable
« Reply #39 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
« Last Edit: June 25, 2009, 06:30:40 PM by timtraver »

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Sieverules plugin
« Reply #40 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. :)
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline timtraver

  • Jr. Member
  • **
  • Posts: 36
Sieverules plugin
« Reply #41 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?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Sieverules plugin
« Reply #42 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
0.3b Zip file
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline bouba

  • Jr. Member
  • **
  • Posts: 11
Sieverules plugin
« Reply #43 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! :)

Offline timtraver

  • Jr. Member
  • **
  • Posts: 36
Sieverules plugin
« Reply #44 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.