Author Topic: Managesieve patch  (Read 57343 times)

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Managesieve patch
« Reply #60 on: February 26, 2009, 03:36:52 AM »
are there any JS errors or errors in the RC log? the file with .rl. in the name is the right one for the 0.2stable release. did it apply cleanly? it is possible that all you need to do is clear you cache, without any errors i cant tell what is wrong.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline Nyro

  • Newbie
  • *
  • Posts: 4
Managesieve patch
« Reply #61 on: February 26, 2009, 03:47:21 AM »
Quote from: JohnDoh;17315
are there any JS errors or errors in the RC log? the file with .rl. in the name is the right one for the 0.2stable release. did it apply cleanly? it is possible that all you need to do is clear you cache, without any errors i cant tell what is wrong.


Looks like you're right.
After cleaning my cache it worked perfectly...
Sorry for the noob error...

Attached are my translating files.
Hope it fits good, if an other French guy could review them to be sure it looks great regarding the sieve stuff (I'm totally new with that, so the French term could be different)

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Managesieve patch
« Reply #62 on: February 26, 2009, 02:00:49 PM »
thats great thanks, i have added them to the site :D
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline zamri

  • Jr. Member
  • **
  • Posts: 16
Managesieve patch
« Reply #63 on: March 08, 2009, 05:00:12 AM »
I use dbmail-timsieved which is compatible with cyrus-timsieve. I discovered that Sender is not working to filter emails based on sender. I discovered that roundcube used X-Sender. I tried to use that to filter mails by sender and it works.

How to adjust it to Sender by default. I mean Sender is actually means filter by X-Sender and users shouldn't be bothered to select other header?

i use dbmail 2.2.10 and roundcube 0.2stable.

Keep up with the good work John!. :)

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Managesieve patch
« Reply #64 on: March 08, 2009, 06:13:18 AM »
Thanks.

Look in program/steps/settings/edit_sieverule.inc. Find `'from' => 'address::Sender',` and replace it with `'from' => 'header::X-Sender',`. I cant test it right now but I think it will work.

I had not realised that RC always uses X-Sender. Perhaps I should modify the code so when you look for Sender it checks both Sender and X-Sender automatically. What does everyone think? Can any one think of a better solution?
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline zamri

  • Jr. Member
  • **
  • Posts: 16
Managesieve patch
« Reply #65 on: March 08, 2009, 06:51:59 AM »
Well i think you should put X-Sender instead of Sender in the dropdown list by default and get rid of Sender. Maybe in the future if RC revert to Sender, you can change it accordingly. :)

Any better idea?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Managesieve patch
« Reply #66 on: March 08, 2009, 02:16:13 PM »
I dont want to do that for 2 reasons, the first is a, slightly stupid, UI one, the option is called Sender not X-Sender and the second is that although RC uses X-Sender other clients use Sender, so simply switching from one to the other will solve nothing. ATM I am really not sure what the best solution is.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline zamri

  • Jr. Member
  • **
  • Posts: 16
Managesieve patch
« Reply #67 on: March 10, 2009, 05:57:47 AM »
Do u think RC shoud use Sender instead of X-Sender?

Offline zamri

  • Jr. Member
  • **
  • Posts: 16
Managesieve patch
« Reply #68 on: March 11, 2009, 07:39:05 AM »
I applied sieverules.BETA.r2264.patch into http://nightly.roundcube.net/trunk/roundcubemail-trunk-r2332-20090306.tgz successfully.

