dovecot+mysql如何搭建邮件云服务器
下面跟着笔者一起来了解下dovecot+MySQL如何搭建邮件云服务器,相信大家看完肯定会受益匪浅,文字在精不在多,希望dovecot+mysql如何搭建邮件云服务器这篇短内容是你想要的。
创新互联公司长期为上千客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为北塔企业提供专业的成都做网站、成都网站建设,北塔网站改版等技术服务。拥有十多年丰富建站经验和众多成功案例,为您定制开发。
1.[root@westos-mail ~]# yum install dovecot-mysql.x86_64 -y#dovecot的插件,让此软件可以识别mysql###
2.[root@westos-mail ~]# vim /etc/dovecot/conf.d/10-auth.conf #认证文件
123 !include auth-sql.conf.ext #同意mysql认证
3.cp /usr/share/doc/dovecot-2.2.10/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext #生成dovecot读取mysql的配置
4.[root@westos-mail ~]# vim /etc/dovecot/dovecot-sql.conf.ext #修改配置
32 driver = mysql #数据库类型
71 connect = host=localhost dbname=email user=postuser password=postuser #登录(连接查询)的库、用户、密码
78 default_pass_scheme = PLAIN #默认认证方式为明文
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' #查询邮件内容
5.[root@westos-mail ~]# vim /etc/dovecot/conf.d/10-mail.conf
168 first_valid_uid = 666 #邮件文件查询用户
175 first_valid_gid = 666
30 mail_location = maildir:/home/vmail/%d/%n #邮件指定位置
6.[root@westos-mail ~]# systemctl restart dovecot.service
测试:
[root@westos-mail ~]# telnet 172.25.254.113 110
Trying 172.25.254.113...
Connected to 172.25.254.113.
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
####空壳邮件####
空壳:
别人看见的是这台“假主机”,炮灰。
对外显示与真实机相同,别人发送的邮件表象给它,实则是它转给真是主机。
1.[root@mail ~]# vim /etc/postfix/main.cf
76 myhostname = qq-mail.qq.com #主机名
83 mydomain = qq.com #域名
99 myorigin = westos.com #真实云服务器所在的域
116 inet_interfaces = all
119 inet_protocols = all
164 mydestination = #不接受任何邮件
316 relayhost = 172.25.254.113 #转发到真实的邮件云服务器
2.[root@mail ~]# systemctl restart postfix.service
测试:
发送端:
[root@qq-mail ~]# mail root@westos.com
Subject: wq
521
,
.
EOT
[root@qq-mail ~]# mail
No mail for root
[root@qq-mail ~]# mailq
Mail queue is empty
真实的邮件云服务器端:
[root@westos-mail ~]# mail
Heirloom Mail version 12.5 7/5/10. Type ? for help.
"/var/spool/mail/root": 2 messages 1 new
1 westos@westos.com Mon May 22 05:52 19/573 "hah"
>N 2 root Wed May 31 05:15 22/724 "wq"
& 2
Message 2:
From root@westos.com Wed May 31 05:15:45 2017
Return-Path:
X-Original-To: root@westos.com
Delivered-To: root@westos.com
Date: Wed, 31 May 2017 05:15:45 -0400
To: root@westos.com
Subject: wq
User-Agent: Heirloom mailx 12.5 7/5/10
Content-Type: text/plain; charset=us-ascii
From: root@westos.com (root)
Status: R
521
,
& q
Held 2 messages in /var/spool/mail/root
You have mail in /var/spool/mail/root
[root@westos-mail ~]#
看完dovecot+mysql如何搭建邮件云服务器这篇文章后,很多读者朋友肯定会想要了解更多的相关内容,如需获取更多的行业信息,可以关注我们的行业资讯栏目。
新闻名称:dovecot+mysql如何搭建邮件云服务器
网站路径:http://scjbc.cn/article/igpoch.html