Roundcube Community Forum

 

Sieverules (managesieve) plugin

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

Previous topic - Next topic

JohnDoh

ok lets start with the basics... have you configured the problem correctly with the right host address for the managesieve server and the right port? have you checked there is no firewall or anything in the way? can you telnet from your webserver to the managesieve server?
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

starm

just completed the first install, the only issues were human error

corrigan

#257
I really like this plugin, but have a couple issues...

Smartsieve support:
Up until now, we have been using smartsieve to create our filters, and the only reason it can't be just be used is the lack of rule names (and the filename).   It would be great to have it just work without having to do an import, but I understand if I have to import.

Importing- Active ruleset:
I've written an import filter for smartsieve files, and it works fine, but I've noticed that when you do the import it writes out the new sieve file (roundcube.sieve for me), but it does not change the default sieve file until you click the save button inside of a rule.  It should change the default ruleset when the import happens, assuming sieverules_multiplerules is false.

Importing - setting default import:
As we migrate from smartsieve to sieverules, I'd like to avoid the 'No existing filters detected!' screen.  It would be great if there was a setting that let you automatically import the users sieve file, and set it to be active.

Vacation filters:
if you use the 'sieverules_use_elsif' setting, it makes vacation filters really hard or impossible to use.  If it's at the top of your rules, it will intercept all messages and reply to them, but not perform the other rules.  If it's at the bottom, then if any of your other rules applies, then the vacation filter doesn't reply.  I'd like to see the vacation functionality always be an IF, outside of the main if/elseif statement.  This way, the vacation filter could reply to my mails, and my mail could still be filtered (some thought would need to done regarding spam filtering).  Yes, I can change the 'sieverules_use_elsif' setting to be false, but it still feels like a problem.

JohnDoh

QuoteVacation filters:
if you use the 'sieverules_use_elsif' setting, it makes vacation filters really hard or impossible to use. If it's at the top of your rules, it will intercept all messages and reply to them, but not perform the other rules. If it's at the bottom, then if any of your other rules applies, then the vacation filter doesn't reply. I'd like to see the vacation functionality always be an IF, outside of the main if/elseif statement. This way, the vacation filter could reply to my mails, and my mail could still be filtered (some thought would need to done regarding spam filtering). Yes, I can change the 'sieverules_use_elsif' setting to be false, but it still feels like a problem.
-1 from me. i'm not sure how you would explain to some one that some rules work one way while others work completely differently. i think that for the more advanced user there is the advanced user or set elsif to false and use the stop action when you want the script to stop.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

bjorntj

I am just about to switch our webmail system from Horde to Roundcube and was wondering it care should be taken when installing Sieverules? Will the upgrade from horde sieve files to Sieverules go ok or should I monitor the process carefully? Also, can I see any log of the upgrade process?


Regards,

BTJ
Someone wrote:
"I understand that if you play a Windows CD backwards you hear strange Satanic messages"
To which someone replied:
"It's even worse than that; play it forwards and it installs Windows"

JohnDoh

As with any upgrade process you should always take care. If I were you I'd get several different existing sieve filter rule files so I can create and test the import filter. There is no logfile of the import by default although your import filter can write one, both the old and new rule files will exist after the import do you can switch back if needed.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

bjorntj

Here are a few examples...:

# Sieve Filter
# Generated by Ingo (http://www.horde.org/ingo/) (16. aug. 2010, 09:02:55)

require ["vacation", "regex"];

# Vacation
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*" ) {
    if header :regex "Received" "^.*(2010) (\\(.*\\) )?..:..:.. (\\(.*\\) )?(\\+|\\-)....( \\(.*\\))?$" {
    if header :regex "Received" "^.*(Jul) (\\(.*\\) )?.... (\\(.*\\) )?..:..:.. (\\(.*\\) )?(\\+|\\-)....( \\(.*\\))?$" {
    if header :regex "Received" "^.*(19|20|21|22|23|24|25|26|27|28|29|30|31) (\\(.*\\) )?... (\\(.*\\) )?.... (\\(.*\\) )?..:..:.. (\\(.*\\) )?(\\+|\\-)....( \\(.*\\))?$" {
    vacation :days 7 :addresses "[email protected]" :subject "God sommer!  " "Jeg er på ferie nå og er tilbake 16.august. Vennligst kontakt sentralbord pr tlf.nr xx xx xx xx eller på e-post [email protected] og vi skal hjelpe deg med din henvendelse. ";
}
}
if header :regex "Received" "^.*(Aug) (\\(.*\\) )?.... (\\(.*\\) )?..:..:.. (\\(.*\\) )?(\\+|\\-)....( \\(.*\\))?$" {
    if header :regex "Received" "^.*([0 ]1|[0 ]2|[0 ]3|[0 ]4|[0 ]5|[0 ]6|[0 ]7|[0 ]8|[0 ]9|10|11|12|13|14|15) (\\(.*\\) )?... (\\(.*\\) )?.... (\\(.*\\) )?..:..:.. (\\(.*\\) )?(\\+|\\-)....( \\(.*\\))?$" {
    vacation :days 7 :addresses "[email protected]" :subject "God sommer!  " "Jeg er på ferie nå og er tilbake 16.august. Vennligst kontakt sentralbord pr tlf.nr xx xx xx xx eller på e-post [email protected] og vi skal hjelpe deg med din henvendelse. ";
}
}
}

}
# Sieve Filter
# Generated by Ingo (http://www.horde.org/ingo/) (09. aug. 2010, 10:42:56)

