Roundcube Community Forum

 

Sieverules (managesieve) plugin

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

Previous topic - Next topic

henlon

Maybe a stupd question.
Is there any way to use the sieverules plugin with hMailserver and RC0.3

If not, is there another plugin to roundcube to manage filetr funtions?

Scarabaeus

To my knowledge (which in some circles is considered very limited), hMailServer does not support RFC 3028 style filtering.
It does have its own server side filtering functionality but I am not aware of any RC plug-ins that can leverage it.
Do a search on the hMailServer forums
http://www.hmailserver.com/forum/index.php
hMailServer 5.3.3 - Build 1879 | ClamAV 0.96.5 (tBB) | SpamAssassin 3.2.3.5
AfterLogic Webmail Pro 6.3.10 | RoundCube 0.7.1
WampServer 2.0i - [ Apache 2.2.11 | MySQL 5.1.36 | PHP 5.3.0 ]

JohnDoh

i have no idea if hMailserver supports managesieve the protocol, there are lots of plugins for it made by rosali, you can see them here Plugin_Repository ? Roundcube Webmail may be one of them can help you.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

Scarabaeus

hMailServer does not support managesieve the protocol. It does have its own server side filtering features, accessable via the hMail Administrator and/or scripting, but i am unaware of any RC plug-ins that leverage this functionality.
regards
hMailServer 5.3.3 - Build 1879 | ClamAV 0.96.5 (tBB) | SpamAssassin 3.2.3.5
AfterLogic Webmail Pro 6.3.10 | RoundCube 0.7.1
WampServer 2.0i - [ Apache 2.2.11 | MySQL 5.1.36 | PHP 5.3.0 ]

gdhgdh

Quote from: JohnDoh;20892If you want to make them all checked by default its easy enough, you'll find where they are generated in sieverules.php around line 1294,

$curaddress = in_array($sql_arr['email'], $vacto_arr) ? $sql_arr['email'] : "";

and just change it to

$curaddress = $sql_arr['email'];

Thanks :) That /nearly/ works (using rcube 0.3 release and the current 'trunk' of sieverules from github)

If I do Filters -> New Filter
Name -> aaaaa
All Messages
Out OF Office MEssage -Period 1 - Message 'z' -> Save

I get this in the user's .dovecot.sieve:

require ["vacation"];
# rule:[aaaaa]
if anyof (true)
{
vacation
:days 1
"z";
}



If I click 'Advanced options' I can see the user's email address is already selected, and pressing 'Save'  makes the ':addresses' line appear.

How can I have the 'Advanced options' box selected by default?

Thanks! :)

JohnDoh

You're quite right. Try this, a few lines above change
$vacto_arr = explode(",", $vacto);To
$vacto = "";
And add this after the original line you changed
$vacto .= ((strlen($vacto) > 0) ? ',' : '') . $sql_arr['email'];
Finally look further up the file for this line
if (!empty($vacfrom) || !empty($vacto) || !empty($handle) || $charset != RCMAIL_CHARSET) {And change it to
if (true) {
the advanced box should always be ticked and the :addresses line added
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

gdhgdh

Hurrah - perfect :) Now may I pick your brain a little more?

If I log into roundcube as 'ar-wbim', the entire email address is populated as [email protected] since I have $rcmail_config['mail_domain'] set to 'ourdomain.com'.

However, we use [email protected], so when the vacation message is set, sieve says "discarding vacation response for message implicitly delivered to " because the RCPT TO:<> address doesn't match.

I have LDAP Address Book w/ autocomplete working fine and can search for both usernames + email addresses, so could I trouble you for a couple of magic lines which would do an LDAP search for 'ar-wbim' and populate the 'Aliases' with the results?

Hence, the :addresses in .dovecot.sieve would cater for the real address and so the vacation will actually work :)

gdhgdh

... just been thinking (yeh, I know..) - if the LDAP lookup was moved to a user's first ever login, the lookup could search for the ar-wbim username and return the user's full name 'Wim Bim' and [email protected] email address to accurately populate their primary Identity.

That would mean no hackery at all would be required in sieverules except perhaps setting the :From address - seems a much cleaner solution :) I'm just thinking out loud now :)

hugo

Quote from: JohnDoh;22412the advanced box should always be ticked and the :addresses line added

hi JohnDoh

we have a cyrus mailserver, and the vacation rule doesn't work if the :addresses line isn't specified. so i tryed to make the changes you suggested.
It still doesn't work as expected. if i make a new vacation rule, the advanced option box is not ticked by default, only after i hit save. then the box is ticked and also all the aliases, but the rule still doesn't have the :addresses line in it. if i untick an alias, tick it back on and hit save, then it adds the :addresses line and the rule works.

our versions are RC 0.3, and the sieverules plugin is 1.1, php 5.2.8, apache 2.2.14

besides this, i have found another bug: if you select the radiobutton 'all messages' and save the rule, you cannot change that anymore (the radiobuttons are still there but selecting anotherone doen't give you the options to select rules).
btw, very nice plugin ;)

greets
hugo.-

JohnDoh

I have added a small hack to the repo version of the plugin to make the :addresses line always added when a vacation message is created, see README for more information.

thanks for the bug report, this is also fixed in the repo version
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

hugo

yo, works like a charm, thanks :D
btw, horde has a checkbox to not respond to bulk and list mails. can you implement something like that in a future version? 0:)
example horde rule:
if allof ( not exists [&quot;list-help&quot;, &quot;list-unsubscribe&quot;, &quot;list-subscribe&quot;, &quot;list-owner&quot;, &quot;list-post&quot;, &quot;list-archive&quot;, &quot;list-id&quot;], not header :comparator &quot;i;ascii-casemap&quot; :is &quot;Precedence&quot; &quot;list,bulk&quot; ) {
    vacation :days 7 :addresses &quot;[email protected]&quot; :subject &quot;bin wech&quot; &quot;urlaub&quot;;
}


greets
hugo.-

JohnDoh

glad it works. about the checkbox, may be in the future but surely you could make a predefiined or example rule to do this, then you can use what ever conditions you want.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

hugo

hey JohnDoh
yep, thanks, already did some predefined rules and an example rule. the predefined ones are ok, but if i put an example rule, it's the same problem again with the identities. to have them show up, i need to put something like this in the example script:
require [&quot;vacation&quot;];
# rule:[ABWESEND]
if allof (not exists [&quot;list-help&quot;, &quot;list-unsubscribe&quot;, &quot;list-subscribe&quot;, &quot;list-owner&quot;, &quot;list-post&quot;, &quot;list-archive&quot;, &quot;list-id&quot;],
not header :is &quot;Precedence&quot; &quot;list, bulk&quot;)
{
vacation
:days 7
:addresses [&quot;&quot;,&quot;&quot;]
:subject &quot;ABWESEND&quot;
text:
*NOT AVAILABLE*
;
}

if i omit the ':addresses ["",""]' part, then the advanced options checkbox is again disabled and no identities checked by default. if it is like this, the adv. box is checked but the identities are still unchecked.
any thoughts?
thanks again for the patience ;)

JohnDoh

hmmm yes example rules should probably override the protection, it cant test it right now but i have put an update in the repo which should fix it.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

hugo

just tryed it out. sorry, no difference, same behaviour.