summaryrefslogtreecommitdiff
path: root/lib/KolabAdmin
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 /lib/KolabAdmin
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).
Diffstat (limited to 'lib/KolabAdmin')
-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
3 files changed, 8 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;'
);
}