SASL LOGIN authentication failed: authentication failure

平台:centos 5 X64
postfix:postfix-2.5.6

May 9 20:42:49 mail postfix/smtpd[2536]: warning: unknown[ip]: SASL LOGIN authentication failed: authentication failure

现象:
本地extmail能正常登陆并发送邮件出去。通过telnet登陆出现错误:

1.SASL LOGIN authentication failed: authentication failure
通过foxmail,php的smtp类登陆同样报此错。

分析:

查看验证配置文件:

cat  /usr/lib/sasl2/smtpd.conf 
pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path:/var/spool/authdaemon/socket且 /var/spool/authdaemon/socket 文件存在,权限为

srwxrwxrwx 1 daemon daemon 0 Apr 30 15:44 /var/spool/authdaemon/socket也正常啊,难道本地的exmail不走验证机制?

1./usr/local/sbin/authtest -s login pass
这里的验证通过了。怪怪。。

仔细想了下这次邮局的配置,与以前大不同的是使用了不少RPM,减少编译过程。所以把怀疑对象定在了cyrus-sasl。

1.rpm -qa|grep cyrus-sasl
发现没有cyrus-sasl,于是

1.yum install cyrus-sasl
重新启动postfix,再次测试登陆。依然失败。

saslauthd -v
authentication mechanisms: getpwent kerberos5 pam rimap shadow ldap支持的验证机制方法里怎么没有authdaemond。。看来RPM的默认是没有。。

解决:
下载二进制cyrus-sasl包编译。ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.22.tar.gz

yum remove cyrus-sasl
yum remove cyrus-sasl-plain
yum remove cyrus-sasl-devel
yum remove cyrus-sasl-md5

tar zvfx cyrus-sasl-2.1.22.tar.gz 
cd cyrus-sasl-2.1.22
export LDFLAGS="-lpthread"
./configure --with-mysql --enable-anon --enable-plain --enable-login --disable-krb4 --disable-otp --disable-cram --disable-digest --disable-gssapi --with-pam --with-authdaemond

make
make install

rm -rf /usr/lib/sasl
rm -rf /usr/lib/sasl2
ln -s /usr/local/lib/sasl2 /usr/lib/

#为了让postfix能找到sasl,请运行如下命令:

echo "/usr/local/lib" >> /etc/ld.so.conf 
ldconfig

cat > /usr/lib/sasl2/smtpd.conf <<EOT
pwcheck_method: authdaemond
log_level: 3
mech_list: PLAIN LOGIN
authdaemond_path:/var/spool/authdaemon/socket
EOT再次登陆发信,成功!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值