Author Topic: Managesieve connection problems  (Read 19587 times)

Offline bambam82

  • Jr. Member
  • **
  • Posts: 10
Managesieve connection problems
« on: October 31, 2009, 12:52:36 PM »
Hi, i'm strugling with the sieverules plugin in roundcube.

I've set up roundcube 0.3, dovecot 1.1.15 with the protocol managesieve enabled. Also tested it with this site: ManageSieve/Troubleshooting - Dovecot Wiki

That peace is working.

But, the sieverule filter tab still will not set up a connection to the server...

What could it be i'm doing wrong?

Cheers, Bart

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,539
Managesieve connection problems
« Reply #1 on: October 31, 2009, 01:07:20 PM »
sorry but without any idea of what is wrong it is impossible for people to help. do you get any errors on the screen or in the error log? what version of rc are you using and what version of the plugin, also what browser?
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline hugo

  • Newbie
  • *
  • Posts: 5
Managesieve connection problems
« Reply #2 on: November 02, 2009, 07:08:02 AM »
Quote from: bambam82;22649
But, the sieverule filter tab still will not set up a connection to the server...

What could it be i'm doing wrong?

Cheers, Bart


hi Bart
have you correctly set up your server connection in the plugins/sieverules/config.inc.php?
e.g.

Code: [Select]
// managesieve server address, use %h for user's IMAP hostname
$sieverules_config['managesieve_host'] = 'mailhost.example.com';

Offline bambam82

  • Jr. Member
  • **
  • Posts: 10
Managesieve connection problems
« Reply #3 on: November 03, 2009, 09:22:16 AM »
Quote from: hugo;22708
hi Bart
have you correctly set up your server connection in the plugins/sieverules/config.inc.php?
e.g.

Code: [Select]
// managesieve server address, use %h for user's IMAP hostname
$sieverules_config['managesieve_host'] = 'mailhost.example.com';


Code: [Select]
// managesieve server address, use %h for user's IMAP hostname
$sieverules_config['managesieve_host'] = '127.0.0.1';

// managesieve server port
$sieverules_config['managesieve_port'] = 12000;


Code: [Select]
# telnet localhost 12000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
"IMPLEMENTATION" "Cyrus timsieved v2.2.13"
"SASL" "PLAIN LOGIN DIGEST-MD5"
"SIEVE" "comparator-i;ascii-numeric fileinto reject vacation imapflags notify include envelope body relational regex subaddress copy"
"STARTTLS"
OK "Dovecot ready."


I had used this to test the managesieve server of Dovecot.
ManageSieve/Troubleshooting - Dovecot Wiki

The reply I get when going into the settings and than filters, is dat after a while it says. "Unable to connect to managesieve server"

Version 0.3 of RC
plugin: RoundCube Plugins
latest one.

I hope someone has a more bright idea than I have.

Offline bambam82

  • Jr. Member
  • **
  • Posts: 10
already working
« Reply #4 on: November 23, 2009, 03:25:21 AM »
Quote from: periferral;23274
when i add a new rule to filter by body, i get a message saying it is not supported by the server. im running dovecot 1.2.6 and managesieve server and it seems like filtering by body is supported. what gives?

Well, in this case your server already works. And your already a step further... I'm still stuck without a connection...

btw. I have never used the body to filter messages.

Offline periferral

  • Jr. Member
  • **
  • Posts: 13
Managesieve connection problems
« Reply #5 on: November 23, 2009, 01:23:32 PM »
did you modify config.inc.php since you are running on a non-default port

//$rcmail_config['sieverules_port'] = 2000;
$rcmail_config['sieverules_port'] = 12000;

Offline bambam82

  • Jr. Member
  • **
  • Posts: 10
Managesieve connection problems
« Reply #6 on: November 24, 2009, 02:53:39 AM »
Quote from: periferral;23300
did you modify config.inc.php since you are running on a non-default port

//$rcmail_config['sieverules_port'] = 2000;
$rcmail_config['sieverules_port'] = 12000;


As you can see on page 11:
http://www.roundcubeforum.net/api-based-plugins/4878-sieverules-managesieve-plugin-11.html#post22740

Offline bambam82

  • Jr. Member
  • **
  • Posts: 10
My complete config again, still not working
« Reply #7 on: November 26, 2009, 04:35:03 AM »
# dovecot -n
Code: [Select]

