ExtMail服务器社区's Archiver

hclfy 发表于 2004-4-12 19:10

带smtp认证的Postfix邮件系统的完全安装(FreeBSD4.9)

带smtp认证的Postfix邮件系统的完全安装(FreeBSD4.9)  
cyrus-sasl-2.1.15
postfix-2.0.18
qpopper4.0.4



1.安装cyrus-sasl-2.1.15
ms# tar -zxvf cyrus-sasl-2.1.15.tar.gz
ms# cd cyrus-sasl-2.1.15
ms# ./configure --disable-sample --disable-pwcheck --disable-cram
--disable-digest --disable-krb4 --disable-gssapi --disable-anon
--enable-plain --enable-login  
ms# make
ms# make install
ms# ln -s /usr/local/lib/sasl2 /usr/lib/sasl2

2.配置sasl的lib库
ms# edit /etc/default/rc.conf(在ldconfig_paths="/usr/loca/lib后面加上/usr/local/lib/sasl2")
ms# shutdown -r now(使其生效)
3.ms#mkdir /var/state/saslauthd


4.准备postfix认证的配置文件
使用saslauthd调用pam认证:
ms# echo pwcheck_method: saslauthd > /usr/lib/sasl2/smtpd.conf

5.安装postfix-2.0.18
停止sendmail
ms# mv /usr/bin/newaliases /usr/bin/newaliases.OFF
ms# mv /usr/bin/mailq /usr/bin/mailq.OFF
ms# mv /usr/sbin/sendmail /usr/sbin/sendmail.OFF
ms# mv /etc/rc.sendmail /etc/sendmail.OFF
ms# ee /etc/rc.conf    (在sendmail="YES"添加#  或者 sendmail=”NO”)

6.添加postfix用户
ms# pw groupadd postfix -g 2003
ms# pw groupadd postdrop -g 2004
ms# pw useradd postfix -u 2003 -g 2003 -d /dev/null -s /nologin

7.安装源代码包,将生成/tmp/ postfix-2.0.18目录。
ms# tar xvzf postfix-2.0.18.tar.gz
ms# cd /tmp/ postfix-2.0.18
ms# make -f Makefile.init makefiles 'CCARGS=-DUSE_SASL_AUTH -I/usr/local/include/sasl' 'AUXLIBS=-L/usr/local/lib/ -lsasl2 '
ms# make install
ms# echo ‘postfix: root’ >> /etc/aliases (or     ee /etc/aliases
在里面加入 postfix: root)
ms# /usr/bin/newaliases

8.设置自启动
ms# ee /usr/local/etc/rc.d/postfix-server.sh   (在里面加入postfix start)
ms# chmod 755 /usr/local/etc/rc.d/postfix-server.sh

9.添加postfix用户
ms# pw groupadd postfix -g 2003
ms# pw groupadd postdrop -g 2004
ms# pw useradd postfix -u 2003 -g 2003 -d /dev/null -s /nologin


10.重新启动机器,如果不能自启动postfix,则输入下面的命令
ms#postfix start

11.安装qpopper4.0.13
ms# ln �Cs /var/spool/mail/ /usr/mail
ms# cd /tmp
ms# tar xvzf qpopper4.0.13
ms# cd /tmp/ qpopper4.0.13
ms# ./configure
ms# make
ms# make install         (安装好后popper在/usr/local/sbin/目录下)

12.配置
ms# ee /etc/inetd.conf
查找POP3内容,改为
pop-3 stream tcp nowait root /usr/local/sbin/popper popper -s   

13.配置/etc/postfix/main.cf,在其末尾加上
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated permit_auth_destination reject
#smtpd_sasl_local_domain = $mydomain
smtpd_client_restrictions = permit_sasl_authenticated


14.添加用户
ms#pw useradd 用户名
ms#password 用户名

15.启动电脑
ms# saslauthd �Ca pam
ms# /usr/local/sbin/saslpasswd2 用户名 并根据提示输入密码即可。

16.邮件接受程序(如IE) 选上”需要smtp认证”

匆忙写好上文,错误之处请指正,有问题请与我联系qq:67093201
mail:  foryou@hlit.8800.org (这个就是用上面的方法做的哦)


shyokou 发表于 2004-5-25 01:04

Just two points here -

In the file '/etc/postfix/main.cf', you just comment the line '#smtpd_sasl_local_domain = $mydomain'. But as far as I know, for Cyrus-SASL2, you should use 'smtpd_sasl_local_domain = ', a blank local domain, if it is not the default ...

If you use the sasldb2 for authentication, why do you disable the digest mechanism? Unless using TLS/SSL, plain and login are all clear-text transmission ...

[quote]【[b]在 hclfy 发表的大作中提到:[/b]】
:带smtp认证的Postfix邮件系统的完全安装(FreeBSD4.9)  
:cyrus-sasl-2.1.15
:postfix-2.0.18
:qpopper4.0.4
[/quote]


页: [1]

Powered by Discuz! Archiver 7.0.0  © 2001-2009 Comsenz Inc.