学习postfix 首先把 《postfix 权威指南》这本书看完先吧,仔细看完这本书可以快速清楚的了解邮件系统个方面的工作原理,已便于动手操作!
接下来看下postfix的官方文档 http://mirror.postfixchina.org/documentation.html ,以及各个组件的官方文档。会了解到他们之间是如何配合起来协调工作的。
################# Install cyrus-sasl ###############
./configure --enable-login --enable-ntlm --with-mysql=/usr/bin
###创建运行时需要的目录并调试启动
mkdir -pv /var/state/saslauthd
/usr/local/sasl2/sbin/saslauthd -a shadow pam -d ##启动调试
[root@mail ~]# testsaslauthd -u kangcong -p heha
0: OK "Success."
You have new mail in /var/spool/mail/root
[root@mail ~]# testsaslauthd -u kangcong -p hehadd
0: NO "authentication failed"
开机自动启动
[root@mail ~]# echo "/usr/local/sasl2/sbin/saslauthd -a shadow pam">>/etc/rc.local
vi /var/state/saslauthd/saslauthd.pid
########### Install cyrus-imapd
./configure
--with-mysql=DIR use MySQL (in DIR) [no]
--with-mysql-libdir=DIR MySQL lib files are in DIR
--with-mysql-incdir=DIR MySQL include files are in DIR
--with-sasl=DIR
./configure --with-mysql=/usr/local/ --with-mysql-libdir=/usr/local/lib/mysql/ --with-mysql-incdir=/usr/local/include/mysql --with-sasl=/usr/lib/sasl2/
############## Install Postfix ##################
groupadd postfix -g 1000
groupadd postdrop
useradd postfix -u 1000 -g postfix -G postdrop
make tidy ### if you have left-over files from a previous build
make makefiles CCARGS="-DUSE_SASL_AUTH -DUSE_CYRUS_SASL \
-DHAS_MYSQL -I/usr/local/include/mysql \
-I/usr/local/include/sasl" AUXLIBS="-L/usr/local/lib -lsasl2 \
-L/usr/local/lib/mysql -lmysqlclient -lz -lm"
echo /usr/local/lib >> /etc/ld.so.conf
echo /usr/local/lib/mysql >> /etc/ld.so.conf
/sbin/ldconfig
make
make install
[/img]..