这个问题让我抓狂,现在我不知所措。需要帮助吗? ;)
我正在使用 mysql 后端、postfix MTA 和 roundcube webmail 客户端在 Ubuntu 14 AWS EC2 实例上设置邮件服务器。在通过 roundcube 登录之前,一切都正常。也就是说,当我通过 telnet 进入端口 25 上的本地主机时,我可以从 shell 发送和接收邮件,并且在 /var/mail/virtual/ 中创建邮箱。一切看起来都很好。
当我尝试使用“用户”表中存在的用户登录时,roundcube 客户端返回以下错误:
连接存储服务器失败。
因此。这是 /var/log/roundcube/error 消息:
[04-Jan-2016 17:43:42 +0000]: IMAP Error: Login failed for [email protected] from [IPADDR] LOGIN: Temporary problem, please try again later in /usr/share/roundcube/program/lib/Roundcube/rcube_imap.php on line 184 (POST /roundcube/?_task=login&_action=login)
并且错误记录在 /var/log/mail 中:
Jan 4 17:49:56 ip-172-31-46-150 imapd: Connection, ip [::ffff:127.0.0.1]
Jan 4 17:49:56 ip-172-31-46-150 authdaemond: received auth request, service=imap, authtype=login
Jan 4 17:49:56 ip-172-31-46-150 authdaemond: authmysql: trying this module
Jan 4 17:49:56 ip-172-31-46-150 authdaemond: authmysqllib: connected. Versions: header 50534, client 50546, server 50546
Jan 4 17:49:56 ip-172-31-46-150 authdaemond: SQL query: SELECT id, crypt, "", uid, gid, home, concat(home,'\',maildir), "", name, "" FROM users WHERE id = '[email protected]' AND (enabled=1)
Jan 4 17:49:56 ip-172-31-46-150 authdaemond: mysql_query failed, reconnecting: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@mydomain.co.uk' AND (enabled=1)' at line 1
Jan 4 17:49:56 ip-172-31-46-150 authdaemond: authmysqllib: connected. Versions: header 50534, client 50546, server 50546
Jan 4 17:49:56 ip-172-31-46-150 authdaemond: mysql_query failed second time, giving up: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@mydomain.co.uk' AND (enabled=1)' at line 1
Jan 4 17:49:56 ip-172-31-46-150 authdaemond: authmysql: TEMPFAIL - no more modules will be tried
Jan 4 17:49:56 ip-172-31-46-150 imapd: LOGIN FAILED, [email protected], ip=[::ffff:127.0.0.1]
Jan 4 17:49:56 ip-172-31-46-150 imapd: authentication error: Input/output error
我显然可以根据要求发布配置文件,但我不想过多地阻碍原始问题。
非常感谢您的帮助!谢谢
相关修改的配置文件如下:
我对以下方面进行了修改/etc/courier/authdaemonrc
authmodulelist="authmysql"
DEBUG_LOGIN=2
/etc/courier/authmysqlrc
MYSQL_USERNAME mail
MYSQL_PASSWORD mypassword
MYSQL_DATABASE maildb
MYSQL_USER_TABLE users
MYSQL_CRYPT_PWFIELD crypt
MYSQL_MAILDIR_FIELD concat(home,'/',maildir)
MYSQL_WHERE_CLAUSE enabled=1
/etc/roundcube/main.inc.php
$rcmail_config['default_host'] = 'localhost';
$rcmail_config['default_port'] = '143';
$rcmail_config['imap_force_ns'] = true;
$rcmail_config['smtp_server'] = 'localhost';
$rcmail_config['smtp_port'] = 25;
$rcmail_config['smtp_helo_host'] = 'localhost';
$rcmail_config['create_default_folders'] = TRUE;
答案1
将这些日志中的 SQL 复制并粘贴到您的mysql
客户端 (CLI)。我认为 lone\
会导致问题,因为字符串是从配置文件中读取的。也许是 aconcat(home, '\\', maildir)
但是,路径不应该使用 吗/
?