# 1.1.11: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.31-15-generic-pae i686 Ubuntu 9.10 ext3
base_dir: /var/run/dovecot/
log_path: /var/log/dovecot.log
log_timestamp: %Y-%m-%d %H:%M:%S
protocols: imap imaps pop3s managesieve
listen(default): 127.0.0.1:143
listen(imap): 127.0.0.1:143
listen(pop3): *
listen(managesieve): *:2000
ssl_listen: *
ssl_cert_file: /etc/ssl/certs/dovecot.pem
ssl_key_file: /etc/ssl/private/dovecot.pem
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(pop3): /usr/lib/dovecot/pop3-login
login_executable(managesieve): /usr/lib/dovecot/managesieve-login
login_process_size: 96
first_valid_uid: 2000
last_valid_uid: 2000
first_valid_gid: 2000
last_valid_gid: 2000
mail_privileged_group: vmail
mail_location: maildir:/home/mail/%d/%n
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
mail_executable(managesieve): /usr/lib/dovecot/managesieve
mail_plugins(default): quota imap_quota
mail_plugins(imap): quota imap_quota
mail_plugins(pop3): quota
mail_plugins(managesieve):
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3
mail_plugin_dir(managesieve): /usr/lib/dovecot/modules/managesieve
imap_client_workarounds(default): delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep
imap_client_workarounds(imap): delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep
imap_client_workarounds(pop3):
imap_client_workarounds(managesieve):
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
pop3_client_workarounds(managesieve):
sieve_storage(default):
sieve_storage(imap):
sieve_storage(pop3):
sieve_storage(managesieve): /home/mail/%d/%n
sieve(default):
sieve(imap):
sieve(pop3):
sieve(managesieve): /home/mail/%d/%n/.dovecot.sieve
auth default:
  mechanisms: plain login digest-md5
  passdb:
    driver: sql
    args: /etc/dovecot/dovecot-sql.conf
  userdb:
    driver: prefetch
  userdb:
    driver: sql
    args: /etc/dovecot/dovecot-sql.conf
  socket:
    type: listen
    client:
      path: /var/run/dovecot/auth-client
      mode: 432
    master:
      path: /var/run/dovecot/auth-master
      mode: 432
      user: vmail
      group: vmail
plugin:
  quota: maildir
  sieve_dir: /home/mail/%d/%n
  sieve: /home/mail/%d/%n/.dovecot.sieve
  global_script_path: /home/mail/dovecot.sieve.global


# cat config.inc.php
Code: [Select]


// managesieve server port
$rcmail_config['managesieve_port'] = 2000;

// managesieve server address, default is localhost.
// Use %h variable as replacement for user's IMAP hostname
$rcmail_config['managesieve_host'] = 'localhost';

// use or not TLS for managesieve server connection
// it's because I've problems with TLS and dovecot's managesieve plugin
// and it's not needed on localhost
$rcmail_config['managesieve_usetls'] = false;

// default contents of filters script (eg. default spam filter)
$rcmail_config['managesieve_default'] = '/home/mail/dovecot.sieve.global';

// Sieve RFC says that we should use UTF-8 endcoding for mailbox names,
// but some implementations does not covert UTF-8 to modified UTF-7.
// Defaults to UTF7-IMAP for backward compatybility
$rcmail_config['managesieve_mbox_encoding'] = 'UTF7-IMAP';

// I need this because my dovecot (with listescape plugin) uses
// ':' delimiter, but creates folders with dot delimiter
$rcmail_config['managesieve_replace_delimiter'] = '';

// disabled sieve extensions (body, copy, date, editheader, encoded-character,
// envelope, environment, ereject, fileinto, ihave, imap4flags, index,
// mailbox, mboxmetadata, regex, reject, relational, servermetadata,
// spamtest, spamtestplus, subaddress, vacation, variables, virustest, etc.
// Note: not all extensions are implemented
$rcmail_config['managesieve_disabled_extensions'] = array();

// Enables debugging of conversation with sieve server. Logs it into /sieve
$rcmail_config['managesieve_debug'] = false;

?>


While getting the error this showed up in my dovecot.log:
Code: [Select]

