postfix+mysql接收邮件+空壳服务器
##########################################postfix+mysql
**).使用客户端工具接收邮件
yum install dovecot dovecot-mysql -y ##dovecot-mysql dovecot软件的插件,让此软件可以识别mysql
vim /etc/dovecot/dovecot.conf
24 protocols = imap pop3 lmtp ##支持收件协议
48 login_trusted_networks = 0.0.0.0/0 ##信任的网络
49 disable_plaintext_auth = no ##开启明文认证
vim /etc/dovecot/conf.d/10-auth.conf
123 !include auth-sql.conf.ext ##开启mysql的认证方式
cp /usr/share/doc/dovecot-2.2.10/example-config/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext ##mysql认证文件
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 ##默认认证方式为明文
107 password_query = \ ##查询密码匹配的数据
108 SELECT username, domain, password \
109 FROM emailuser WHERE username = '%u' AND domain = '%d'
125 user_query = SELECT mailbox, 666 AS uid, 666 AS gid FROM emailuser WHERE username = '%u' ##查询邮件内容
vim /etc/dovecot/conf.d/10-mail.conf
30 mail_location = maildir:/home/vmail/%d/%n ##指定邮件的位置
168 first_valid_uid = 666 ##邮件文件查询用户身份
175 first_valid_gid = 666
systemctl restart dovecot
测试:
yum install telnet -y
[[email protected] vmail]# telnet 172.25.254.123 110
Trying 172.25.254.123...
Connected to 172.25.254.123.
Escape character is '^]'.
+OK [XCLIENT] Dovecot ready.
user [email protected]
+OK
pass lala
+OK Logged in.
可以用雷鸟软件收发邮件
**).空壳服务器
desktop:mail.westos.com
server:nullmail.example.com
vim /etc/postfix/main.cf
75 myhostname = nullmail.example.com
83 mydomain = example.com
99 myorigin = westos.com ##和desktop端的域名必须一致
113 inet_interfaces = all
164 mydestination =
316 relayhost = 172.25.254.123
systemctl restart postfix
测试:
server端给自己发送邮件,desktop会收到





desktop:mail.westos.com
server:nullmail.example.com
vim /etc/postfix/main.cf
75 myhostname = nullmail.example.com
83 mydomain = example.com
99 myorigin = westos.com ##和desktop端的域名必须一致
113 inet_interfaces = all
164 mydestination =
316 relayhost = 172.25.254.123
systemctl restart postfix
测试:
server端给自己发送邮件,desktop会收到