postfix + mariadb
来源:互联网 发布:网络会计论文参考文献 编辑:程序博客网 时间:2024/06/10 07:42
1.安装
yum install httpd php php-mysql mariadb-server -y
2.配置mysql
(1)编辑配置文件
vim /etc/my.cnf
skip-networking=1 ##跳过网络,是
(2)mysql加密
(3)安装网页管理所需工具并配置
解压:
解压后将其改名为mysqladmin:
复制样板配置文件后编辑
3.添加数据库与表
(1)登录后添加数据库email
(2)在数据库email里添加数据表emailuser
(3)在数据表中添加username,password,domain,maildir这四个字段,类型都为VARCHAR
(4)在emailuser表中添加值如下图:
(5)创建用户并授权
create user postfix@localhost identified by 'postfix' ##创建数据库用户postuser@loaclhost,密码为postuser
grant select,update,insert on email.* to postuser@localhost ##为用户postuser授权
(6)登入postuser,查看emailuser表内容
3.配置postfix
vim /etc/postfix/mailuser.cf ##用户名查询
##
hosts = localhost ##数据库所在主机
user = postuser ##登录数据库的用户
password = postuser ##登录数据库的密码
dbname = email ##postfix要查询数据库的名称
table = emailuser ##postfix要查询数据表的名称
select_field = username ##postfix要查询的字段
where_field = username ##用户给定postfix的查询条件
vim maildomain.cf ##用户域名查询
##
hosts = localhost
user = postuser
password = postuser
dbname = email
table = emailuser
select_field = domain ##给定查询字段为domain
where_field = domain
vim mailbox.cf ##用户邮箱位置查询
##
hosts = localhost
user = postuser
password = postuser
dbname = email
table = emailuser
select_field = maildir ##给定要查询字段为maildir
where_field = username
测试:
postmap -q "lk@lk.com" mysql:/etc/postfix/mailuser.cf
postmap -q "lk.com" mysql:/etc/postfix/maildomain.cf
postmap -q "lk@lk.com" mysql:/etc/postfix/mailbox.cf
4.添加用户vmail
groupadd -g 666 vmail ##新建组vmail指定gid为666
useradd -s /sbin/nologin -u 666 vmail -g 666 ##新建用户vmail所使用shell为/sbin/nllogin,指定uid和gid都为666
5.配置postfix
postconf -e "virtual_mailbox_base = /home/vmail" ##虚拟用户邮件目录
postconf -e "virtual_uid_maps = static:666" ##指定虚拟用户简历文件uid
postconf -e "virtual_gid_maps = static:666" ##指定虚拟用户建立文件gid
postconf -e "virtual_alias_maps = mysql:/etc/postfix/mailuser.cf" ##指定mysql查找主机名
postconf -e "virtual_mailbox_domains = mysql:/postfix/maildomain.cf" ##指定mysql查找域名
postconf -e "virtual_mailbox_maps = mysql:/etc/postfix/mailbox.cf" ##指定mysql查找邮件目录
测试:
效果:
- postfix + mariadb
- postfix + mariadb
- mail postfix postfix+mariadb
- POSTFIX+MARIADB postfix空壳邮件
- mail,postfix,postpix+mariadb,dovecot,dovecot+mariadb,postfix空壳邮件
- postfix邮件服务+mariadb数据库
- CentOS 7使用Postfix、Dovecot及MariaDB搭建邮箱服务器
- Linux学习篇第三章之~postfix & mariadb
- Postfix
- postfix
- postfix
- postfix
- postfix
- postfix
- mariaDB
- MariaDB
- MariaDB
- mariaDB
- 我不知道在你们求学期间,我教给了你们什么
- Mali GPU OpenGL ES 应用性能优化--测试+定位+优化流程
- Shiro使用详解
- DataGrip使用入门-常用设置(二)
- springmvc+spring+mybatis整合实例
- postfix + mariadb
- 查看本地连接的网络映射拓扑图
- Python项目中requirement.txt文件
- CSDN-markdown编辑器语法
- Spring + SpringMVC + Druid + JPA(Hibernate impl) 给你一个稳妥的后端解决方案
- bootstrap学习12--按钮
- DataGrip使用入门-常用操作(三)
- WIN10下搭建vue开发环境
- servlet程序HTTP Status 500