下面一起來了解下dovecot+MySQL配置及搭建郵件云服務(wù)器方法,相信大家看完肯定會受益匪淺,文字在精不在多,希望dovecot+mysql配置及搭建郵件云服務(wù)器方法這篇短內(nèi)容是你想要的。
創(chuàng)新互聯(lián)建站主要從事做網(wǎng)站、成都做網(wǎng)站、網(wǎng)頁設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)望奎,10余年網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):13518219792
dovecot+mysql
一 配置
1 yum install dovecot-mysql.x86_64 -y###dovecot的插件,讓此軟件可以識別mysql###
2 vim /etc/dovecot/conf.d/10-auth.conf###編輯認(rèn)證文件###
內(nèi)容:
123 !include auth-sql.conf.ext###支持mysql認(rèn)證###
3 cp /usr/share/doc/dovecot-2.2.10/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext###生成dovecot讀取mysql的配置###
4 vim /etc/dovecot/dovecot-sql.conf.ext
內(nèi)容:
32 driver = mysql###數(shù)據(jù)庫類型###
71 connect = host=localhost dbname=email user=postuser password=postuser###連接查詢時(shí)用到的庫,用戶,密碼###
78 default_pass_scheme = PLAIN###默認(rèn)認(rèn)證方式為明文###
107 password_query = \###查詢密碼匹配###
108 SELECT username, domain, password \
109 FROM emailuser WHERE username = '%u' AND domain = '%d'
125 user_query = SELECT maildir, 666 AS uid, 666 AS gid FROM emailuser WHERE username = '%u'###查詢郵件內(nèi)容###
5 vim /etc/dovecot/conf.d/10-mail.conf
內(nèi)容:
168 first_valid_uid = 666###郵件文件查詢用戶身份###
175 first_valid_gid = 666
30 mail_location = maildir:/home/vmail/%d/%n###指定郵件位置###
6 systemctl restart dovecot.service
測試:
[root@foundation78 Desktop]# telnet 172.25.254.112 110
Trying 172.25.254.112...
Connected to 172.25.254.112.
Escape character is '^]'.
+OK [XCLIENT] Dovecot ready.
user lee@lee.com
+OK
pass lee
+OK Logged in.
quit
+OK Logging out.
Connection closed by foreign host.
在thunderbird中可以直接測試:
二 空殼郵件
1 )null客戶端
1 vim /etc/postfix/main.cf
內(nèi)容:
mydomain = example.com###域名###
myorigin = westos.com###偽裝為真實(shí)郵件云服務(wù)器的所在域###
myhostname = mail.example.com###主機(jī)名###
mydestination =###為空,不接受郵件###
relayhost = 172.25.254.112###轉(zhuǎn)發(fā)給真實(shí)的郵件云服務(wù)器###
2 systemctl restart postfix.service
3 測試:
空殼郵件云服務(wù)器:
[root@mail ~]# mail root@example.com
Subject: dskjaf
skdja
.
EOT
[root@mail ~]# mailq
Mail queue is empty
[root@mail ~]# mail
No mail for root
真實(shí)的郵件云服務(wù)器###
[root@westos-mail ~]# mail
Heirloom Mail version 12.5 7/5/10. Type ? for help.
"/var/spool/mail/root": 3 messages 3 new
>N 1 root Sat May 27 23:23 21/753 "hfue"
N 2 root Sat May 27 23:23 21/757 "hjk"
N 3 root Sat May 27 23:24 21/752 "dskjaf"
& 3
Message 3:
From root@mail.example.com Sat May 27 23:24:11 2017
Return-Path:
X-Original-To: root@example.com
Delivered-To: root@example.com
Date: Sat, 27 May 2017 23:24:08 -0400
To: root@example.com
Subject: dskjaf
User-Agent: Heirloom mailx 12.5 7/5/10
Content-Type: text/plain; charset=us-ascii
From: root@mail.example.com (root)
Status: R
skdja
& q
Held 3 messages in /var/spool/mail/root
看完dovecot+mysql配置及搭建郵件云服務(wù)器方法這篇文章后,很多讀者朋友肯定會想要了解更多的相關(guān)內(nèi)容,如需獲取更多的行業(yè)信息,可以關(guān)注我們的行業(yè)資訊欄目。