patching file index.php                                                                    
patching file plugins/sieverules/add.png                                                    
patching file plugins/sieverules/config.inc.php                                            
patching file plugins/sieverules/help.png                                                  
patching file plugins/sieverules/Net_Sieve.php                                              
patching file plugins/sieverules/rcube_sieve.php                                            
patching file plugins/sieverules/rcube_sieve_script.php                                    
patching file plugins/sieverules/sieverules_func.inc                                        
patching file plugins/sieverules/sieverules.php                                            
patching file program/js/app.js                                                            
Hunk #4 succeeded at 2839 (offset 4 lines).                                                
patching file program/js/sieverules.js                                                      
patching file program/localization/en_US/labels.inc                                        
patching file program/localization/en_US/messages.inc                                      
patching file program/steps/settings/delete_sieverule.inc                                  
patching file program/steps/settings/edit_sieverule.inc                                    
patching file program/steps/settings/save_sieverule.inc                                    
patching file program/steps/settings/sieverules_ajax.inc                                    
patching file program/steps/settings/sieverules.inc                                        
patching file skins/default/functions.js                                                    
patching file skins/default/includes/settingstabs.html                                      
patching file skins/default/sieverules.css                                                  
patching file skins/default/templates/editsieverule.html                                    
patching file skins/default/templates/sieverules.html        

When I clicked on the filter tab nothing happened. The reason I want to use this RC trunk is because it loads faster and many bugs have been fixed since 0.2stable.

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Managesieve patch
« Reply #69 on: March 11, 2009, 10:05:03 AM »
well you can see from the output that the patch did not apply cleanly but i expect it is simply a caching issue, clear your cache and try again.

Also version 0.2.1 of RC has just been realsed, there are new versions of the patches for that.

about the X-Sender thing, no i dont think RC should use Sender, that should only be used when you are sure what you are putting in there is a valid email address.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline zamri

  • Jr. Member
  • **
  • Posts: 16
Managesieve patch
« Reply #70 on: March 11, 2009, 10:36:51 AM »
But it WORKED JOhn. I just have to relogin or clear browser's cache. thanks.

Offline roe1234

  • Jr. Member
  • **
  • Posts: 20
0d0a
« Reply #71 on: March 12, 2009, 12:00:17 PM »
I am trying to bring in an existing sieve filter file so that this patch recognizes the rules.  However, even though I did my best to make the file format *exactly* what this patch expects, still no dice.  The only difference I see is on a hex dump, the pattern this plug-in expects is '0a' (LF) but the characters I am supplying are '0d0a' (CR+LF).  I will work on trying to convert my file to jus 0a but I think this is a bug, if for no other reason 0d0a is more "correct"

**UPDATE**
Sorry got my dos and unix mixed up.  This is not anything to fix on your end
« Last Edit: March 12, 2009, 12:07:27 PM by roe1234 »

Offline roe1234

  • Jr. Member
  • **
  • Posts: 20
List of folders
« Reply #72 on: March 12, 2009, 12:26:47 PM »
A use case scenario that might not have been thought of...

I am building sieve filters through the plugin while looking at the folders available in Tbird.  If a folder doesn't exist I create it in tbird (much quicker) but the roundcube plug-doesn't see the new folder until I logout and then log back in.

I'm not sure what can be done about this... perhaps populating that dropdown via javascript?

Offline roe1234

  • Jr. Member
  • **
  • Posts: 20
0d0a revisited
« Reply #73 on: March 12, 2009, 06:39:31 PM »
Well after further analysis, I found from the RFC:

RFC 5228           Sieve: An Email Filtering Language       January 2008


2.2.  Whitespace

   Whitespace is used to separate tokens.  Whitespace is made up of
   tabs, newlines (CRLF, never just CR or LF), and the space character.
   The amount of whitespace used is not significant.


So I guess this bug *is* a bug for the roundcube plugin

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Managesieve patch
« Reply #74 on: March 14, 2009, 06:02:06 AM »
hmm i did not know that. It doesnt seem to stop my script working though, may be dovecot just doesnt care.

As a temporary fix you can swap
Code: [Select]
if ($tokens = preg_split('/(# rule:\[.*\])\n/', $script, -1, PREG_SPLIT_DELIM_CAPTURE)) {for
Code: [Select]
if ($tokens = preg_split('/(# rule:\[.*\])\r?\n/', $script, -1, PREG_SPLIT_DELIM_CAPTURE)) {in plugins/sieverules/rcube_sieve_script.php
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…