频道栏目
首页 > 资讯 > linux > 正文

linux服务器之Sendmail配置

08-10-15        来源:[db:作者]  
收藏   我要投稿

 

 

修改/etc/mail/local-hosts-name文件
[root@localhost named]# cat /etc/mail/local-host-names
# local-host-names - include all aliases for your machine here.
ltest.com


更改/etc/mail/sendmail.mc文件,修改下列地方:
DaemonPortsOptions=Port=smtp,Addr=127.0.0.1, Name=MTA 更改为:
DaemonPortsOptions=Port=smtp,Addr=yourip或者0.0.0.0, Name=MTA
然后m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf


修改 /etc/rc.d/rc.local
加入一行 /usr/sbin/saslauthd -a shadow


用户管理
认证的配置:修改/etc/mail/sendmail.mc中的字段,取消“TRUST_AUTH_MECH”一行和下一行“define”处的注释。然后m4 /etc/ mail/sendmail.mc>/etc/mail/sendmail.cf。
[root@localhost named]# chkconfig --list saslauthd 开启认证
saslauthd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@localhost named]# chkconfig --level 35 saslauthd on


建立用户帐号
[root@localhost named]# groupadd mailuser
[root@localhost named]# adduser -g mailuser -s /sbin/nologin xuwin
[root@localhost named]# adduser -g mailuser -s /sbin/nologin xxx
[root@localhost named]# passwd xuwin
[root@localhost named]# passwd xxx 密码都是123

 

修改/etc/aliases文件实现邮件转发和邮件列表:
admin: xxx 为邮件用户xxx设置别名admin
testgroup: xuwin,xxx 实现群发 发给testgroup的邮件发给xuwin 和 xxx 以上2个可以分别测试
#newaliases

 

访问控制设置
更改/etc/mail/accesss文件,增加:
[root@localhost 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
xuwin.com RELAY
完成后makemap hash /etc/mail/access.db < /etc/mail/access进行数据库更新。


#service sendmail restart


[root@localhost root]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is ^].
220 localhost.localdomain ESMTP Sendmail 8.12.8/8.12.8; Sun, 10 Aug 2008 20:47:0
6 +0800
mail from: root@xuwin.com
250 2.1.0 root@xuwin.com... Sender ok
rcpt to: xuwin@xuwin.com
250 2.1.5 xuwin@xuwin.com... Recipient ok
data
354 Enter mail, end with "." on a line by itself
test
hi.baidu.com/proxuwin
xuwin.com
.
250 2.0.0 m7ACl6B7004271 Message accepted for delivery
quit
221 2.0.0 localhost.localdomain closing connection
Connection closed by foreign host.
检查日志[root@localhost root]# tail /var/log/maillog

 

检测imap是否安装rpm -q imap
安装rpm -ivh imap-*.rpm

[root@localhost root]# chkconfig imap on
[root@localhost root]# service xinetd restart
停止 xinetd:  确定  ]
启动 xinetd:  确定  ]
[root@localhost root]# grep imap /etc/services
imap            143/tcp         imap2           # Interim Mail Access Proto v2
imap            143/udp         imap2
imap3           220/tcp                         # Interactive Mail Access
imap3           220/udp                         # Protocol v3
imaps           993/tcp                         # IMAP over SSL
imaps           993/udp                         # IMAP over SSL

相关TAG标签
上一篇:linux服务器之Vsftp配置
下一篇:linux服务器之samba服务器配置与测试
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站