Author Topic: Managesieve patch  (Read 57338 times)

Offline kuyaedz

  • Newbie
  • *
  • Posts: 3
trouble applying patch
« Reply #45 on: January 27, 2009, 12:01:08 AM »
I am using roundcube v0.2 stable and I'm unable to apply the patch sieverules.BETA.r2240.patch.

When I try to apply the patch I get the following:

Quote
[root@mail ~]# patch -ul -d /usr/local/www/roundcube/ -p1 < sieverules.BETA.r2240.patch
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -Naur --exclude='*.svn*' roundcube_svn/index.php roundcube_pub/index.php
|--- roundcube_svn/index.php    2009-01-18 11:24:41.000000000 +0000
|+++ roundcube_pub/index.php    2009-01-18 18:46:19.000000000 +0000
--------------------------
Patching file index.php using Plan A...
Hunk #1 succeeded at 193.
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -Naur --exclude='*.svn*' roundcube_svn/plugins/sieverules/add.png roundcube_pub/plugins/sieverules/add.png
|--- roundcube_svn/plugins/sieverules/add.png   1970-01-01 01:00:00.000000000 +0100
|+++ roundcube_pub/plugins/sieverules/add.png   2009-01-18 18:46:18.000000000 +0000
--------------------------
Patching file plugins/sieverules/add.png using Plan A...
patch: **** malformed patch at line 19: diff -Naur --exclude='*.svn*' roundcube/plugins/sieverules/config.inc.php roundcube_pub/plugins/sieverules/config.inc.php


Any tips?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Managesieve patch
« Reply #46 on: January 27, 2009, 04:25:54 AM »
a couple of things. first it looks like the patch may have been altered since you downloaded it from my site, there is no line `diff -Naur --exclude='*.svn*' roundcube/plugins/sieverules/config.inc.php` in my version it is `diff -Naur --exclude='*.svn*' roundcube_svn/plugins/sieverules/config.inc.php`

second if you are patching 0.2stable, the version from the RC website (not the SVN) then this patch will not work. Look in the older versions section and get the one for the release.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline kuyaedz

  • Newbie
  • *
  • Posts: 3
Managesieve patch
« Reply #47 on: January 27, 2009, 05:31:20 PM »
Quote from: JohnDoh;16705

second if you are patching 0.2stable, the version from the RC website (not the SVN) then this patch will not work. Look in the older versions section and get the one for the release.


ok, I reinstalled roundcube to make sure it was pristine and then tried this patch but I get a similar error.

Is there any more info I can give you toward finding the right patch for the right version?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Managesieve patch
« Reply #48 on: January 28, 2009, 10:04:02 AM »
I'm sorry you are having problems but i have run the patches again without problems. I know other people havent had problems either. The best thing i can suggest if the patches dont work for you is that you apply them manually (there is an html version of the diff to help with that).
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline kuyaedz

  • Newbie
  • *
  • Posts: 3
Managesieve patch
« Reply #49 on: January 28, 2009, 10:32:48 AM »
Quote from: JohnDoh;16733
I'm sorry you are having problems but i have run the patches again without problems. I know other people havent had problems either. The best thing i can suggest if the patches dont work for you is that you apply them manually (there is an html version of the diff to help with that).


One last try here..

my install directory is /usr/local/www/roundcube.  The patch has paths for roundcube_svn and roundcube_pub.  Do I need to alter the patch to match my install path?  There has got to be some simple reason why I'm having trouble with this patch and not had trouble with others..

I'm running:
patch -ul -d /usr/local/www/roundcube/ -p1 < sieverules.BETA.r2198.patch

It appears to properly create the add.png and then crashes out on the next file in the patch.

Any other guesses?

Offline nmgl

  • Newbie
  • *
  • Posts: 6
Managesieve patch
« Reply #50 on: February 04, 2009, 09:14:06 AM »
Quote from: kuyaedz;16724
ok, I reinstalled roundcube to make sure it was pristine and then tried this patch but I get a similar error.

