1

Topic: Problems with imap and RoundCube. LOGIN: Internal error occurred

==== Required information ====
- iRedMail version: 0.9.2
- Linux/BSD distribution name and version: Ubuntu 14.04.3 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro: No
- Related log if you're reporting an issue:
====

Hi I set up iRedMail recently, and am having problem related to roundcube, dovecot & imap and may be with something else.
Authentication failed for imap after a while (not always, but at different times) when working with RoundCube. When trying to log in to roundcube all works fine, but after that troubles begins at random.

RoundCube reports an error: Server Error: LOGIN: Internal error occured. Refer to server log for more information.

In /var/log/dovecot.log:
Nov 03 15:45:51 config: Panic: file settings-parser.c: line 1925 (settings_copy_deflist_unique): assertion failed: (dest_count == ccount)
Nov 03 15:45:51 config: Error: Raw backtrace: /usr/lib/dovecot/libdovecot.so.0(+0x5e271) [0x7f41a1cca271] -> /usr/lib/dovecot/libdovecot.so.0(+0x5e34e) [0x7f41a1cca34e] -> /usr/lib/dovecot/libdovecot.so.0(i_fatal+0) [0x7f41a1c85a9e] -> /usr/lib/dovecot/libdovecot.so.0(+0x29bf2) [0x7f41a1c95bf2] -> /usr/lib/dovecot/libdovecot.so.0(+0x29932) [0x7f41a1c95932] -> /usr/lib/dovecot/libdovecot.so.0(settings_parser_apply_changes+0x7d) [0x7f41a1c966bd] -> dovecot/config(config_filter_parsers_get+0x51e) [0x7f41a216729e] -> dovecot/config(config_export_by_filter+0x32) [0x7f41a2169f32] -> dovecot/config(+0xd580) [0x7f41a2166580] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x27) [0x7f41a1cda247] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0xd7) [0x7f41a1cdafd7] -> /usr/lib/dovecot/libdovecot.so.0(io_loop_run+0x38) [0x7f41a1cd9de8] -> /usr/lib/dovecot/libdovecot.so.0(master_service_run+0x13) [0x7f41a1c8ac93] -> dovecot/config(main+0xab) [0x7f41a216468b] -> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f41a18c8ec5] -> dovecot/config(+0xb6f3) [0x7f41a21646f3]
Nov 03 15:45:51 imap(support@mydomain.com): Error: user support@mydomain.com: Error reading configuration: read(/var/run/dovecot/config) failed: EOF
Nov 03 15:45:51 imap(support@mydomain.com): Error: Internal error occurred. Refer to server log for more information.
Nov 03 15:45:51 config: Fatal: master: service(config): child 23547 killed with signal 6 (core dumps disabled)

Help please. Thank you.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Problems with imap and RoundCube. LOGIN: Internal error occurred

demosos wrote:

Nov 03 15:45:51 imap(support@mydomain.com): Error: user support@mydomain.com: Error reading configuration: read(/var/run/dovecot/config) failed: EOF

No detailed error message, i wonder whether the Dovecot config file has correct file owner and permission on your server. It should be owned by 'root:root', permission 0664.

3

Re: Problems with imap and RoundCube. LOGIN: Internal error occurred

I've tried to set various permissions for /var/run/dovecot/config and /etc/dovecot/dovecot.conf but nothing changed. I still get the same errors.

mail:~# stat /etc/dovecot/dovecot.conf
  File: ‘/etc/dovecot/dovecot.conf’
  Size: 10199           Blocks: 24         IO Block: 4096   regular file
