outroll / vesta

VESTA Control Panel
http://vestacp.com
GNU General Public License v3.0
2.92k stars 1.02k forks source link

Roundcube "Connection to storage server failed." #1716

Open franciscopaniskaseker opened 5 years ago

franciscopaniskaseker commented 5 years ago

Operating System (OS/VERSION):

Ubuntu 16.04

VestaCP Version:

root@serv1:~# dpkg -l | egrep -i vesta
ii  vesta                             0.9.8-22                                   amd64        Vesta
ii  vesta-ioncube                     0.9.8-21                                   amd64        ionCube Loader for Vesta
ii  vesta-nginx                       0.9.8-22                                   amd64        Vesta Nginx
ii  vesta-php                         0.9.8-22                                   amd64        Vesta php-fpm
ii  vesta-softaculous                 0.9.8-21                                   amd64        softaculous plugin for Vesta

Dovecot version:

root@serv1:~# dpkg -l | egrep -i dovecot
ii  dovecot-core                      1:2.2.22-1ubuntu2.8                        amd64        secure POP3/IMAP server - core files
ii  dovecot-imapd                     1:2.2.22-1ubuntu2.8                        amd64        secure POP3/IMAP server - IMAP daemon
ii  dovecot-pop3d                     1:2.2.22-1ubuntu2.8                        amd64        secure POP3/IMAP server - POP3 daemon

Installed Software (what you got with the installer):

nginx+apache+php + all vesta modules

Steps to Reproduce:

Try to login with any email account on webmail.

On log I can see:

Oct 02 16:51:24 imap-login: Info: Login: user=<contato@XXXXX>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=20181, secured, session=<yPRBDkB3BM1/AAAB>
Oct 02 16:51:24 imap(contato@XXXXX): Error: User initialization failed: namespace configuration error: Duplicate namespace prefix: ""
Oct 02 16:51:24 imap: Error: Invalid user settings. Refer to server log for more information.

Related Issues/Forum Threads:

https://forum.vestacp.com/viewtopic.php?t=13539 (not solved) https://forum.vestacp.com/viewtopic.php?t=10197 (not solved) https://forum.vestacp.com/viewtopic.php?t=8466 (not solved) https://www.roundcubeforum.net/index.php?topic=25093.0

Other Notes:

franciscopaniskaseker commented 5 years ago

I am not sure why, but I did this to solve:

root@serv1:~# mv  /etc/dovecot/conf.d/15-mailboxes.conf /root/
root@serv1:~# /etc/init.d/dovecot restart
[ ok ] Restarting dovecot (via systemctl): dovecot.service.
root@serv1:~# 

content of 15-mailboxes.conf file:

##
## Mailbox definitions
##

# Each mailbox is specified in a separate mailbox section. The section name
# specifies the mailbox name. If it has spaces, you can put the name
# "in quotes". These sections can contain the following mailbox settings:
#
# auto:
#   Indicates whether the mailbox with this name is automatically created
#   implicitly when it is first accessed. The user can also be automatically
#   subscribed to the mailbox after creation. The following values are
#   defined for this setting:
# 
#     no        - Never created automatically.
#     create    - Automatically created, but no automatic subscription.
#     subscribe - Automatically created and subscribed.
#  
# special_use:
#   A space-separated list of SPECIAL-USE flags (RFC 6154) to use for the
#   mailbox. There are no validity checks, so you could specify anything
#   you want in here, but it's not a good idea to use flags other than the
#   standard ones specified in the RFC:
#
#     \All      - This (virtual) mailbox presents all messages in the
#                 user's message store. 
#     \Archive  - This mailbox is used to archive messages.
#     \Drafts   - This mailbox is used to hold draft messages.
#     \Flagged  - This (virtual) mailbox presents all messages in the
#                 user's message store marked with the IMAP \Flagged flag.
#     \Junk     - This mailbox is where messages deemed to be junk mail
#                 are held.
#     \Sent     - This mailbox is used to hold copies of messages that
#                 have been sent.
#     \Trash    - This mailbox is used to hold messages that have been
#                 deleted.
#
# comment:
#   Defines a default comment or note associated with the mailbox. This
#   value is accessible through the IMAP METADATA mailbox entries
#   "/shared/comment" and "/private/comment". Users with sufficient
#   privileges can override the default value for entries with a custom
#   value.

# NOTE: Assumes "namespace inbox" has been defined in 10-mail.conf.
namespace inbox {
  # These mailboxes are widely used and could perhaps be created automatically:
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Trash {
    special_use = \Trash
  }

  # For \Sent mailboxes there are two widely used names. We'll mark both of
  # them as \Sent. User typically deletes one of them if duplicates are created.
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }

  # If you have a virtual "All messages" mailbox:
  #mailbox virtual/All {
  #  special_use = \All
  #  comment = All my messages
  #}

  # If you have a virtual "Flagged" mailbox:
  #mailbox virtual/Flagged {
  #  special_use = \Flagged
  #  comment = All my flagged messages
  #}
}
franciscopaniskaseker commented 5 years ago

Today I reinstalled vestacp on 16.04 on other server. Complete new fresh install. I installed only one domain and only one e-mail and then tried to login on roundcube.

Same problem. And then I did same workaround that I said above.

franciscopaniskaseker commented 5 years ago

Yesterday I installed vestacp with 16.04 updated Ubuntu server. Same problem again after recovered admin account from other server (same installation parameters).

franciscopaniskaseker commented 5 years ago

Same error today. New installation nginx+apache2 on ubuntu 16.04 updated server.

I removed "15-mailboxes.conf" and it started work.

jackdh commented 5 years ago

I'm also getting the above error after v-restore-user.

You're above fix to remove 15-mailboxes.conf worked.

KashifHK123 commented 5 years ago

Simply follow these instruction for fix Connection to storage Problem.

# nano /etc/dovecot/dovecot.conf

and then past this code at last line

namespace inbox { inbox = yes }

Pleskan commented 5 years ago

I suggest to use one and only one namespace in main dovecot.conf to solve subject problem. My solution is shown below

protocols = imap pop3
listen = *, ::
base_dir = /var/run/dovecot/
!include conf.d/*.conf

namespace {
    type = private
    separator = /
    prefix = mail/
    inbox = yes
    list = no

    mailbox Sent {
        auto = subscribe
        special_use = \Sent
    }
    mailbox Drafts {
        auto = subscribe
        special_use = \Drafts
    }
    mailbox Trash {
        auto = subscribe
        special_use = \Trash
    }
}
KashifHK123 commented 5 years ago

Run this command and Fix your Roundcube "Connection to storage server failed." Problem.

echo "namespace inbox { inbox = yes }" >> /etc/dovecot/dovecot.conf

Pleskan commented 5 years ago

@KashifHK123 Your method doesn't work for me at all (Ubuntu 16.04.5) Therefore I'd left only one namespace in main dovecot config file and all is fine now.

KashifHK123 commented 5 years ago

@Pleskan I'm Centos lover, sorry to know it not work on Ubuntu, but it working 100% in Centos.