MAIL服务器搭建

,邮件服务:

优    点

缺   点

应 用

sendmail

有点年代久远,稳定功能多

太过于臃肿,配置文件多且繁琐

6以前默认

postfix

优点更稳定,且交轻便

发布年限较短,市场占有率低

7以后默认

2.协议

    POP         邮件接收        端口号110        将服务器上的邮件,传输到客户端

    stmp  

二,Postfix的简介

是一种电子邮件服务器,它是由任职于IBM华生研究中心的荷兰籍研究员Wietse Venema为改良sendmail邮件服务器而产生的。最早在1990年代晚期出现,是个开放源代码的软件。

2.1 Postfix的安装

    # yum -y install postfix

2.2 Postfix的配置

    # vim /etc/postfix/main.cf

    myhostname = mail.birdteam.net                          #邮局系统的主机名

        

    mydomain =  birdteam.net                                #邮局系统域名

        

 

    myorigin = $mydomain                                    #从本机发出邮件域名名称

        

 

    inet_interfaces = all                                   #监听网卡接口

        

 

    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain   

                     #可接收邮件的主机名或域名

        

 

    mynetworks = 127.0.0.0/8, 192.168.7.0/24, 0.0.0.0/0                  

                          #设置可转发哪些主机的邮件

     

 

    relay_domains = $mydestination                         #设置可转发哪些网域的邮件

        

 

    home_mailbox = Maildir/                                 #使用邮箱目录

        

 

    smtpd_sasl_type = dovecot

    smtpd_sasl_path = private/auth

    smtpd_sasl_auth_enable = yes

    smtpd_sasl_security_options = noanonymous

    smtpd_sasl_local_domain = $myhostname

    smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject

  

   2.3 Dovecot的安装

    # yum -y install dovecot

  2.4  Dovecot的配置

     # vim /etc/dovecot/dovecot.conf

            protocols = imap pop3 lmtp 

            listen = *

 

     # vim /etc/dovecot/conf.d/10-auth.conf

            disable_plaintext_auth = no    

            auth_mechanisms = plain login

   

     # vim /etc/dovecot/conf.d/10-mail.conf

            mail_location = maildir:~/Maildir

 

   # vim /etc/dovecot/conf.d/10-master.conf

           unix_listener /var/spool/postfix/private/auth {

               mode = 0666    

               user = postfix    

               group = postfix

           }

    # vim /etc/dovecot/conf.d/10-ssl.conf

               ssl = no

 

       2.5 Dovecot的启动

          # systemctl start dovecot

          # systemctl restart postfix 

       2.6 vim /etc/

           # vim /var/named/baidu.com.zone

 

重启服务

 

    2,7 下载Foxmail

  •   创建邮箱

 

 

原文地址:https://www.cnblogs.com/pangzi520/p/10099018.html