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

Offline JohnDoh

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

Offline cbrace

  • Full Member
  • ***
  • Posts: 75
Sieverules plugin
« Reply #301 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.

Offline JohnDoh

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

Offline cbrace

  • Full Member
  • ***
  • Posts: 75
Sieverules plugin
« Reply #303 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, 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
« Last Edit: May 07, 2011, 03:52:59 PM by cbrace »

Offline JohnDoh

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

Offline №rd

  • Newbie
  • *
  • Posts: 1
Sieverules plugin
« Reply #305 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.

Offline dieterh

  • Newbie
  • *
  • Posts: 1
Sieverules plugin
« Reply #306 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

Offline JohnDoh

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

Offline fritz001

  • Jr. Member
  • **
  • Posts: 22
Sieverules plugin
« Reply #308 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]";
}

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Sieverules plugin
« Reply #309 on: August 06, 2011, 04:11:20 AM »
please try the latest repo version
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline fritz001

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

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Sieverules plugin
« Reply #311 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.
« Last Edit: August 06, 2011, 12:35:24 PM by JohnDoh »
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline fritz001

  • Jr. Member
  • **
  • Posts: 22
Sieverules plugin
« Reply #312 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 !!
« Last Edit: August 06, 2011, 02:31:47 PM by fritz001 »

Offline Cyrille

  • Newbie
  • *
  • Posts: 1
Sieverules plugin
« Reply #313 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) (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) (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

Offline JohnDoh

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