版本:Debian 11 5.10.92-1 x86_64 - nginx/1.21.6 - mysql 15.1 10.5.12-MariaDB - PHP 7.4.25 (cli) - dovecot-core/stable,现在 1:2.3.13+dfsg1-2
我的 postfix/dovecot 配置已正常工作,可以接收电子邮件。从 rainloop 切换到 roundcube 后,我在 roundcube web 中看不到任何收件箱电子邮件。但偶尔我会登录 roundcube,并在收件箱中看到我的所有电子邮件,但如果我单击任何内容或刷新页面,它们都会消失。从 roundcube 发送电子邮件也只会导致无休止的加载轮,没有超时。
不幸的是 roundcube 没有错误日志,而 dovecot 只有成功登录日志。除了消失的电子邮件外,没有任何迹象表明出现了问题。
/var/log/mail.info
:
Feb 6 13:30:52 mail dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=9717, secured, session=<WKMOr13Xss5/AAAB>
Feb 6 13:30:52 mail dovecot: imap([email protected])<9717><WKMOr13Xss5/AAAB>: Logged out in=82 out=756 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
Feb 6 13:30:52 mail dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=9719, secured, session=<ZuEPr13Xts5/AAAB>
Feb 6 13:30:52 mail dovecot: imap([email protected])<9719><ZuEPr13Xts5/AAAB>: Logged out in=44 out=739 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
Feb 6 13:30:56 mail dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=9723, secured, session=<cedKr13XuM5/AAAB>
Feb 6 13:30:56 mail dovecot: imap([email protected])<9723><cedKr13XuM5/AAAB>: Logged out in=44 out=739 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
/var/log/roundcube/error.log
是空的。
我非常确定这是 dovecot 上的 IMAP 的问题,因为登录可以,但电子邮件检索只有 10% 的时间有效。没有任何错误日志可供故障排除,我不知道接下来该怎么办,只能反复尝试弄乱配置文件。
有人可以帮忙吗?
。
我排除了很多配置,因为它们太庞大了。我可以添加任何其他配置文件,但我认为这些是最相关的。
Roundcube配置:
<?php
$config = array();
// Do not set db_dsnw here, use dpkg-reconfigure roundcube-core to configure database!
include_once("/etc/roundcube/debian-db-roundcube.php");
$config['default_host'] = 'localhost';
$config['smtp_server'] = 'localhost';
// SMTP port. Use 25 for cleartext, 465 for Implicit TLS, or 587 for STARTTLS (default)
$config['smtp_port'] = 587;
// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '%u';
// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '%p';
// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$config['support_url'] = '';
// Name your service. This is displayed on the login screen and in the window title
$config['product_name'] = 'Roundcube Webmail';
// This key is used to encrypt the users imap password which is stored
// in the session record. For the default cipher method it must be
// exactly 24 characters long.
$config['des_key'] = 'k';
// List of active plugins (in plugins/ directory)
// Debian: install roundcube-plugins first to have any
$config['plugins'] = array(
);
// skin name: folder from skins/
$config['skin'] = 'elastic';
// Disable spellchecking
// Debian: spellchecking needs additional packages to be installed, or calling external APIs
// see defaults.inc.php for additional informations
$config['enable_spellcheck'] = false;
<?php
$dbuser='roundcube';
$dbpass='pass';
$basepath='';
$dbname='roundcube';
$dbserver='localhost';
$dbport='3306';
$dbtype='mysql';
<?php
include_once("/etc/roundcube/debian-db.php");
switch ($dbtype) {
case "sqlite":
case "sqlite3":
$config['db_dsnw'] = "sqlite:///$basepath/$dbname?mode=0640";
break;
default:
if ($dbport != '') $dbport=":$dbport";
if ($dbserver == '') $dbserver="localhost";
$config['db_dsnw'] = "$dbtype://$dbuser:$dbpass@$dbserver$dbport/$dbname";
break;
}
?>
Dovecot 配置:
## Dovecot configuration file
# Enable installed protocols
!include_try /usr/share/dovecot/protocols.d/*.protocol
protocols = imap pop3 lmtp
listen = *
postmaster_address = postmaster at aperturecorp.net
##
## Dictionary server settings
##
dict {
#quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
#expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext
}
!include conf.d/*.conf
# This file is commonly accessed via passdb {} or userdb {} section in
# conf.d/auth-sql.conf.ext
driver = mysql
connect = host=127.0.0.1 dbname=mailsrvdb user=maildbuser password=pass
default_pass_scheme = SHA512-CRYPT
password_query = SELECT email as user, password FROM virtual_users WHERE email='%u';
##
## Authentication processes
##
disable_plaintext_auth = yes
auth_mechanisms = plain login
!include auth-system.conf.ext
##
## Mailbox locations and namespaces
##
mail_location = maildir:/var/mail/vhosts/%d/%n/
namespace inbox {
inbox = yes
}
mail_privileged_group = mail
protocol !indexer-worker {
}
service imap-login {
inet_listener imap {
port = 143
}
inet_listener imaps {
port = 993
ssl = yes
}
}
service pop3-login {
inet_listener pop3 {
port = 0
}
inet_listener pop3s {
port = 995
ssl = yes
}
}
service submission-login {
inet_listener submission {
#port = 587
}
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
#mode = 0666i
mode = 0600
user = postfix
group = postfix
}
}
service imap {
# Most of the memory goes to mmap()ing files. You may need to increase this
# limit if you have huge mailboxes.
#vsz_limit = $default_vsz_limit
# Max. number of IMAP processes (connections)
#process_limit = 1024
}
service pop3 {
# Max. number of POP3 processes (connections)
#process_limit = 1024
}
service submission {
# Max. number of SMTP Submission processes (connections)
#process_limit = 1024
}
service auth {
unix_listener /var/spool/postfix/private/auth {
mode = 0660
user = postfix
group = postfix
}
unix_listener auth-userdb {
mode = 0600
user = vmail
}
user = dovecot
}
service auth-worker {
# Auth worker process is run as root by default, so that it can access
# /etc/shadow. If this isn't necessary, the user should be changed to
# $default_internal_user.
user = vmail
}
service dict {
# If dict proxy is used, mail processes should have access to its socket.
# For example: mode=0660, group=vmail and global mail_access_groups=vmail
unix_listener dict {
#mode = 0600
#user =
#group =
}
}
##
## SSL settings
##
ssl = required
ssl_cert = </etc/ssl/certs/mailtls-selfsigned.crt
ssl_key = </etc/ssl/private/mailtls-selfsigned.key
ssl_client_ca_dir = /etc/ssl/certs
ssl_dh = </usr/share/dovecot/dh.pem
##
## LDA specific settings (also used by LMTP)
##
protocol lda {
}
##
## Mailbox definitions
##
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
}
}
##
## IMAP specific settings
##
protocol imap {
}
##
## LMTP specific settings
##
protocol lmtp {
# Authentication via dict backend. Included from 10-auth.conf.
#
# <doc/wiki/AuthDatabase.Dict.txt>
passdb {
driver = dict
args = /etc/dovecot/dovecot-dict-auth.conf.ext
}
userdb {
driver = dict
args = /etc/dovecot/dovecot-dict-auth.conf.ext
}
# Authentication for system users. Included from 10-auth.conf.
passdb {
driver = sql
args = /etc/dovecot/dovecot-sql.conf.ext
}
userdb {
driver = static
args = uid=vmail gid=vmail home=/var/mail/vhosts/%d/%n
}