Is there any more info I can give you toward finding the right patch for the right version?

I have this error. It is due to the patch command. On FreeBSD, the patch command does not like the diff binary. So, the solution is to use a Linux, install a roundcube and patch it. And after, you can use these files.



Just another question. I see in the author page: More Sieve features like regexp, body, imapflags, comparators. And what about vacation? It's an important feature of Sieve. In my mind.
« Last Edit: February 04, 2009, 09:18:01 AM by nmgl »

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Managesieve patch
« Reply #51 on: February 04, 2009, 10:08:03 AM »
Thanks for the info about FreeBSD, I did not know that. Does it help if you use the --binary option for the patch command?

The sieverules patch has more features than the original script made my Alec, so far from that list it supports regexp, imapflags, comparators, and vacation. The changes are in the changelog but I should probably may them clearer. I will add the supported features to the readme.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline nmgl

  • Newbie
  • *
  • Posts: 6
Managesieve patch
« Reply #52 on: February 06, 2009, 04:01:29 AM »
Quote from: JohnDoh;16841
Thanks for the info about FreeBSD, I did not know that. Does it help if you use the --binary option for the patch command?

There's no --binary option in patch(1).

Quote from: JohnDoh;16841
The sieverules patch has more features than the original script made my Alec, so far from that list it supports regexp, imapflags, comparators, and vacation. The changes are in the changelog but I should probably may them clearer. I will add the supported features to the readme.

And where find this patch? I only know Alec patch (managesieve plugin).

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Managesieve patch
« Reply #53 on: February 08, 2009, 05:35:16 AM »
its the patch this thread is all about... RoundCube Patches
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline ridnhard19

  • Newbie
  • *
  • Posts: 1
Managesieve patch
« Reply #54 on: February 11, 2009, 01:19:45 PM »
This is great!  I've applied this to .2 stable without any issues and its working great thus far with Cyrus IMAP/SIEVE.

Thanks for your hard work on this. :)

Offline nmgl

  • Newbie
  • *
  • Posts: 6
Managesieve patch
« Reply #55 on: February 15, 2009, 04:59:36 AM »
The patch has some errors.
I'm on a GNU/Linux Debian. I download roundcube from official website (0.2-stable). So, I'm on a clean and a from-scratch roundcube. No modifications. I want to use SieveRules patch (BETA.r2264.patch).And, when I apply the patch:

Code: [Select]
root@domain roundcubemail-0.2-stable # patch -ul -d /root/roundcubemail-0.2-stable -p1 < sieverules.BETA.r2264.patch
patching file index.php
Hunk #1 succeeded at 193 (offset -4 lines).
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 #1 FAILED at 288.
Hunk #2 FAILED at 301.
Hunk #3 FAILED at 1080.
Hunk #4 FAILED at 2835.
4 out of 4 hunks FAILED -- saving rejects to file program/js/app.js.rej
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


