diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/KolabAdmin/Sieve/Segment/Forward.php | 11 | ||||
-rw-r--r-- | lib/KolabAdmin/Sieve/Segment/Vacation.php | 10 |
2 files changed, 16 insertions, 5 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', diff --git a/lib/KolabAdmin/Sieve/Segment/Vacation.php b/lib/KolabAdmin/Sieve/Segment/Vacation.php index 96cf66a..a025bc5 100644 --- a/lib/KolabAdmin/Sieve/Segment/Vacation.php +++ b/lib/KolabAdmin/Sieve/Segment/Vacation.php @@ -85,7 +85,7 @@ extends KolabAdmin_Sieve_Segment $this->template = 'if allof (%s' . "\r\n" . '%s,' . "\r\n" . '%s) {' . "\r\n" . - 'vacation :addresses [ %s ] :days %s text:' . "\r\n" . + 'vacation %s :days %s text:' . "\r\n" . '%s' . "\r\n" . '.' . "\r\n" . ';' . "\r\n" . @@ -241,11 +241,17 @@ extends KolabAdmin_Sieve_Segment } else { $react_to_spam = 'true'; } + $addresses = $this->getRecipientAddresses(); + if (!empty($addresses)) { + $addresses = ':addresses [ "' . join('", "', $this->getRecipientAddresses()) . '" ]'; + } else { + $addresses = ''; + } return array( ($this->isActive()) ? 'true, ## vacation enabled' : 'false, ## vacation disabled', $domain, $react_to_spam, - '"' . join('", "', $this->getRecipientAddresses()) . '"', + $addresses, $this->getResendAfter(), $this->getResponse() ); |