| | |
| | | "x-beenthere", |
| | | ); |
| | | |
| | | const VERSION = '6.0'; |
| | | const VERSION = '6.2'; |
| | | const PROGNAME = 'Roundcube (Managesieve)'; |
| | | const PORT = 4190; |
| | | |
| | |
| | | $include_path .= ini_get('include_path'); |
| | | set_include_path($include_path); |
| | | |
| | | $host = rcube_parse_host($this->rc->config->get('managesieve_host', 'localhost')); |
| | | // Get connection parameters |
| | | $host = $this->rc->config->get('managesieve_host', 'localhost'); |
| | | $port = $this->rc->config->get('managesieve_port'); |
| | | $tls = $this->rc->config->get('managesieve_usetls', false); |
| | | |
| | | $host = rcube_parse_host($host); |
| | | $host = rcube_idn_to_ascii($host); |
| | | |
| | | $port = $this->rc->config->get('managesieve_port'); |
| | | // remove tls:// prefix, set TLS flag |
| | | if (($host = preg_replace('|^tls://|i', '', $host, 1, $cnt)) && $cnt) { |
| | | $tls = true; |
| | | } |
| | | |
| | | if (empty($port)) { |
| | | $port = getservbyname('sieve', 'tcp'); |
| | | if (empty($port)) { |
| | |
| | | 'password' => $this->rc->decrypt($_SESSION['password']), |
| | | 'host' => $host, |
| | | 'port' => $port, |
| | | 'usetls' => $tls, |
| | | 'auth_type' => $this->rc->config->get('managesieve_auth_type'), |
| | | 'usetls' => $this->rc->config->get('managesieve_usetls', false), |
| | | 'disabled' => $this->rc->config->get('managesieve_disabled_extensions'), |
| | | 'debug' => $this->rc->config->get('managesieve_debug', false), |
| | | 'auth_cid' => $this->rc->config->get('managesieve_auth_cid'), |
| | |
| | | |
| | | case 'fileinto': |
| | | case 'fileinto_copy': |
| | | $mailbox = $this->strip_value($mailboxes[$idx]); |
| | | $mailbox = $this->strip_value($mailboxes[$idx], false, false); |
| | | $this->form['actions'][$i]['target'] = $this->mod_mailbox($mailbox, 'in'); |
| | | if ($type == 'fileinto_copy') { |
| | | $type = 'fileinto'; |
| | |
| | | $this->rc->output->command('parent.managesieve_updatelist', |
| | | isset($new) ? 'add' : 'update', |
| | | array( |
| | | 'name' => Q($this->form['name']), |
| | | 'name' => $this->form['name'], |
| | | 'id' => $fid, |
| | | 'disabled' => $this->form['disabled'] |
| | | )); |
| | |
| | | foreach ($list as $idx => $set) { |
| | | $scripts['S'.$idx] = $set; |
| | | $result[] = array( |
| | | 'name' => Q($set), |
| | | 'name' => $set, |
| | | 'id' => 'S'.$idx, |
| | | 'class' => !in_array($set, $this->active) ? 'disabled' : '', |
| | | ); |
| | |
| | | |
| | | private function genid() |
| | | { |
| | | $result = preg_replace('/[^0-9]/', '', microtime(true)); |
| | | return $result; |
| | | return preg_replace('/[^0-9]/', '', microtime(true)); |
| | | } |
| | | |
| | | private function strip_value($str, $allow_html=false) |
| | | private function strip_value($str, $allow_html = false, $trim = true) |
| | | { |
| | | if (!$allow_html) |
| | | if (!$allow_html) { |
| | | $str = strip_tags($str); |
| | | } |
| | | |
| | | return trim($str); |
| | | return $trim ? trim($str) : $str; |
| | | } |
| | | |
| | | private function error_class($id, $type, $target, $elem_prefix='') |
| | |
| | | $fname = $filter['name'] ? $filter['name'] : "#$i"; |
| | | $result[] = array( |
| | | 'id' => $idx, |
| | | 'name' => Q($fname), |
| | | 'name' => $fname, |
| | | 'class' => $filter['disabled'] ? 'disabled' : '', |
| | | ); |
| | | $i++; |