色婷五一,精品亚洲欧美一区二区三区日产 ,精选国产AV剧情,无码丰满少妇2在线观看

18600329666

咨詢技術(shù)專(zhuān)家

掃一掃
與技術(shù)專(zhuān)家在線溝通

Menu
linux系統(tǒng)搭建企業(yè)專(zhuān)屬郵件服務(wù)器
對(duì)于中小企業(yè)擁有自己獨(dú)立的郵件服務(wù)器不僅能夠提升企業(yè)形象,而且能夠永久性保存企業(yè)私密文件,使用免費(fèi)郵箱一方面文件無(wú)法永久保存,另一方面可能面臨數(shù)據(jù)泄露風(fēng)險(xiǎn),收費(fèi)郵件也很多,單大多按賬戶數(shù)收費(fèi),那么如何搭建自己的郵件服務(wù)器呢,本文使用Postfix+Dovecot+Cyrus-sasl搭建企業(yè)電子郵箱
一、需求清單
域名
安裝有CentOS 7操作系統(tǒng)的主機(jī)
Postfix+Dovecot+Cyrus-sasl
耐心
二、操作流程
1.配置域名DNS
首先按照下列提示完成域名解析的配置。
首先要有指定 ip 的 A 記錄解析 @ A 1.1.1.1 需要有 mail 二級(jí)域名的 A 記錄解析 mail A 1.1.1.1 MX 記錄解析 @ MX mail.YOURDOMAIN.cn. TXT解析 @ TXT v=spf1 include:spf.mail.YOURDOMAIN.com ~all 
2.停止系統(tǒng)自帶的Sendmail服務(wù)
在終端執(zhí)行一下從而停止Sendmail服務(wù) /etc/init.d/sendmail stop 執(zhí)行下列指令,移除Sendmail服務(wù) yum remove sendmail 
3.安裝相關(guān)軟件
//安裝 postfix 和 dovecot yum install postfix dovecot //安裝 cyrus-sasl yum install cyrus-sasl-* 
4.配置Postfix
我們將Postfix作為發(fā)送郵件服務(wù)器,Postfix通過(guò)修改安裝目錄下的main.cf文件來(lái)配置。其設(shè)置是否正確直接影響到軟件能否啟動(dòng)以及郵件的正確的發(fā)送。請(qǐng)務(wù)必按照下方的配置方式配置。
/etc/postfix/main.cf
//在終端輸入下面這條指令,通過(guò)vim打開(kāi)main.cf,并找出下列內(nèi)容修改 vim /etc/postfix/main.cf myhostname=mail.YOURDOMAIN.cn //這里要換成你自己的郵箱服務(wù)器 mydomain=YOURDOMAIN.cn //這里換成你自己的主機(jī)服務(wù)器 myorigin = $mydomain inet_interfaces = all //可以接收所有域名的郵件 inet_protocols = all mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain,mail.$mydomain, www.$mydomain, ftp.$mydomain local_recipient_maps = mynetworks =0.0.0.0/0 //設(shè)置內(nèi)網(wǎng)ip relay_domains = $mydestination home_mailbox = Maildir/ smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes smtpd_recipient_restrictions = permit_sasl_authenticated,reject_unauth_destination,permit_mynetworks smtpd_client_restrictions = permit_sasl_authenticated
5.配置Dovecot
Dovecot是一個(gè)開(kāi)源的 IMAP 和 POP3 郵件服務(wù)器,支持 Linux/Unix 系統(tǒng)。正確的配置下列相關(guān)文件才能達(dá)到正確的接收郵件。
/etc/dovecot/dovecot.conf
/etc/dovecot/conf.d/10-auth.conf
/etc/dovecot/conf.d/10-mail.conf
/etc/dovecot/conf.d/10-ssl.conf
/etc/dovecot/conf.d/listen.conf  //CREATE  NEW FILE
//在終端輸入下面的指令,打開(kāi)dovecot的配置文件 vim /etc/dovecot/dovecot.conf protocols = imap pop3 lmtp listen = * //在終端輸入下面的指令,打開(kāi)dovecot授權(quán)的配制文件,并找出下列內(nèi)容修改 vim /etc/dovecot/conf.d/10-auth.conf disable_plaintext_auth = no auth_mechanisms = plain //在終端輸入下面的指令,打開(kāi)dovecot郵件的配制文件,并找出下列內(nèi)容修改 vim /etc/dovecot/conf.d/10-mail.conf mail_location = maildir:~/Maildir //在終端輸入下面的指令,打開(kāi)dovecot安全連接的配制文件,并找出下列內(nèi)容修改 vim /etc/dovecot/conf.d/10-ssl.conf ssl = no //CREATE NEW FILE BY COMMAND BLOW AND ADD SOME CONFIG IN THIS FILE touch /etc/dovecot/conf.d/listen.conf auth default { socket listen { client { path = /var/spool/postfix/private/auth mode = 0660 user = postfix group = postfix } } mechanisms = plain login } 
6.配置Cyrus-sasl
Cyrus-sasl用于提供用戶驗(yàn)證功能,正確的配置才能讓第三方郵件客戶端通過(guò)本機(jī)系統(tǒng)用戶登錄郵件服務(wù)器進(jìn)行郵件的收發(fā)。
/etc/sysconfig/saslauthd
/etc/sasl2/stmpd.conf         (64位系統(tǒng))
/usr/lib/sasl2/stmpd.conf    (32位系統(tǒng))
//通過(guò)vim打開(kāi) sysconfig目錄下的saslauthd 并修改下列選項(xiàng) vim /etc/sysconfig/saslauthd MECH=shadow //指定以本地系統(tǒng)用戶名認(rèn)證 vim /etc/sasl2/smtpd.conf //64位系統(tǒng) vim /usr/lib/sasl2/smtpd.conf //32位系統(tǒng) //加入以下代碼,主要是設(shè)置記錄Log模式,設(shè)置smtp尋找cyrus-sasl的路徑。 pwcheck_method: saslauthd mech_list: PLAIN LOGIN log_level: 3 saslauthd_path:/var/run/saslauthd/mux
7.啟動(dòng)服務(wù)并設(shè)置開(kāi)機(jī)啟動(dòng)
*CentOS 7  系統(tǒng)中服務(wù)啟動(dòng)方式改為了  systemctl  start  服務(wù)名 
*CentOS 7  系統(tǒng)中服務(wù)開(kāi)機(jī)啟動(dòng)方式改為了  systemctl enable 服務(wù)名 
//啟動(dòng)dovecot systemctl start dovecot //啟動(dòng)postfix systemctl start postfix //啟動(dòng)saslauthd systemctl start saslauthd //設(shè)置dovecot開(kāi)機(jī)啟動(dòng) systemctl enable dovecot //設(shè)置postfix開(kāi)機(jī)啟動(dòng) systemctl enable postfix //設(shè)置saslauthd開(kāi)機(jī)啟動(dòng) systemctl enable saslauthd
三、測(cè)試服務(wù)
1.創(chuàng)建郵箱用戶
//添加用戶admin useradd admin //修改密碼 passwd admin //按步驟完成
2.在郵箱客戶端(如Outlook)測(cè)試
按照添加新用戶流程,設(shè)置相關(guān)內(nèi)容,注意:用戶名應(yīng)該填入你創(chuàng)建的用戶名而不是郵箱地址,否則登陸驗(yàn)證將不被通過(guò)。
eg:創(chuàng)建的用戶為admin,則在用戶名項(xiàng)應(yīng)填入admin。不是admin@YOUDOMAIN.cn