summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@pardus.de>2010-04-13 09:29:51 (GMT)
committerGunnar Wrobel <wrobel@pardus.de>2010-04-13 09:29:51 (GMT)
commitc24d7697447587d4c6719784f477dfcd16ca4f12 (patch)
tree121a6fe5330af1f3bf82e00776f9c2be060e8bb3
parent9d409a4e7fbf63740ee55a87afa75ee17b06bac2 (diff)
downloadkolab-webadmin-c24d7697447587d4c6719784f477dfcd16ca4f12.tar.gz
Fix delivery to folders containing umlauts for the cyrus server. Do not duplicate mails when activating forwarding and delivery at the same time (and keeping mails on the server).
-rw-r--r--lib/KolabAdmin/Sieve.php5
-rw-r--r--lib/KolabAdmin/Sieve/Segment/Delivery.php6
-rw-r--r--lib/KolabAdmin/Sieve/Segment/Forward.php2
-rw-r--r--www/admin/user/deliver.php.in1
-rw-r--r--www/admin/user/forward.php.in1
-rw-r--r--www/admin/user/vacation.php.in1
6 files changed, 11 insertions, 5 deletions
diff --git a/lib/KolabAdmin/Sieve.php b/lib/KolabAdmin/Sieve.php
index 3dbb6c0..d37fd9c 100644
--- a/lib/KolabAdmin/Sieve.php
+++ b/lib/KolabAdmin/Sieve.php
@@ -157,8 +157,9 @@ class KolabAdmin_Sieve
public function getScript()
{
$script = 'require "fileinto";' . "\r\n" . 'require "vacation";' . "\r\n\r\n\r\n";
- foreach ($this->_segments as $segment) {
- $script .= $segment->generate() . "\r\n\r\n";
+ $order = array('vacation', 'forward', 'delivery');
+ foreach ($order as $segment) {
+ $script .= $this->_segments[$segment]->generate() . "\r\n\r\n";
}
return $script;
}
diff --git a/lib/KolabAdmin/Sieve/Segment/Delivery.php b/lib/KolabAdmin/Sieve/Segment/Delivery.php
index 1addd51..b5f5a4d 100644
--- a/lib/KolabAdmin/Sieve/Segment/Delivery.php
+++ b/lib/KolabAdmin/Sieve/Segment/Delivery.php
@@ -83,7 +83,9 @@ extends KolabAdmin_Sieve_Segment
{
return array(
($this->isActive()) ? 'true, ## delivery enabled' : 'false, ## delivery disabled',
- $this->getDeliveryFolder()
+ // UTF7-conversion handles a specific cyrus bug. This does not work
+ // when using dovecot for example. The sieve RFC requires UTF8.
+ String::convertCharset($this->getDeliveryFolder(), 'utf-8', 'utf7-imap')
);
}
@@ -95,7 +97,7 @@ extends KolabAdmin_Sieve_Segment
public function parseDeliveryFolder($script)
{
if (preg_match("/fileinto \"INBOX\/([^\"]*)\";/", $script, $regs)) {
- $this->setDeliveryFolder($regs[1]);
+ $this->setDeliveryFolder(String::convertCharset($regs[1], 'utf7-imap', 'utf-8'));
}
}
} \ No newline at end of file
diff --git a/lib/KolabAdmin/Sieve/Segment/Forward.php b/lib/KolabAdmin/Sieve/Segment/Forward.php
index c3febc1..3252b5f 100644
--- a/lib/KolabAdmin/Sieve/Segment/Forward.php
+++ b/lib/KolabAdmin/Sieve/Segment/Forward.php
@@ -122,7 +122,7 @@ extends KolabAdmin_Sieve_Segment
return array(
($this->isActive()) ? 'true ## forward enabled' : 'false ## forward disabled',
$address,
- ($this->getKeepOnServer()) ? ' keep;' : ''
+ ($this->getKeepOnServer()) ? '' : ' stop;'
);
}
diff --git a/www/admin/user/deliver.php.in b/www/admin/user/deliver.php.in
index 7c4f6ae..9c4067f 100644
--- a/www/admin/user/deliver.php.in
+++ b/www/admin/user/deliver.php.in
@@ -22,6 +22,7 @@ require_once '@kolab_php_module_prefix@admin/include/mysmarty.php';
require_once '@kolab_php_module_prefix@admin/include/headers.php';
require_once '@kolab_php_module_prefix@admin/include/authenticate.php';
require_once 'Net/Sieve.php';
+require_once 'Horde/String.php';
require_once 'KolabAdmin/Sieve.php';
require_once 'KolabAdmin/Sieve/Script.php';
require_once 'KolabAdmin/Sieve/Segment.php';
diff --git a/www/admin/user/forward.php.in b/www/admin/user/forward.php.in
index 3d8bae0..f43f0de 100644
--- a/www/admin/user/forward.php.in
+++ b/www/admin/user/forward.php.in
@@ -23,6 +23,7 @@ require_once '@kolab_php_module_prefix@admin/include/headers.php';
require_once('@kolab_php_module_prefix@admin/include/locale.php');
require_once '@kolab_php_module_prefix@admin/include/authenticate.php';
require_once 'Net/Sieve.php';
+require_once 'Horde/String.php';
require_once 'KolabAdmin/Sieve.php';
require_once 'KolabAdmin/Sieve/Script.php';
require_once 'KolabAdmin/Sieve/Segment.php';
diff --git a/www/admin/user/vacation.php.in b/www/admin/user/vacation.php.in
index 2c95e79..028fa8a 100644
--- a/www/admin/user/vacation.php.in
+++ b/www/admin/user/vacation.php.in
@@ -11,6 +11,7 @@ require_once '@kolab_php_module_prefix@admin/include/headers.php';
require_once('@kolab_php_module_prefix@admin/include/locale.php');
require_once '@kolab_php_module_prefix@admin/include/authenticate.php';
require_once 'Net/Sieve.php';
+require_once 'Horde/String.php';
require_once 'KolabAdmin/Sieve.php';
require_once 'KolabAdmin/Sieve/Script.php';
require_once 'KolabAdmin/Sieve/Segment.php';