dovecot: 2009-11-26 10:26:56 Info: managesieve-login: Disconnected: method=DIGEST-MD5, rip=127.0.0.1, lip=127.0.0.1, secured
dovecot: 2009-11-26 10:26:56 Info: managesieve-login: Disconnected: method=DIGEST-MD5, rip=127.0.0.1, lip=127.0.0.1, secured


And here are some other errors in the log of the website:
Code: [Select]
[26-Nov-2009 10:32:13] "Authentication failed." (3):
[26-Nov-2009 10:32:13] "Authentication failed." (3):
[26-Nov-2009 10:32:13] Not currently in AUTHORISATION state (1):
[26-Nov-2009 10:32:13] Not currently in AUTHORISATION state (1):
[26-Nov-2009 10:32:13] PHP Warning:  asort() expects parameter 1 to be array, boolean given in /home/www/bamweb.nl/mail/roundcube_svn/roundcubemail/plugins/managesieve/managesieve.php on line 550
[26-Nov-2009 10:32:13] PHP Warning:  Invalid argument supplied for foreach() in /home/www/bamweb.nl/mail/roundcube_svn/roundcubemail/plugins/managesieve/managesieve.php on line 552
[26-Nov-2009 10:32:13] Not currently in AUTHORISATION state (1):
[26-Nov-2009 10:32:13] Not currently in AUTHORISATION state (1):
[26-Nov-2009 10:32:13] PHP Warning:  asort() expects parameter 1 to be array, boolean given in /home/www/bamweb.nl/mail/roundcube_svn/roundcubemail/plugins/managesieve/managesieve.php on line 550
[26-Nov-2009 10:32:13] PHP Warning:  Invalid argument supplied for foreach() in /home/www/bamweb.nl/mail/roundcube_svn/roundcubemail/plugins/managesieve/managesieve.php on line 552

Offline bambam82

  • Jr. Member
  • **
  • Posts: 10
also a sieve debug
« Reply #8 on: November 26, 2009, 04:41:20 AM »
Here is also a sieve debug:
Code: [Select]

