Roundcube Community Forum

 

Sieverules (managesieve) plugin

Started by zoc, May 09, 2009, 05:35:25 AM

Previous topic - Next topic

pixilla

#225
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

JohnDoh

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.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

ender

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.

JohnDoh

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.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

birger

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?

JohnDoh

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.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

birger

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 ;)

JohnDoh

#232
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.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

birger

Quote from: JohnDoh;28998hmmm what version of the plugin are you using?

head CHANGELOG says 2010 04 19

Quotebut 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).

Quotemay 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?

JohnDoh

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.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

birger

Quote from: JohnDoh;28998may 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

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

but i thihnk it should be

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


with that change it works for me

JohnDoh

hmm yea i guess it should be. well spotted, thanks!
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

birger

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:

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

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).

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.

JohnDoh

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.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

roe1234

[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.