- 论坛徽章:
- 0
|
转贴
=====================
cyrus-sasl-1.5.24
sendmail.8.11.6
操作系统为:Redhat 7.1
安装认证库
如果先前已经安装有旧版本的 Cyrus SASL 请先将其移除,方法是手工删除/usr/lib/sasl或/usr/local/lib/sasl目录。
安装过程如下:
[root@mail src]# cd /usr/src/
[root@mail src]# tar xvfz cyrus-sasl-1.5.24.tar.gz
[root@mail src]# cd cyrus-sasl-1.5.24
[root@mail cyrus]# ./configure -prefix=/usr --enable-login --with-pwcheck --with-digest
[root@mail cyrus]# make
[root@mail cyrus]# make install
安装完成后,建立一个/var/pwcheck目录,pwcheck程序要用此目录。
接下来必须设置 sendmail 的使用者身分查验方式,这里使用系统帐号与密来进行验证:
[root@mail cyrus-sasl-1.5.24]# cd /usr/lib/sasl/
[root@mail sasl]# cat >; Sendmail.conf
pwcheck_method: shadow
^D
请特别留意Sendmail.conf开头的S字母必须为大写。
关于 Cyrus SASL 认证程序库更详细的说明,请参阅 Cyrus SASL for System Administrators。 <http://www.sendmail.org/~ca/email/cyrus/sysadmin.html>;
编译及配置Sendmail
如果系统中正在执行旧版的sendmail请先将其停止,停止 sendmail 的方法是 killall sendmail 或是先找出 sendmail 的 pid 然后 kill pid 将其停止。
解压软件包:
[root@email src]# tar xvfz sendmail.8.11.4.tar.gz
[root@email src]# cd sendmail-8.11.4
在子目录devtools/Site/下创建site.config.mc文件,内容如下
PREPENDDEF(`confMAPDEF',`-DMAP_REGEX')
PREPENDDEF(`confOPTIMIZE',`-O6')
PREPENDDEF(`confOPTIMIZE',`-O6')
APPENDDEF(`confENVDEF',`-DSASL')
APPENDDEF(`conf_sendmail_LIBS',`-lsasl')
APPENDDEF(`confLIBDIRS',`-L/usr/local/lib -L/usr/local/lib/sasl')
APPENDDEF(`confINCDIRS',`-I/usr/local/include -I/usr/local/include/sasl')
编译sendmail:
[root@mail sendmail-8.11.4]# /usr/src/sendmail-8.11.4/sendmail
[root@mail sendmail]# sh Build -c -f ../devtools/Site/site.config.mc
安装:
[root@mail sendmail]# sh Build install
生成配置文件:
[root@mail sendmail-8.11.4]# cd cf/cf/
创建文件sendmail.mc文件,内容如下:
divert(-1)
dnl This is the macro config file used to generate the /etc/sendmail.cf
dnl file. If you modify thei file you will have to regenerate the
dnl /etc/sendmail.cf by running this macro config through the m4
dnl preprocessor:
dnl m4 /etc/sendmail.mc >; /etc/sendmail.cf
dnl You will need to have the Sendmail-cf package installed for this to work.
include(`/usr/src/sendmail-8.11.4/cf')
define(`confDEF_USER_ID',`8:12')
OSTYPE(`linux')
undefine(`UUCP_RELAY')
undefine(`BITNET_RELAY')
define(`confAUTO_REBUILD')
define(`confTO_CONNECT', `1m')
define(`confTRY_NULL_MX_LIST',true)
define(`confDONT_PROBE_INTERFACES',true)
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')
FEATURE(`smrsh',`/usr/sbin/smrsh')
FEATURE(`mailertable',`hash -o /etc/mail/mailertable')
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')
FEATURE(redirect)
FEATURE(always_add_domain)
FEATURE(use_cw_file)
FEATURE(local_procmail)
MAILER(smtp)
MAILER(procmail)
FEATURE(`access_db')
FEATURE(`blacklist_recipients')
dnl We strongly recommend to comment this one out if you want to protect
dnl yourself from spam. However, the laptop and users on computers that do
dnl not hav 24x7 DNS do need this.
FEATURE(`accept_unresolvable_domains')
dnl FEATURE(`relay_based_on_MX')
TRUST_AUTH_MECH(`LOGIN PLAIN ')dnl
define(`confAUTH_MECHANISMS', `LOGIN PLAIN')dnl
FEATURE(`no_default_msa')dnl turn off default entry for MSA
DAEMON_OPTIONS(`Port=25, Name=MSA, M=E')dnl
然后运行:
[root@email cf]# sh Build sendmail.cf
再对原有的配置文件备份以后,将新生成的sendmail.cf拷贝到目录/etc/mail中。
最后启动sendmail:
[root@email mail]# /usr/sbin/sendmail -bd -q20m
测试
检查SASL是否已经生效。过程如下:
[root@mail cf]# sendmail -d0.1 -bv root | grep SASL
NETINET NETUNIX NEWDB QUEUE SASL SCANF SMTP USERDB XDEBUG
其中有SASL,表示Sendmail确实支持SASL了。
===============================
我现在有sendmail的邮件系统正常运行,需要加smtp认证,不知道,上面过程
或者_给出的配置文件_和过程是通用的,还是依照个人机器配置???
我无法确定给出的文件的正确性,我做到创建sendmail.mc,再sh Build sendmail.mc 时候,说什么
Using M4=/usr/local/bin/gm4
`sendmail.mc' is up to date.
不知怎么办?
菜鸟一个,高手赐教。
谢谢!!!!!!! |
|