[26-Nov-2009 10:39:13 +0100]: S: "IMPLEMENTATION" "dovecot"
[26-Nov-2009 10:39:13 +0100]: S: "SASL" "PLAIN LOGIN DIGEST-MD5"
[26-Nov-2009 10:39:13 +0100]: S: "SIEVE" "comparator-i;ascii-numeric fileinto reject vacation imapflags notify include envelope body relational regex subaddress copy"
[26-Nov-2009 10:39:13 +0100]: S: "STARTTLS"
[26-Nov-2009 10:39:13 +0100]: S: "RENAME"
[26-Nov-2009 10:39:13 +0100]: S: OK "Dovecot ready."
[26-Nov-2009 10:39:13 +0100]: C: CAPABILITY
[26-Nov-2009 10:39:13 +0100]: S: "IMPLEMENTATION" "dovecot"
[26-Nov-2009 10:39:13 +0100]: S: "SASL" "PLAIN LOGIN DIGEST-MD5"
[26-Nov-2009 10:39:13 +0100]: S: "SIEVE" "comparator-i;ascii-numeric fileinto reject vacation imapflags notify include envelope body relational regex subaddress copy"
[26-Nov-2009 10:39:13 +0100]: S: "STARTTLS"
[26-Nov-2009 10:39:13 +0100]: S: "RENAME"
[26-Nov-2009 10:39:13 +0100]: S: OK "Capability completed."
[26-Nov-2009 10:39:13 +0100]: C: STARTTLS
[26-Nov-2009 10:39:13 +0100]: S: OK "Begin TLS negotiation now."
[26-Nov-2009 10:39:13 +0100]: STARTTLS negotiation successful
[26-Nov-2009 10:39:13 +0100]: S: "IMPLEMENTATION" "dovecot"
[26-Nov-2009 10:39:13 +0100]: S: "SASL" "PLAIN LOGIN DIGEST-MD5"
[26-Nov-2009 10:39:13 +0100]: S: "SIEVE" "comparator-i;ascii-numeric fileinto reject vacation imapflags notify include envelope body relational regex subaddress copy"
[26-Nov-2009 10:39:13 +0100]: S: "RENAME"
[26-Nov-2009 10:39:13 +0100]: S: OK "TLS negotiation successful."
[26-Nov-2009 10:39:13 +0100]: C: CAPABILITY
[26-Nov-2009 10:39:13 +0100]: S: "IMPLEMENTATION" "dovecot"
[26-Nov-2009 10:39:13 +0100]: S: "SASL" "PLAIN LOGIN DIGEST-MD5"
[26-Nov-2009 10:39:13 +0100]: S: "SIEVE" "comparator-i;ascii-numeric fileinto reject vacation imapflags notify include envelope body relational regex subaddress copy"
[26-Nov-2009 10:39:13 +0100]: S: "RENAME"
[26-Nov-2009 10:39:13 +0100]: S: OK "Capability completed."
[26-Nov-2009 10:39:13 +0100]: C: AUTHENTICATE "DIGEST-MD5"
[26-Nov-2009 10:39:13 +0100]: S: "cmVhbG09IiIsbm9uY2U9IjhORmhtS1dvNkJ0MWU2Snd5YzU3amc9PSIscW9wPSJhdXRoIixjaGFyc2V0PSJ1dGYtOCIsYWxnb3JpdGhtPSJtZDUtc2VzcyI="
[26-Nov-2009 10:39:13 +0100]: C: {0+}
[26-Nov-2009 10:39:13 +0100]: S: "IMPLEMENTATION" "dovecot"
[26-Nov-2009 10:39:13 +0100]: S: "SASL" "PLAIN LOGIN DIGEST-MD5"
[26-Nov-2009 10:39:13 +0100]: S: "SIEVE" "comparator-i;ascii-numeric fileinto reject vacation imapflags notify include envelope body relational regex subaddress copy"
[26-Nov-2009 10:39:13 +0100]: S: "STARTTLS"
[26-Nov-2009 10:39:13 +0100]: S: "RENAME"
[26-Nov-2009 10:39:13 +0100]: S: OK "Dovecot ready."
[26-Nov-2009 10:39:13 +0100]: C: CAPABILITY
[26-Nov-2009 10:39:13 +0100]: S: "IMPLEMENTATION" "dovecot"
[26-Nov-2009 10:39:13 +0100]: S: "SASL" "PLAIN LOGIN DIGEST-MD5"
[26-Nov-2009 10:39:13 +0100]: S: "SIEVE" "comparator-i;ascii-numeric fileinto reject vacation imapflags notify include envelope body relational regex subaddress copy"
[26-Nov-2009 10:39:13 +0100]: S: "STARTTLS"
[26-Nov-2009 10:39:13 +0100]: S: "RENAME"
[26-Nov-2009 10:39:13 +0100]: S: OK "Capability completed."
[26-Nov-2009 10:39:13 +0100]: C: STARTTLS
[26-Nov-2009 10:39:13 +0100]: S: OK "Begin TLS negotiation now."
[26-Nov-2009 10:39:14 +0100]: STARTTLS negotiation successful
[26-Nov-2009 10:39:14 +0100]: S: "IMPLEMENTATION" "dovecot"
[26-Nov-2009 10:39:14 +0100]: S: "SASL" "PLAIN LOGIN DIGEST-MD5"
[26-Nov-2009 10:39:14 +0100]: S: "SIEVE" "comparator-i;ascii-numeric fileinto reject vacation imapflags notify include envelope body relational regex subaddress copy"
[26-Nov-2009 10:39:14 +0100]: S: "RENAME"
[26-Nov-2009 10:39:14 +0100]: S: OK "TLS negotiation successful."
[26-Nov-2009 10:39:14 +0100]: C: CAPABILITY
[26-Nov-2009 10:39:14 +0100]: S: "IMPLEMENTATION" "dovecot"
[26-Nov-2009 10:39:14 +0100]: S: "SASL" "PLAIN LOGIN DIGEST-MD5"
[26-Nov-2009 10:39:14 +0100]: S: "SIEVE" "comparator-i;ascii-numeric fileinto reject vacation imapflags notify include envelope body relational regex subaddress copy"
[26-Nov-2009 10:39:14 +0100]: S: "RENAME"
[26-Nov-2009 10:39:14 +0100]: S: OK "Capability completed."
[26-Nov-2009 10:39:14 +0100]: C: AUTHENTICATE "DIGEST-MD5"
[26-Nov-2009 10:39:14 +0100]: S: "cmVhbG09IiIsbm9uY2U9IlY4ZlhBVDJsbTh0TjhUN21tOE1ZSEE9PSIscW9wPSJhdXRoIixjaGFyc2V0PSJ1dGYtOCIsYWxnb3JpdGhtPSJtZDUtc2VzcyI="
[26-Nov-2009 10:39:14 +0100]: C: {0+}
[26-Nov-2009 10:39:15 +0100]: S: NO "Authentication failed."
[26-Nov-2009 10:39:16 +0100]: S: NO "Authentication failed."

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,539
Managesieve connection problems
« Reply #9 on: November 26, 2009, 05:16:15 AM »
Ok first and most importantly you are in the wrong place, this thread is about the sieverules plugin not the managesieve one.

