|
前提:首先我们 把DNS服务器安装OK 能够解析.(或者在hosts文件中添加域名和IP的对应。)
1,首先安装Sendmail所需软件
[root@localhost ~]# rpm -q sendmail m4
sendmail-8.13.1-2
默认是安装了的,若没有还需挂载第4张光盘,安装与sendmail相关的软件
[root@localhost RPMS]# rpm -ivh sendmail-*
warning: sendmail-cf-8.13.1-2.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
(1):sendmail-doc ########################################### [ 33%]
(2):sendmail-cf ########################################### [ 67%]
(3):sendmail-devel ########################################### [100%]
2.修改/etc/mail/local-hosts-name文件。
增加本地域和主机的FQDN,记住只是本地主机的FQDN和域名FQDN,不要添加其他域的,否则向外域发送邮件的时候会出现user unknown的错误:
[root@localhost named]# cat /etc/mail/local-host-names
# local-host-names - include all aliases for your machine here.
boway.edu
3, 更改/etc/mail/sendmail.mc文件,修改下列地方:
DaemonPortsOptions=Port=smtp,Addr=127.0.0.1, Name=MTA 更改为:
DaemonPortsOptions=Port=smtp,Addr=你本机ip, Name=MTA
然后m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
4, 用户管理
认证的配置:修改/etc/mail/sendmail.mc中的字段,取消“TRUST_AUTH_MECH”一行和下一行“define”处的注释。(于sendmail.mc文件的第48、49)然后m4 /etc/ mail/sendmail.mc>/etc/mail/sendmail.cf。
[root@boway named]# chkconfig --list saslauthd 开启认证
saslauthd 0ff 1ff 2ff 3:off 4:off 5:off 6:off
[root@localhost named]# chkconfig --level 35 saslauthd on
建立用户帐号
[root@boway named]# adduser lenson
[root@boway named]# adduser user1
[root@boway named]# passwd lenson
[root@boway named]# passwd user1 密码都是123
设置邮件别名和邮件群发
修改/etc/aliases文件实现邮件转发和邮件列表:
admin: lenson 为邮件用户lenson设置别名admin
testgroup: lenson,user1 实现群发 发给testgroup的邮件发给lenson 和user1以上2个可以分别测试
[root@boway etc]#newaliases
5,访问控制设置
更改/etc/mail/accesss文件,增加:
[root@boway named]# cat /etc/mail/access
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
boway.edu RELAY
完成后makemap hash /etc/mail/access.db < /etc/mail/access进行数据库更新。
6,#service sendmail restart
[root@boway named]# service sendmail restart 启动服务
Shutting down sendmail: [FAILED]
Starting sendmail: [ OK ]
Starting sm-client: [ OK ]
给lenson用户发邮件
# telnet boway.edu 25
220 boway.edu ESMTP Sendmail 8.13.1/8.13.1; Wed, 24 Oct 2007 15:56:56 +0800
helo boway
250 boway.edu Hello [192.168.188.29], pleased to meet you
mail from:administrator@ibm.com
250 2.1.0 administrator@ibm.com... Sender ok
rcpt to:lenson@boway.edu
250 2.1.5 lenson@boway.edu... Recipient ok
data
354 Enter mail, end with "." on a line by itself
hello lenson,this is a test,
i want to say The life is beautiful
.
250 2.0.0 l9O7uu7l004003 Message accepted for delivery
7,安装邮局服务
[root@boway RPMS]# rpm -ivh dovecot-0.99.11-2.EL4.1.i386.rpm --aid
[root@boway /]# vi /etc/dovecot.conf在protocols = imap imaps 后添加pop3 pop3s
启动dovecot服务
[root@boway /]# service dovecot restart
Stopping Dovecot Imap: [FAILED]
Starting Dovecot Imap: [ OK ]
[root@boway /]# chkconfig --level 35 dovecot on
OK了 我们使用客户机测试。可以使用Outlook
[ 本帖最后由 lenson 于 2007-10-24 15:05 编辑 ] |
|