当前位置:文档之家› LINUX上课笔记

LINUX上课笔记

shijunxiang@https://www.doczj.com/doc/572111510.html,
unix.fans@https://www.doczj.com/doc/572111510.html,

邮件服务
邮件服务有3个角色
客户用来收发邮件的软件叫mua
mta用来负责将mua发过来的邮件传送到合适的位置-》1邮件服务器 2邮件转发器
mda是用来存储属于我这个邮件服务器的邮件

pop 老的方法 顺序收发 有队列,收下来才能看
imap 新的方法 先收邮件头
http

smtp

用户发送邮件只交给邮件服务器不查询dns

邮件防毒网关工作原理
收到邮件后
1 断开
2 dns查询 反向查询ip地址
3 查询黑名单 spam list 公益性组织spam list
4 私有黑名单
5 查询关键字,查询内容
6 查病毒
7 查扩展信息(后缀)
8 查用户邮箱配额

修改dns记录
mail IN A 192.168.0.10
https://www.doczj.com/doc/572111510.html,. IN MX 10 desktop3

postfix和sendmail是mta 25端口只发不收

dovocot 只收不发
postfix
yum install postfix
yum install dovecot

vi /etc/dovecot/dovecot.conf
protocols = imap pop3
login_trusted_networks = 192.168.0.0/24,127.0.0.0/8
mail_location = mbox:~/mail:INBOX=/var/mail/%u
用户邮箱的类型是inbox类型

service dovecot start
ckconfig dovecot on

vi /etc/postfix/main.cf

myhostname = https://www.doczj.com/doc/572111510.html,
mydomain = https://www.doczj.com/doc/572111510.html,
myorigin =
以主机名向外发还是以域名向外发
以主机名向外发nallace@https://www.doczj.com/doc/572111510.html,
以域名向外发nallace@https://www.doczj.com/doc/572111510.html,
inet_interfaces = all 所有网卡端口都可以向外发送

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain定义本地邮件 那些信应该收下来
mynetworks_style = subnet
mynetwork = 127.0.0.1/8,192.168.0.0/14 定义了那些地址允许直接向外发送邮件,一般情况下关闭 指定ip地址不通过身份验证就可以发送邮件

relay_domains = $mydestination 那些用户向外发邮件的时候允许转发出去。
postconf -n 检查


rpm -qa |grep cyrus
cyrus-sasl-lib-2.1.23-8.el6.x86_64
cyrus-sasl-gssapi-2.1.23-8.el6.x86_64
cyrus-sasl-2.1.23-8.el6.x86_64
cyrus-sasl-plain-2.1.23-8.el6.x86_64
以上软件是smtp认证需要的组建

usermod -G root postfix 加入root组

saslauthd -v 查看支持几种验证
saslauthd 2.1.23
authentication mechanisms: getpwent kerberos5 pam rimap shadow ldap

vi /etc/sysconfig/saslauthd
MECH=shadow 改成shadow认证

chkconfig saslauthd on
service saslauthd restart

testsaslauthd -u nikov -p 123456
0: OK "Success."

vi /etc/postfix/main.cf
mynetworks = 127.0.0.0/8 删除192.168.0.0/24

添加
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain= ''
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,rejec
t_unauth_destination
broken_sasl_auth_clients = yes
smtpd_client_restrictions = permit_sasl_authenticated
smtpd_sasl_security_options = noanonymous

[root@desktop3 conf.d]# telnet 192.168.0.10 25
Trying 192.168.0.10...
Connected to 192.168.0.10.
Escape character is '^]'.
220 desktop3

https://www.doczj.com/doc/572111510.html, ESMTP Postfix
有ESMTP就对了

openwebmail 下载后放在http目录下就能使用
squirrelmail 松鼠邮



sendmail的安装
chkconfig postfix off
service postfix stop

yum install sendmail -y
yum install sendmail-cf -y

要知道系统默认用哪一个
alternatives --display mat 查看默认mta
alternatives --config mta 选2

chkconfig sendmail on
service sendmail start

vi /etc/mail/local-host-names

vi /etc/mail/sendmail.cf

修改
DaemonPortOptions=Port=smtp,Addr=0.0.0.0, Name=MTA 本机的那些ip地址对外提供服务

vi /etc/mail/access 规定了那些地址可以连服务器
127.0.0.1 OK 不通过验证直接转发
192.168.0. RELAY

makemap hash access.db < access 以hash生成access.db

要使用smtp验证
1 保持local host
2 清空acees生成acces.db
3 备份原来的sendmail.cf
4 修改新sendmail.cf
5 cp sendmail.mc sendmail.cf
6 vi sendmail.cf

TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl
7 m4 sendmail.mc > sendmail.cf












相关主题
文本预览
相关文档 最新文档