Dovecot/RainLoop/CyperPanel/GCP VM 邮件问题

问题描述

我见过很多类似的问题,但好几天都没有找到解决方案。 我在 GCP Ubuntu VM 上运行 CyperPanel。 登录 RainLoop 时,我收到错误“授权失败”。

这是我要跑的东西

systemctl status dovecot


dovecot.service - Dovecot IMAP/POP3 email server
     Loaded: loaded (/lib/systemd/system/dovecot.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2021-03-03 14:19:25 UTC; 14min ago
       Docs: man:dovecot(1)
             Main PID: 3249 (dovecot)
      Tasks: 5 (limit: 9544)
     Memory: 5.2M
     CGroup: /system.slice/dovecot.service
             ├─3249 /usr/sbin/dovecot -F
             ├─3268 dovecot/anvil
             ├─3269 dovecot/log
             ├─3270 dovecot/config
             └─3305 dovecot/stats 
Mar 03 14:19:25 cyberpanel-2-vm dovecot[3249]: master: Dovecot v2.3.13 (89f716dc2) starting up for imap,pop3 (core dumps disabled)
Mar 03 14:21:00 cyberpanel-2-vm dovecot[3269]: auth: Fatal: sql: Unknown database driver 'mysql'
Mar 03 14:21:00 cyberpanel-2-vm dovecot[3249]: master: Error: service(auth): command startup failed,throttling for 2.000 secs
Mar 03 14:21:00 cyberpanel-2-vm dovecot[3269]: imap-login: Disconnected: Auth process broken (disconnected before auth was ready,waited 0 secs): user=<>,rip=127.0.0.1,lip=127.0.0.1,secured,session=<P19zj6K8kqJ/AAAB>
Mar 03 14:21:09 cyberpanel-2-vm dovecot[3269]: auth: Fatal: sql: Unknown database driver 'mysql'
Mar 03 14:21:09 cyberpanel-2-vm dovecot[3249]: master: Error: service(auth): command startup failed,throttling for 4.000 secs

运行

grep dovecot
LISTEN    0         100                0.0.0.0:110              0.0.0.0:*        users:(("dovecot",pid=3249,fd=21))
LISTEN    0         100                0.0.0.0:143              0.0.0.0:*        users:(("dovecot",fd=38))
LISTEN    0         100                0.0.0.0:993              0.0.0.0:*        users:(("dovecot",fd=40))
LISTEN    0         100                0.0.0.0:995              0.0.0.0:*        users:(("dovecot",fd=23))
LISTEN    0         100                   [::]:110                 [::]:*        users:(("dovecot",fd=22))
LISTEN    0         100                   [::]:143                 [::]:*        users:(("dovecot",fd=39))
LISTEN    0         100                   [::]:993                 [::]:*        users:(("dovecot",fd=41))
LISTEN    0         100                   [::]:995                 [::]:*        users:(("dovecot",fd=24))

有什么建议可以看吗? 我不会发布我尝试过但没有用的解决方案,我愿意再次发布结果。 提前致谢!

//添加一些可能相关文件的内容

auth-sql.conf.ext

# Authentication for SQL users. Included from 10-auth.conf.
#
# <doc/wiki/AuthDatabase.SQL.txt>

passdb {
  driver = mysql

  # Path for SQL configuration file,see example-config/dovecot-sql.conf.ext
  args = /etc/dovecot/dovecot-sql.conf.ext
}

# "prefetch" user database means that the passdb already provided the
# needed information and there's no need to do a separate userdb lookup.
# <doc/wiki/UserDatabase.Prefetch.txt>
#userdb {
#  driver = prefetch
#}

userdb {
  driver = sql
  args = /etc/dovecot/dovecot-sql.conf.ext
}

# If you don't have any user-specific settings,you can avoid the user_query
# by using userdb static instead of userdb sql,for example:
# <doc/wiki/UserDatabase.Static.txt>
#userdb {
  #driver = static
  #args = uid=vmail gid=vmail home=/var/vmail/%u
#}

dovecot.conf

protocols = imap pop3
log_timestamp = "%Y-%m-%d %H:%M:%S "
#mail_location = maildir:/home/vmail/%d/%n/Maildir
#mail_location = mdbox:/home/vmail/%d/%n/Mdbox

ssl_cert = <cert.pem
ssl_key = <key.pem

mail_plugins = zlib

mdbox_rotate_size = 2M

namespace {
    type = private
    separator = .
    prefix = INBOX.
    inbox = yes
}

service auth {
    unix_listener auth-master {
        mode = 0600
        user = vmail
    }

    unix_listener /var/spool/postfix/private/auth {
        mode = 0666
        user = postfix
        group = postfix
    }

user = root
}

service auth-worker {
    user = root
}

protocol lda {
    log_path = /home/vmail/dovecot-deliver.log
    auth_socket_path = /var/run/dovecot/auth-master
    postmaster_address = postmaster@example.com

    mail_plugins = zlib
}

protocol pop3 {
    pop3_uidl_format = %08Xu%08Xv
    mail_plugins = $mail_plugins zlib
}

protocol imap {
    mail_plugins = $mail_plugins zlib imap_zlib
}

passdb {
    driver = sql
    args = /etc/dovecot/dovecot-sql.conf.ext
}

userdb {
    driver = sql
    args = /etc/dovecot/dovecot-sql.conf.ext
}

plugin {

  zlib_save = gz
  zlib_save_level = 6

}

service stats {
    unix_listener stats-reader {
        user = vmail
        group = vmail
        mode = 0660
    }
    unix_listener stats-writer {
        user = vmail
        group = vmail
        mode = 0660
    }
}

dovecot-sql.conf.ext

driver = mysql
connect = host=localhost dbname=cyberpanel user=cyberpanel password=xxxxxx port=3306
password_query = SELECT email as user,password FROM e_users WHERE email='%u';
user_query = SELECT '5000' as uid,'5000' as gid,mail FROM e_users WHERE email='%u';

//编辑 尝试的解决方案:https://forums.cyberpanel.net/discussion/4807/cant-login-to-rainloop

I installed Cyberpanel on Ubuntu 20.4 minimal on GCP but the problem remained.

Followed the next steps found on another discussion to solve:

apt remove dovecot-core dovecot-mysql dovecot-pop3d dovecot-imapd
sed -e '/deb/ s/^#*/#/' -i /etc/apt/sources.list.d/dovecot.list
apt clean all
apt install dovecot-core dovecot-mysql dovecot-pop3d dovecot-imapd
apt-get install -y libmysqlclient-dev

Then check devecot status with:

systemctl status dovecot -l

Then you go to YourIP:8090/manageSSL/sslForMailServer and install a SSL certificate for your Domain.

Then it will work

现在出现新错误:

root@cyberpanel-2-vm:/home/admin_# journalctl -f | grep dovecot
Mar 03 17:00:33 cyberpanel-2-vm dovecot[824]: imap-login: Disconnected (auth failed,1 attempts in 2 secs): user=<xxx@xxx.xx>,method=PLAIN,TLS,session=<J7XgyaS8VJZ/AAAB>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...