# Svartelistet adresser
if address :all :comparator "i;ascii-casemap" :is ["From", "Sender", "Resent-From"] ["[email protected]", "[email protected]", "[email protected]", "[email protected]"]  {
    discard;
    stop;
}
# Sieve Filter
# Generated by Ingo (http://www.horde.org/ingo/) (20. sep. 2010, 06:09:46)

# Videresendinger
if true {
    redirect "[email protected]";
    stop;
}
BTJ
Someone wrote:
"I understand that if you play a Windows CD backwards you hear strange Satanic messages"
To which someone replied:
"It's even worse than that; play it forwards and it installs Windows"

sbriesen

Hello!

I desperately need support for custom imap(4)flags. Here's an example:

require ["imapflags","fileinto"];

if allof (header :is "X-Spam-Flag" "YES") {
   addflag "Junk";
   fileinto "Spam";
}

For my internal workflow, it's necessary to set the "Junk"-Flag additionally to the move to the Spam-Folder.

Currently, sieverules only allows the predefined Flags like \\Flagged, etc. It would be nice, if I could define extra flags like "Junk", "NonJunk" or "$LABEL1", etc. in the config.inc.php. Also an "other..." option would be cool, so the user can set own flags like "$MyOwnFlag".

Would be REALLY nice to see that (easy to implement) feature in one of the next versions. Thanks!

regards,
Stefan

sbriesen

changed for testing:

[sieverules.php]

        private $flags = array('flagread' => '\\\\Seen',
                                        'flagdeleted' => '\\\\Deleted',
                                        'flaganswered' => '\\\\Answered',
                                        'flagdraft' => '\\\\Draft',
                                        'flagflagged' => '\\\\Flagged',
                                        'flagjunk' => 'Junk',
                                        'flagnonjunk' => 'NonJunk',
                                        'flaglabel1' => '$Label1',
                                        'flaglabel2' => '$Label2',
                                        'flaglabel3' => '$Label3',
                                        'flaglabel4' => '$Label4',
                                        'flaglabel5' => '$Label5'
                                        );

works (almost) perfectly. The only odd thing is, that the new flags are displayed as e.g. "[flagnonjunk]". It would be better to display not localized flags with the flagname, i.e. "NonJunk".

JohnDoh

you need to define the text for the flagnonjunk label in your localisation file. also you can define the flag array in your config file already, check the readme.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

boomertsfx

how do I get the sieverules plugin to write the sieve file using imap4flags instead of imapflags?  I tried making imapflags FALSE and imap4flags TRUE but that didn't work.  Right now I just enabled the legacy imapflags in the dovecot.conf but wondering what the proper way is...

JohnDoh

you should not need to change anything in the config for that. the plugin uses imapflags or imap4flags based on the extentions given by the server
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

alavaliant

Greetings,  I'm a support team member of a company who is working on migrating from squirrelmail/avelsieve to roundcube/sieverules.

One of the common feedbacks I've received is that after migrating having 30 rules called 'Unnamed rule X' is a bit hard to sort though  so I've recoded the default avelsieve import plugin provided to the one attached to this message.    This one extracts bits of information from the actions to give a name to each rule.
It seems to work well enough in my testing so I'd like to release it since other people might find it useful.   (gpl2 if you want to worry about license, I don't personally think it's enough code to really work about - mainly mentioning it incase JohnDoh thinks it's useful enough to stick in the repo).



On a side note - the horde/ingo filter I've found is a bit greedy in it's matching,   it kept matching my squirrelmail filter sets until I removed it from my install.    I've not bothered patching it though since I don't have a horde/ingo install on hand to find a better detector function rule with.

alavaliant

Now on a less fun note with both my updated avelsieve import plugin and the default one I'm finding some filter sets are not always importing.   The odd thing is that if I delete the roundcube sieve rule, then change the rules order in squirrelmail and do the import again it often then works.

I'm trying to dig up more information on what fails and why when the rules are in a certain order.   However even with $rcmail_config['sieverules_debug'] = true;
set in my config file I don't seem to get any debugging output in the log file about the actual import itself - I see the avelsieve rule get read in full,  then a truncated squirrelmail rule gets written out with just the requires line and nothing else.

There are no errors in the webserver logs either that I can see,   is there any thing more I can do debugging wise short of patching the code to add a bunch more debug output lines in the import part of the code?

JohnDoh

Thanks for the improved import script. there is no debugging stuff in the import filters by default, they are really only proof on concept.

Its hard to say what might be wrong, could you send me an example file perhaps and may be I can see if its a problem in the import filter or inside the plugin its self.

If it helps a quick way to write info to log files for debuggin in RC is to use the write_log function:
write_log('filename', 'value to log');
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...