1. Yum Install dovecot dovecot-mysql.x86_64-y
# #dovecot is an open source IMAP and POP3 mail server that supports Linux and supports sending mail
# #dovecot-mysql is the Dovecot plugin that lets Dovecot recognize MySQL
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/97/3D/wKiom1krjifxI5XvAACc3W61q8Y789.png "title=" 418muff[dkre6xfhg~{f8y2.png "alt=" Wkiom1krjifxi5xvaacc3w61q8y789.png "/>
2. vim/etc/dovecot/dovecot.conf
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/97/3D/wKiom1krjkjwIEWjAAAnfPiaAD0770.png "title=" [ Vu83ydz]p9k7@zlf_q9m%1.png "alt=" Wkiom1krjkjwiewjaaanfpiaad0770.png "/>
protocols = IMAP POP3 LMTP # #支持的收件协议
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/97/3D/wKiom1krjt3BNC_vAABmEs6p-aY131.png "title=" ~l6% Cb07]l~]uir (4[i[rf0.png "alt=" Wkiom1krjt3bnc_vaabmes6p-ay131.png "/>
Login_trusted_networks = 0.0.0.0/0 # #信任任何网络
Disable_plaintext_auth = no # #开启明文认证
3 . vim/etc/dovecot/conf.d/10-auth.conf
123!include Auth-sql.conf.ext # #开启MySQL认证方式
4. cp/usr/share/doc/dovecot-2.2.10/example-config/dovecot-sql.conf.ext/etc/dovecot/ Dovecot-sql.conf.ext
# #生成dovecot读取MySQL配置
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/97/3D/wKiom1krkAXhWF-gAAA8SEihzLA210.png "title=" Wkug " @SQU7 ([a1%q$%yg$tg.png "alt=" Wkiom1krkaxhwf-gaaa8seihzla210.png "/>
5.Vim/etc/dovecot/dovecot-sql.conf.ext
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/97/3D/wKiom1krkLeCjdbDAAAbS2UR5Ik037.png "title=" Uybdb5970q8zl5lt%l (c1yn.png "alt=" Wkiom1krklecjdbdaaabs2ur5ik037.png "/>
Driver = mysql # #数据库类型
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/97/3E/wKioL1krkRnAF1mBAAAjRyW0w-w480.png "title=" FFR9 " 87a_v9r}h}mzp@90bo.png "alt=" Wkiol1krkrnaf1mbaaajryw0w-w480.png "/>
Connect = host=localhost dbname=email user=postuser password=123 # #查询用到的数据 Library, user and password
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/97/3E/wKioL1krkUSgCFMOAAArNAPu_20751.png "title=" r%0 2z8{v3bbw$aw$) ' njzbq.png ' alt= "Wkiol1krkusgcfmoaaarnapu_20751.png"/>
Default_pass_scheme = PLAIN # #默认认证方式为明文
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/97/3E/wKioL1krkY_g8_4BAABAoyhN5Js042.png "title=" _ W2qjwn9q{j~b (KY) 1qu%a.png "alt=" Wkiol1krky_g8_4baabaoyhn5js042.png "/>
107 password_query = \ # #查询密码匹配
108 SELECT username, domain, password \ # #查询用户, domains, passwords
109 from Emailuser WHERE username = '%u ' and domain = '%d ' # #从emailuser表中查询
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/97/3E/wKioL1krkhej1ThDAAAqWvWv16A057.png "title=" Fhpc8l1i{ieybvwi3{35dw1.png "alt=" Wkiol1krkhej1thdaaaqwvwv16a057.png "/>
user_query = SELECT maildir, 666 as UID, 666 as GID from emailuser WHERE username = '%u ' # #查询邮 Internal content of the piece
6. vim/etc/dovecot/conf.d/10-mail.conf
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/97/3D/wKiom1krkqjAYqFQAAAYbs9Jh-c135.png "title=" p~6 (@ lp_0x6b) nrbr_~xo6a.png "alt=" Wkiom1krkqjayqfqaaaybs9jh-c135.png "/>
3 0 mail_location = maildir:/home/vmail/%d/%n # #指定邮件位置
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/97/3D/wKiom1krkzOAryI-AACE8qjDa00097.png "title=")%gs ' (D)]) lqpzp}t]5m.png "alt=" Wkiom1krkzoaryi-aace8qjda00097.png "/>
168 first_valid_uid = 666 # #邮件查询用户身份
175 First_valid_gid = 666
7.systemctl Restart Dovecot.service # #重启dovecot服务
* * Test
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/97/3E/wKiom1krlAOgVfziAABrZNqVf10374.png "title=" 8M6 "~ 0CDPDY[U~KYGLRXV (1.png "alt=" Wkiom1krlaogvfziaabrznqvf10374.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/97/3E/wKioL1krlEGSTRz6AABmjTtvN7c137.png "title=" {[ G80f~[p%3fq]5lf{n5]dq.png "alt=" Wkiol1krlegstrz6aabmjttvn7c137.png "/>
8. Empty Shell Mail
vim/etc/postfix/main.cf
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/97/3F/wKioL1krlMiBSevwAAAaY-wNYOo918.png "title=" @o]od {(VMJE3Q0WFTSPSF) p.png "alt=" Wkiol1krlmibsevwaaaay-wnyoo918.png "/>
Myorigin = westos.com # # Set to the real host domain name
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/97/3E/wKiom1krlWPCGp5WAABVohSObnw375.png "title=" 4% 1ICMG9LC{SWFRM) d_g_ge.png "alt=" Wkiom1krlwpcgp5waabvohsobnw375.png "/>
mydestination = # #空壳邮件不接受邮件, so do not set
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/97/3F/wKioL1krljyRSBXbAAAqId7eTzk541.png "title=" [KW] Jpb15igop$_h0v[cp2n.png "alt=" Wkiol1krljyrsbxbaaaqid7etzk541.png "/>
Relayhost = 172.25.254.174 # #接替的真实主机的IP
* * Test
Empty shell host sends mail to native root, 174 host receives mail
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/97/3F/wKioL1krlyvR0zjdAABLhFUtKJw043.png "title=" qu$ M8p}lda@rl$4%]677o (c.png "alt=" Wkiol1krlyvr0zjdaablhfutkjw043.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/97/3E/wKiom1krl1-RnkcyAAFPNCQrjLY907.png "title=" $ Y9kvggmba ' 2) to1da6$ysl.png "alt=" Wkiom1krl1-rnkcyaafpncqrjly907.png "/>
Dovecot+mysql pickup service and empty shell mail