summaryrefslogtreecommitdiff
path: root/lib/KolabAdmin/Sieve/Segment/Forward.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/KolabAdmin/Sieve/Segment/Forward.php')
-rw-r--r--lib/KolabAdmin/Sieve/Segment/Forward.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/KolabAdmin/Sieve/Segment/Forward.php b/lib/KolabAdmin/Sieve/Segment/Forward.php
index eee8fc5..7acf993 100644
--- a/lib/KolabAdmin/Sieve/Segment/Forward.php
+++ b/lib/KolabAdmin/Sieve/Segment/Forward.php
@@ -59,7 +59,7 @@ extends KolabAdmin_Sieve_Segment
{
$this->template = 'if allof (%s' . "\r\n" .
') {' . "\r\n" .
- 'redirect "%s";%s' . "\r\n" .
+ '%s%s' . "\r\n" .
'}' . "\r\n";
parent::__construct($script);
}
@@ -83,6 +83,9 @@ extends KolabAdmin_Sieve_Segment
*/
public function setForwardAddress($address)
{
+ if (empty($address)) {
+ throw new Exception('Please enter a valid e-mail address!');
+ }
$this->_forward_address = $address;
}
@@ -111,8 +114,10 @@ extends KolabAdmin_Sieve_Segment
public function getArguments()
{
$address = $this->getForwardAddress();
- if (empty($address)) {
- throw new Exception('Please enter a valid e-mail address!');
+ if (!empty($address)) {
+ $address = 'redirect "' . $address . '";';
+ } else {
+ $address = '';
}
return array(
($this->isActive()) ? 'true ## forward enabled' : 'false ## forward disabled',