Device: 902h/2306d      Inode: 2230276     Links: 1
Access: (0664/-rw-rw-r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2015-11-03 18:27:54.082901756 +0300
Modify: 2015-11-03 18:27:28.750901988 +0300
Change: 2015-11-03 18:27:28.750901988 +0300
Birth: -

mail:~# stat /var/run/dovecot/config
  File: ‘/var/run/dovecot/config’
  Size: 0               Blocks: 0          IO Block: 4096   socket
Device: 10h/16d Inode: 2659678     Links: 1
Access: (0777/srwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2015-11-03 18:52:03.654888484 +0300
Modify: 2015-11-03 18:29:22.614900946 +0300
Change: 2015-11-03 18:51:50.290888607 +0300
Birth: -

It seems that there is a mistake somewhere inside the /etc/dovecot/dovecot.conf. But I have not changed it since installation of iRedMail server.

4

Re: Problems with imap and RoundCube. LOGIN: Internal error occurred

Could you please compare your /etc/dovecot/dovecot.conf with our sample config file?
https://bitbucket.org/zhb/iredmail/src/ … cot22.conf

Any difference?

5

Re: Problems with imap and RoundCube. LOGIN: Internal error occurred

I've compared these two files. There is no much difference. Here is the result of diff:

mail:~# diff dovecot22.conf /etc/dovecot/dovecot.conf
6c6
< listen = * [::]
---
> listen = *, [::]
8c8
< #base_dir = PH_BASE_DIR
---
> #base_dir = /var/run/dovecot
12c12
< protocols = PH_PROTOCOLS
---
> protocols = pop3 imap sieve lmtp
15,16c15,16
< mail_uid = PH_MAIL_UID
< mail_gid = PH_MAIL_GID
---
> mail_uid = 2000
> mail_gid = 2000
19,20c19,20
< first_valid_uid = PH_FIRST_VALID_UID
< last_valid_uid = PH_LAST_VALID_UID
---
> first_valid_uid = 2000
> last_valid_uid = 2000
23c23
< log_path = PH_LOG_PATH
---
> log_path = /var/log/dovecot.log
39,41c39,41
< #ssl_ca = </path/to/ca
< ssl_cert = <PH_SSL_CERT
< ssl_key = <PH_SSL_KEY
---
> #ssl_ca =</path/to/ca
> ssl_cert = </etc/ssl/certs/iRedMail.crt
> ssl_key = </etc/ssl/private/iRedMail.key
44c44
< ssl_cipher_list = PH_SSL_CIPHERS
---
> ssl_cipher_list = ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
47,48c47,48
< #ssl_dh_parameters_length = 2048
< #ssl_prefer_server_ciphers = yes
---
> ssl_dh_parameters_length = 2048
> ssl_prefer_server_ciphers = yes
67c67
< auth_default_realm = PH_AUTH_DEFAULT_REALM
---
> auth_default_realm =
73,74c73,74
< # Default is 100. This can be overridden by `process_limit =` in
< # `service [protocol]` block.
---
> # Default is 100.
> # Note: this value can be overrided by "process_limit =" in service protocol.
83,85c83,85
<     unix_listener PH_POSTFIX_CHROOT_DIR/private/dovecot-auth {
<         user = PH_DOVECOT_AUTH_USER
<         group = PH_DOVECOT_AUTH_GROUP
---
>     unix_listener /var/spool/postfix/private/dovecot-auth {
>         user = postfix
>         group = postfix
89,90c89,90
<         user = PH_AUTH_MASTER_USER
<         group = PH_AUTH_MASTER_GROUP
---
>         user = vmail
>         group = vmail
94,95c94,95
<         user = PH_AUTH_MASTER_USER
<         group = PH_AUTH_MASTER_GROUP
---
>         user = vmail
>         group = vmail
103c103
<     user = PH_AUTH_MASTER_USER
---
>     user = vmail
115,117c115,117
<     unix_listener PH_POSTFIX_CHROOT_DIR/private/dovecot-lmtp {
<         user = PH_DOVECOT_AUTH_USER
<         group = PH_DOVECOT_AUTH_GROUP
---
>     unix_listener /var/spool/postfix/private/dovecot-lmtp {
>         user = postfix
>         group = postfix
122c122
<         # Listen on localhost (ipv4)
---
>         # Listen on localhost
130,131c130,131
<     args = PH_USERDB_ARGS
<     driver = PH_USERDB_DRIVER
---
>     args = /etc/dovecot/dovecot-mysql.conf
>     driver = sql
134,135c134,135
<     args = PH_PASSDB_ARGS
<     driver = PH_PASSDB_DRIVER
---
>     args = /etc/dovecot/dovecot-mysql.conf
>     driver = sql
146c146
<     args = PH_DOVECOT_MASTER_USER_PASSWORD_FILE
---
>     args = /etc/dovecot/dovecot-master-users
151c151
<     auth_socket_path = PH_DOVECOT_AUTH_MASTER_PATH
---
>     auth_socket_path = /var/run/dovecot/auth-master
153,155c153
<     # Quota configuration.
<     # Reference: http://wiki2.dovecot.org/Quota/Configuration
<     quota = PH_QUOTA_TYPE
---
>     quota = dict:user::proxy::quotadict
162d159
<     #
165,180c162,164
<     #
<     # Only the command for the first exceeded limit is executed, so configure
<     # the highest limit first.
<     quota_warning = storage=100%% quota-warning 100 %u
<     quota_warning2 = storage=95%% quota-warning 95 %u
<     quota_warning3 = storage=90%% quota-warning 90 %u
<     quota_warning4 = storage=85%% quota-warning 85 %u
<
<     # allow user to become max 10% (or 50 MB) over quota
<     quota_grace = 10%%
<     #quota_grace = 50 M
<
<     # Custom Quota Exceeded Message.
<     # You can specify the message directly or read the message from a file.
<     #quota_exceeded_message = Quota exceeded, please try again later.
<     #quota_exceeded_message = </path/to/quota_exceeded_message.txt
---
>     quota_warning = storage=85%% quota-warning 85 %u
>     quota_warning2 = storage=90%% quota-warning 90 %u
>     quota_warning3 = storage=95%% quota-warning 95 %u
199c183
<     sieve = %Lh/sieve/PH_SIEVE_RULE_FILENAME
---
>     sieve = %Lh/sieve/dovecot.sieve
202c186
<     sieve_global_dir = PH_SIEVE_DIR
---
>     sieve_global_dir = /var/vmail/sieve
208c192
<     sieve_before = PH_GLOBAL_SIEVE_FILE
---
>     sieve_before = /var/vmail/sieve/dovecot.sieve
211,217d194
<     # The maximum number of redirect actions that can be performed during a
<     # single script execution.
<     # The meaning of 0 differs based on your version. For pigeonhole-0.3.0 and
<     # beyond this means that redirect is prohibited. For older versions,
<     # however, this means that the number of redirects is unlimited.
<     #sieve_max_redirects = 4
<
226c203
<     executable = script PH_QUOTA_WARNING_SCRIPT
---
>     executable = script /usr/local/bin/dovecot-quota-warning.sh
228,229c205,206
<         user = PH_QUOTA_WARNING_USER
<         group = PH_QUOTA_WARNING_GROUP
---
>         user = vmail
>         group = vmail
237,238c214,215
<         user = PH_SERVICE_DICT_USER
<         group = PH_SERVICE_DICT_GROUP
---
>         user = vmail
>         group = vmail
244,245c221,222
<     quotadict = PH_DOVECOT_REALTIME_QUOTA_SQLTYPE:PH_DOVECOT_REALTIME_QUOTA_CONF
<     acl = PH_DOVECOT_SHARE_FOLDER_SQLTYPE:PH_DOVECOT_SHARE_FOLDER_CONF
---
>     quotadict = mysql:/etc/dovecot/dovecot-used-quota.conf
>     acl = mysql:/etc/dovecot/dovecot-share-folder.conf
251,252c228,229
<     auth_socket_path = PH_DOVECOT_AUTH_MASTER_PATH
<     log_path = PH_DOVECOT_SIEVE_LOG_FILE
---
>     auth_socket_path = /var/run/dovecot/auth-master
>     log_path = /var/log/dovecot-sieve.log
260c237
<     info_log_path = PH_DOVECOT_LMTP_LOG_FILE
---
>     info_log_path = /var/log/dovecot-lmtp.log
279c256
<     mail_max_userip_connections = 30
---
>     mail_max_userip_connections = 20
289c266
<     mail_max_userip_connections = 30
---
>     mail_max_userip_connections = 20
302a280
>     #process_limit = $default_process_limit
317c295
<         # Listen on localhost (ipv4)
---
>         # Listen on localhost
330,333d307
<     # Refer to document for more details about alias mailbox:
<     # http://wiki2.dovecot.org/MailboxSettings
<     #
<     # Sent
337a312,313
>     # This is an alias mailbox for "Sent".
>     # Reference: http://wiki2.dovecot.org/MailboxSettings
342,345d317
<     mailbox "Sent Items" {
<         auto = no
<         special_use = \Sent
<     }
351,352d322
<
<     # Trash
358,363d327
<     mailbox "Deleted Messages" {
<         auto = no
<         special_use = \Trash
<     }
<
<     # Junk
367a332
>     # Alias mailbox for "Junk".
371,384d335
<     }
<     mailbox "Junk E-mail" {
<         auto = no
<         special_use = \Junk
<     }
<
<     # Archive
<     mailbox Archive {
<         auto = subscribe
<         special_use = \Archive
<     }
<     mailbox Archives {
<         auto = no
<         special_use = \Archive

6

Re: Problems with imap and RoundCube. LOGIN: Internal error occurred

No big difference.

Any error/warning message in /var/log/dovecot.log right after restarted Dovecot service?

If no hint in log file, i'm afraid that you'd better ask support in Dovecot mailing list instead.

7

Re: Problems with imap and RoundCube. LOGIN: Internal error occurred

I've installed the latest version of the Dovecot from the official repository http://www.dovecot.org/ and got the same errors. So I've just commented out the line 1962 in src/lib-settings/settings-parser.c and recompiled the source of Dovecot for workaround. Now i'm happy.

8

Re: Problems with imap and RoundCube. LOGIN: Internal error occurred

Did you report this error in Dovecot mailing list? if you didn't report it, developers may not know this issue and not fix it in new Dovecot releases.

9

Re: Problems with imap and RoundCube. LOGIN: Internal error occurred

I don’t think that there is an issue in Dovecot.
Many other errors related to MySQL appeared after I've commented out these lines.
I did a little research and my understanding was that problems were supposed to be connected with quota and acl features.
So I just have commented out all lines related to quota and acl in the dovecot.conf and all errors disappeared in a moment.