I cant really help you, the only thing I can suggest is you check the plugin folder and see what version of net_sieve you have, if its the beta one then go Net_Sieve and get the stable one and see if that makes any difference.

If that doesnt work please open a new thread and may be some one who knows more about that plugin can help.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline periferral

  • Jr. Member
  • **
  • Posts: 13
Managesieve connection problems
« Reply #10 on: November 26, 2009, 10:54:21 AM »
@bambam. you are using the managesieve plugin as john suggested.

However, that seems to work for me as well. I checked out the latest svn version from trunk. Not sure how you got it.

One other thing is I noticed your dovecot.conf is missing the lda stuff. Maybe I just overlooked it but something you want to look into

Mine looks like this

protocol lda {
  postmaster_address = postmaster
  mail_plugins = sieve
}

I dont know if mail_plugins defaults to something if it isn't specified.

If you still have little success, check out the latest trunk of managesieve or git checkout johns latest sieverules plugin.

John, maybe you can add the link to your git repos on the first post and also to the website where you host the plugins tar/zip files. I had to google search to find the git repos.

Offline bambam82

  • Jr. Member
  • **
  • Posts: 10
Managesieve connection problems
« Reply #11 on: November 27, 2009, 04:21:44 AM »
Quote from: periferral;23378

However, that seems to work for me as well. I checked out the latest svn version from trunk. Not sure how you got it.

One other thing is I noticed your dovecot.conf is missing the lda stuff. Maybe I just overlooked it but something you want to look into

Mine looks like this

protocol lda {
  postmaster_address = postmaster
  mail_plugins = sieve
}

I dont know if mail_plugins defaults to something if it isn't specified.


I use the trunk from roundcube which has the managesieve plugin. I updated it yesterday.

My protocol LDA settings:
Code: [Select]

protocol lda {
mail_plugins = quota cmusieve

When using dovecot 1.1 cmusieve is being used in the configuration according to dovecot:
LDA/Sieve - Dovecot Wiki

This is all part of the ubuntu package.

I'd like to point out that sieve is working. I've been using it for quite some time, but I'd like to get the managesieve working from roundcube...

Offline periferral

  • Jr. Member
  • **
  • Posts: 13
Managesieve connection problems
« Reply #12 on: November 27, 2009, 11:08:18 AM »
@bambam

just out of curiosity, could you try sieve rather than cmusieve to see if it works well?

I tried cmusieve myself and I couldn't connect to the server. However, this also caused my dovecot server to fail. I changed to sieve and it seemed to work just fine. Its possible this isn't related but just something worth trying.

Also, from the dovecot wiki it seems like sieve supports more things than cmusieve.

Offline bambam82

  • Jr. Member
  • **
  • Posts: 10
Managesieve connection problems
« Reply #13 on: November 27, 2009, 11:21:40 AM »
Quote from: periferral;23407
@bambam

just out of curiosity, could you try sieve rather than cmusieve to see if it works well?

I tried cmusieve myself and I couldn't connect to the server. However, this also caused my dovecot server to fail. I changed to sieve and it seemed to work just fine. Its possible this isn't related but just something worth trying.

Also, from the dovecot wiki it seems like sieve supports more things than cmusieve.


tried sieve. No succes.
CMUsieve is used for version 1.1 of dovecot .
Which version are you using? I bet it is 1.2

Offline periferral

  • Jr. Member
  • **
  • Posts: 13
Managesieve connection problems
« Reply #14 on: November 27, 2009, 11:36:15 AM »
yep. Running 1.2.6
You might want to look at this file again
roundcube/plugins/managesieve/config.inc.php

Even for managesieve, i have the following settings
$rcmail_config['managesieve_port'] = 2000;
$rcmail_config['managesieve_host'] = 'localhost';

Try these rather than the names you use to see if that helps.