Linux Sendmail 服务器配置及应用

一.sendmail介绍

 邮件系统角色

MUA(邮件用户代理)、MTA(邮件传输代理)、MDA(邮件分发代理 )

邮件应用协议

SMTP,简单邮件传输协议,TCP 25端口

POP3,第3版邮局协议,TCP 110端口

IMAP4,第4版因特网消息访问协议,TCP 143端口

 

二.sendmail的基本配置

 

(1)邮件服务器

yum  install sendmail m4 sendmail-cf  sendmail-doc

1.cd /etc/mail

2.vim  sendmail.mc

:/127.0.0.1=0.0.0.0

3.vim access

Connect:127.0.0.1        RELAY

Connect:192.168.101      RELAY(向外转发)

liuwei.com               OK

4.vim local-host-names

liuwei.com

(本地区域名)

5.vim /etc/sysconfig/network

hostname=mail.liuwei.com

6.vim /etc/hosts

 mail.liuwei.com

7.vim  /etc/resolv.conf  DNS指向

nameserver  192.168.101.200

(2)DNS服务器

 

1.cd /var/named/chroot/etc

2.cp -p  named.caching named.conf

3.vim named.conf

27 any

28 any

37 any

38 any

 

4.vim named.rfc1912.zones 

zone "liuwei.com" IN {

   type  master;

   file   "liuwei.com.zone";

   allow-update { none;  };

};

 

zone "101.168.192.in-addr.arpa" IN {

   type  master;

   file   "192.168.101.zone";

   allow-update { none;  };

};

5.cd ../var/named/

6.cp -p localhost.zone  liuwei.com.zone

7.vim liuwei.com.zone

 

2 @    IN SOA  ns.liuwei.com. 

    

9 @      IN NS        ns.liuwei.com.

10ns     IN A         192.168.101.200

11mail   IN A         192.168.101.200

12pop3   IN CNAME     mail  

13smtp   IN CNAME     mail  

14@      IN MX  10    mail

8.vim  192.168.101.zone

 

 加上 200   IN   PTR   mail.liuwei.com.

9.init 6

10.yum install -y dovecot

11.service dovecot  start

 

 

 

三.发送的加密

cd   /etc/mail
mkdir certs
cd  certs/
openssl genrsa 1024 >sendmail.key
openssl req -new -key sendmail.key -out sendmail.csr
openssl ca -in sendmail.csr -out sendmail.cert
sendmail -d0.1 -bv
cd ..
vim sendmail.mc
 
cd certs
cp   /etc/pki/CA/cacert.pem  ./
chmod 600 *
 
四.接收的加密
mkdir   -pv /etc/dovecot/certs
cd   /etc/dovecot/certs
openssl genrsa 1024 >dovecot.key
openssl req -new -key  dovecot.key -out dovecot.csr
openssl ca -in dovecot.csr -out dovecot.cert
chmod 600 *
vim  /etc/dovecot.conf
21 加 imaps
 
 
五.身份的验证
service saslauthd start
chkconfig   saslauthd  on
vim /usr/lib/sas12/sendmail.conf
vim /etc/mail/sendmail.mc
116  Name=MTA ,M=Ea')dn1

本文出自 “碧云天” 博客,转载请与作者联系!

你可能感兴趣的:(linux,职场,sendmail,休闲)