Cyrus-Sasl 是一个简易安全验证层软件包,通常用于搭配Postfix 做SMTP验证,最近在部署一台新的邮件服务器时,用Webmail 登陆发邮件,接收均无问题,采用客户端接受正常,发送时则提示如下所示:
localhost postfix/smtpd[32031]: connect from unknown[61.*.*.*]
localhost postfix/smtpd[32031]: warning: unknown[61.*.*.*]: SASL LOGIN authentication failed: authentication failure
提示SASL LOGIN验证 失败,在查阅官方文档后,发现原来新版本的 2.1.25 参数做了一些变动( 原来使用 2.1.22不受影响 ),参考以下配置进行修改
pwcheck_method: saslauthd mech_list: plain login pam allow_plaintext: true auxprop_plugin: sql #指定sql插件 sql_engine: mysql #类型为mysql数据库 sql_hostnames: localhost sql_user: sql用户名 sql_passwd: sql密码 sql_database: sql数据库名 sql_select: select password from mail_user where login = '%u@%r' # SQL查询语句,注意结尾的部分 # sql_select: select password from mailbox where username='%u@%r' # 采用 Extmail 时的查询语句
其它常见错误问题的处理方法
1. fatal: file /etc/postfix/main.cf: parameter mail_owner:unknown user name value:postfix my networks=127.0.0.1/8,10.1.1.0/24
解决方法 修改 main.cf 修改 inte--inteface = all
2. fatal: file /etc/postfix/main.cf: parameter mail_owner:unkonwn user name value:postfix myhostname=mail.abc.com mydomain=test.com myorigin=abc.com inet_interfaces =all
解决方法: 执行 postconf -e mail_owner=postfix
3.fatal: open database /etc/aliases.db :no such file or directory
解决方法:执行newaliase
4.warning:dict_nis_init:NIS domain name not set - NIS lookups disabled
解决方法:找到/etc/postfix/main.cf 文件中的 alias_maps = hash:/etc/aliases,nis:mail.aliases 去掉
5.warning: xsasl_cyrus_server_get_mechanism_list: no applicable SASL mechanisms fatal: no SASL authentication mechanisms
解决方法:通常是自行安装sasl 后lib库路径变化,作个软连接 ln -s /usr/local/sasl2/lib/sasl2 /usr/lib/sasl2
64位系统 ln -s /usr/local/sasl2/lib/sasl2 /usr/lib64/sasl2
评论关闭。