Cyrus-SASL 安装

一 安装 cyrus-sasl
将系统自带的sasl先备份
1.mv /usr/lib/sasl /usr/lib/sasl.OFF
2.mv /usr/lib/sasl2 /usr/lib/sasl2.OFF
取源码安装
1. wget http://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.22.tar.gz
2. tar zxvf cyrus-sasl-2.1.21.tar.gz
3. cd cyrus-sasl-2.1.21
4. ./configure --disable-anon --disable-gssapi --disable-sample --disable-digest --disable-saslauthd --disable-pwcheck --disable-krb4 --enable-plain --enable-login --enable-cram --enable-digest --enable-sql --with-mysql=/usr/local/mysql --with-mysql-includes=/usr/local/mysql/include/mysql --with-mysql-libs=/usr/local/mysql/lib/mysql --with-saslauthd=/var/run/saslauthd
  ln -s /usr/local/include/sasl/ /usr/include/sasl
5. make
6. make install
# ln -sv /usr/local/sasl2/lib/*  /usr/lib

postfix 2.3以后的版本会分别在/usr/local/lib和/usr/local/include中搜索sasl库文件及头文件,故还须将其链接至此目录中:
# ln -sv /usr/local/sasl2/lib/*  /usr/local/lib
# ln -sv /usr/local/sasl2/include/sasl/*  /usr/local/include

创建运行时需要的目录并调试启动
# mkdir -pv /var/state/saslauthd      
# /usr/local/sasl2/sbin/saslauthd  -a  shadow  pam  -d

启动并测试
# /usr/local/sasl2/sbin/saslauthd -a shadow pam 
# /usr/local/sasl2/sbin/testsaslauthd -u root -p root用户密码

配置库文件搜索路径
# echo "/usr/local/sasl2/lib" >> /etc/ld.so.conf
# echo "/usr/local/sasl2/lib/sasl2" >> /etc/ld.so.conf
# ldconfig -v

开机自动启动
# echo "/usr/local/sasl2/sbin/saslauthd -a shadow pam">>/etc/rc.local


二 配置 Cyrus-SASL 

[root@mail root]# echo pwcheck_method: saslauthd > /usr/lib/sasl2/smtpd.conf

[root@mail root]# echo mech_list: plain login >> /usr/lib/sasl2/smtpd.conf


你可能感兴趣的:(list,测试,login)