Release Support > Pending Issues

Cannot connect to managesieve

(1/2) > >>

Abatjour3407:
Hi

I've had this problem for over a year now and never got around to fixing it. I'm running RoundCube 1.4 and whenever I try to add a filter under settings (or even if I click on the filters tab) I get the error message "cannot connect to managesieve". I've scoured Google looking for a solution on numerous occasions, my web host support team don't know the answer and my web developer has been trying to figure this out for a month already... Any help would be greatly appreciated!! If there's any info I can provide that may be useful please ask in the comments. Thanks!

JohnDoh:
Check the config file if the plugin you are using to ensure you have put the correct server information in it. Also may be have a look in the roundcube error log, that may have some more details of why it couldnt connect.

Abatjour3407:
Thanks so much JohnDoh! Such fundamental guidance that I feel has really helped to get closer to the root of the problem. This is what I have found:

Is the problem with the null values and/or the false value (the domain is an https domain - uses a wildcard DV SSL) in the managesieve config file? If so what should these values be/ where would I find them/ where am I already using them?

MANAGESIEVE CONFIG VALUES:
Port: 4190
host: 'localhost'
auth_type: null
auth_cid: null
auth_pw: null
usetls: false
conn_options: null

ERROR MESSAGES IN LOG FILE
<d5104e1a> PHP Error: Unable to connect to managesieve on localhost:4190 in /home/legacy88/msg.legacy.live/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php on line 222 (GET /?_task=settings&_action=plugin.managesieve)

<d5104e1a> PHP Error: Not currently in AUTHORISATION state (GET /?_task=settings&_action=plugin.managesieve)

<d5104e1a> PHP Error: Connection refused (GET /?_task=settings&_action=plugin.managesieve)



THIS IS WHERE THE ERROR IS GENERATED:

public function connect($username, $password) {
// 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_utils::parse_host($host); $host = rcube_utils::idn_to_ascii($host);

// 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') ?: self::PORT;
}

$plugin = $this->rc->plugins->exec_hook('managesieve_connect', array(
 'user' => $username,
'password' => $password,
'host' => $host,
'port' => $port,
'usetls' => $tls,
'auth_type' => $this->rc->config->get('managesieve_auth_type'),
'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'),
'auth_pw' => $this->rc->config->get('managesieve_auth_pw'),
'socket_options' => $this->rc->config->get('managesieve_conn_options') ));

// Handle per-host socket options rcube_utils::parse_socket_options($plugin['socket_options'], $plugin['host']);

// try to connect to managesieve server and to fetch the script
$this->sieve = new rcube_sieve(
$plugin['user'],
$plugin['password'],
$plugin['host'],
$plugin['port'],
$plugin['auth_type'],
$plugin['usetls'],
$plugin['disabled'],
$plugin['debug'],
$plugin['auth_cid'],
$plugin['auth_pw'],
$plugin['socket_options'],
$plugin['gssapi_context'],
$plugin['gssapi_cn']
);
$error =
$this->sieve->error();

if ($error) {
rcube::raise_error(array(
'code' => 403,
'file' => __FILE__,
'line' => __LINE__,
'message' => "Unable to connect to managesieve on $host:$port"
), true, false);
}




Thanks again for your assistance!

Abatjour3407:
Oh and here's where the function connect is being called:

$error = $this->connect($_SESSION['username'], $this->rc->decrypt($_SESSION['password']));
       

alec:
Why are you digging into the code if your problem is with configuration? What are your imap_* settings? Is managesieve service running at all?

Navigation

[0] Message Index

[#] Next page

Go to full version