Code: [Select]
root@domain roundcubemail-0.2-stable # cat program/js/app.js.rej
***************
*** 288,293 ****

        case 'settings':
          this.enable_command('preferences', 'identities', 'save', 'folders', true);

          if (this.env.action=='identities' || this.env.action=='edit-identity' || this.env.action=='add-identity') {
            this.enable_command('add', this.env.identities_level < 2);
--- 288,294 ----

        case 'settings':
          this.enable_command('preferences', 'identities', 'save', 'folders', true);
+         this.enable_command('sieverules', true);

          if (this.env.action=='identities' || this.env.action=='edit-identity' || this.env.action=='add-identity') {
            this.enable_command('add', this.env.identities_level < 2);
***************
*** 300,305 ****
          if (this.env.action=='folders')
            this.enable_command('subscribe', 'unsubscribe', 'create-folder', 'rename-folder', 'delete-folder', true);

          if (this.gui_objects.identitieslist)
            {
            this.identity_list = new rcube_list_widget(this.gui_objects.identitieslist, {multiselect:false, draggable:false, keyboard:false});
--- 301,323 ----
          if (this.env.action=='folders')
            this.enable_command('subscribe', 'unsubscribe', 'create-folder', 'rename-folder', 'delete-folder', true);

+         if ((this.env.action=='sieverules' || this.env.action=='edit-sieverule' || this.env.action=='add-sieverule') && !this.env.sieveruleserror)
+           this.enable_command('add-sieverule', true);
+
+         if (this.env.action=='edit-sieverule' || this.env.action=='add-sieverule')
+           this.enable_command('save-sieverule', 'delete-sieverule', true);
+
+         if (this.gui_objects.sieveruleslist)
+           {
+           this.sievefilters_list = new rcube_list_widget(this.gui_objects.sieveruleslist, {multiselect:false, draggable:false, keyboard:false});
+           this.sievefilters_list.addEventListener('select', function(o){ sieverule_select(o); });
+           this.sievefilters_list.init();
+           this.sievefilters_list.focus();
+
+           if (!isNaN(this.env.iid))
+             this.sievefilters_list.highlight_row(this.env.iid);
+           }
+
          if (this.gui_objects.identitieslist)
            {
            this.identity_list = new rcube_list_widget(this.gui_objects.identitieslist, {multiselect:false, draggable:false, keyboard:false});
***************
*** 1062,1067 ****
          this.delete_folder(props);
          break;

        }

      return obj ? false : true;
--- 1080,1103 ----
          this.delete_folder(props);
          break;

+       case 'sieverules':
+         this.goto_url('sieverules', '', true);
+         break;
+
+       case 'add-sieverule':
+         this.goto_url('add-sieverule', '', true);
+         break;
+
+       case 'save-sieverule':
+         if (sieverules_check_input())
+           this.gui_objects.editform.submit();
+         break;
+
+       case 'delete-sieverule':
+         if (confirm(rcmail.get_label('filterdeleteconfirm')))
+           this.goto_url('delete-sieverule', '_iid=' + this.env.iid, true);
+         break;
+
        }

      return obj ? false : true;
***************
*** 2799,2804 ****
    /*********        user settings methods          *********/
    /*********************************************************/

    this.init_subscription_list = function()
      {
      var p = this;
--- 2835,2844 ----
    /*********        user settings methods          *********/
    /*********************************************************/

+   this.sieverules_updatelist = function(action, name, id) {
+     sieverules_updatelist(action, name, id);
+   }
+
    this.init_subscription_list = function()
      {
      var p = this;

Anybody could say me a roundcube version for this patch?
« Last Edit: February 15, 2009, 05:02:29 AM by nmgl »

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Managesieve patch
« Reply #56 on: February 15, 2009, 06:09:59 AM »
You are using the wrong version of the patch, as it says on the site you need a special version for the 0.2stable tarball becuase of the compressed JS files.

Click on "old versions" under SieveRules and you should see it.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline nmgl

  • Newbie
  • *
  • Posts: 6
Managesieve patch
« Reply #57 on: February 15, 2009, 06:33:08 AM »
Thanks a lot!

(need some help for the french translation?)

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Managesieve patch
« Reply #58 on: February 16, 2009, 06:20:55 AM »
if you could make a french translation that would be create, there is a translator on the website that should show you all the text.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline Nyro

  • Newbie
  • *
  • Posts: 4
Managesieve patch
« Reply #59 on: February 25, 2009, 02:36:00 PM »
Quote from: JohnDoh;17068
if you could make a french translation that would be create, there is a translator on the website that should show you all the text.


Hi JohnDoh,

I can't use your plugin in my roundcube installation.
I just downloaded it from the roundcube website.

I read that I should'nt use the last version but a special one.
I used: sieverules.BETA.r2198.rl.patch

After running the patch command, it's not working. Clicking on the filters tab doesn't do anything at all.

I also tried with the last patched version and it's the same.

Once it will work, I'll be glad to create the French translation ;)