# setenforce 0
# yum -y install mysql-server
# chkconfig mysqld on
# /etc/init.d/mysqld start
# /usr/bin/mysql_secure_installation
# useradd -u 600 -s /sbin/nologin email
# mysql -p
mysql> create database postfix;
mysql> use postfix;
mysql> create table email (username varchar(30), password varchar(30), domain varchar(30), mailbox varchar(30));
mysql> insert into email values ('william@gmail.com', 'westos', 'gmail.com', 'gmail.com/william/');
# vi /etc/postfix/mysql_virtual_alias_maps.cf
hosts = localhost
user = email
password = westos
dbname = postfix
table = email
select_field = username
where_field = username
# vi /etc/postfix/mysql_virtual_domain_maps.cf
hosts = localhost
user = email
password = westos
dbname = postfix
table = email
select_field = domain
where_field = domain
# vi /etc/postfix/mysql_virtual_mailbox_maps.cf
hosts = localhost
user = email
password = westos
dbname = postfix
table = email
select_field = mailbox
where_field = username
# postmap -q "william@gmail.com" mysql:/etc/postfix/mysql_virtual_alias_maps.cf
william@gmail.com
# postmap -q "gmail.com" mysql:/etc/postfix/mysql_virtual_domain_maps.cf
gmail.com
# postmap -q "william@gmail.com" mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
gmail.com/william/
# postconf -d | grep virtual
# postconf -e virtual_mailbox_base=/home/email/
# postconf -e virtual_uid_maps=static:600
# postconf -e virtual_gid_maps=static:600
# postconf -e virtual_alias_maps=mysql:/etc/postfix/mysql_virtual_alias_maps.cf
# postconf -e virtual_mailbox_domains=mysql:/etc/postfix/mysql_virtual_domain_maps.cf
# postconf -e virtual_mailbox_maps=mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
# /etc/init.d/postfix restart
# mail william@gmail.com
# ls /home/email/gmail.com/william/
cur new tmp
postfix+mysql
原创
©著作权归作者所有:来自51CTO博客作者williamherry的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:Shell 输出小棋盘
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
postfix之postfix详解
postfix: 日志: /var/log/maillog 邮件别名: 将发给a的邮件发给b。 &nb
linux mail postfix -
postfix+dovecot+mysql+postfixadmin
最近一直在测试 postfix ,发现postfix + dovecot 配置简单不烦琐,dovecot 是后起之秀,下面就来操作,我是如何搭建的。 mai server系统 : ubuntu serv
mysql 邮件服务器 postfix dovecot postfixadmin -
Postfix
Postfix 在附件
邮件 postfix -
Mysql+Postfix+Dovecot+Extmail
mysql+postfix+dovecot+extmail搭建邮件服务器,基于开源版的ExtMail 邮件系统,提供更强大功能,支持分布式、高可用和集群等。这里先记下部署extmail基本邮件系统。
Mysql Postfix Dovecot Extmail rhel6