邮件服务器需要一个帐户接收两个域的邮件, 在网上查了很多资料都不行,google了很长时间,才找到一点线索, 终于搞定了, 步骤就是:
首先你的postfix要支持regexp的查询表, 通过postconf -m, 可以看出是否支持, 就是正则表达式了(pcre),
这里举例发到xxx@abc.com.cn的邮件xxx@abc.com的域也可以收到
1. 添加虚拟域abc.com.cn
2. 建立文件/etc/postfix/reg_virtual.cf文件, 内容:
/(.*)@abc\.com\.cn/ $(1)@abc.com
3. 执行postmap /etc/postfix/reg_virtual.cf
4. 修改/etc/postfix/main.cf中的virtual_alias_maps为
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf regexp:/etc/postfix/reg_virtual.cf
(上面假设你已经有了mysql查询表, 上面没有换行, regexp前有空格)
5. 重启postfix
这样就OK了
参考文档
Using sympa_virtual with Postfix instead of regexp aliases
REGEXP_TABLE(5) REGEXP_TABLE(5)Postfix PipePostfix FilterDefending E-mail HOWTO
2008-11-02 22:20:56, 1005 reviews, comment
send to mailbox
postfix中控制发送外部,内部邮件的方法
debian中架设postfix全功能邮件服务器
少年,不点下广告吗!
all by shitou
blog comments powered by Disqus