免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1312 | 回复: 0
打印 上一主题 下一主题

postfix 多域名支持 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-09-02 14:58 |只看该作者 |倒序浏览

main.cf文件
设置

# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
message_size_limit = 1572864000
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
#sasl parameters
smtpd_sasl_type=dovecot
smtpd_sasl_auth_enable = yes
smtpd_sasl_path= private/auth
smtpd_recipient_restrictions= permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
#alias_maps = hash:/etc/aliases
#alias_database = hash:/etc/aliases
#myorigin = $mydomain
#mydestination = mail.$mydomain, localhost.$mydomain, localhost
myhostname = localhost  //默认
#mydestination = mail.$mydomain, localhost.$mydomain, localhost
#mynetworks = 127.0.0.0/8 ,192.168.1.0/24
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
#mailbox_command = procmail -a "$EXTENSION"
#default_transport = smtp
#home_mailbox = Maildir/
mydestination = debian.domain, localhost, localhost.localdomain, localhost
relayhost =
#mynetworks = 127.0.0.0
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_uid_maps = static:5566
virtual_gid_maps = static:5566
virtual_mailbox_maps =
mysql
:/home/postfix/-mailbox-maps.cf
virtual_mailbox_domains = mysql:/home/postfix/-mailbox-domains.cf
#virtual_alias_maps = mysql:/home/postfix/-alias-maps.cf,mysql:/home/postfix/-email2email.cf
virtual_alias_maps = mysql:/home/postfix/-alias-maps.cf
sender_bcc_maps = mysql:/home/postfix/-mail-watch.cf
recipient_bcc_maps = mysql:/home/postfix/-mail-watch.cf
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
#content_filter = smtp-amavis:[127.0.0.1]:10024
#receive_override_options = no_address_mappings
smtp_fallback_relay =
transport_maps = hash:/home/postfix/transport
------------------------------------------------------------------------
/etc/mailname
文件
内容为:
debian.domain
----------------------------------------------------

数据库
中,表virtual_domains中添加一个域名,如
mysql> insert into virtual_domains(name,remark,state) values ('abc.com',' ','o');
mysql> select * from virtual_domains;
+----+--------------+--------+-------+
| id | name         | remark | state |
+----+--------------+--------+-------+
|  2 | abc.org         |        | o     |
|  3 | abc.com       |        | o     |
+----+--------------+--------+-------+
-------------------------------------------------
在/etc/amavis/conf.d/20-debian_defaults中,添加
@local_domains_maps= ( [".abc.org",".abc.com"] );
此函数在/usr/sbin/amavisd-new 中定义的,如果保留默认值或者注释的话,那么只能做到检查不会添加SPAM标记,仔细查看了amavisd-new的文档实验出来了。
而且还以用hash表的方式保存虚拟域,如:
read_hash(\%local_domains, '/etc/amavis/local_domains');
#/etc/amavis/local_domains
abc.org
abc.com
之所以修改amavisd配置文件,是为了使两个域名都能够进行
反垃圾
扫描,如果不加的话,amavisd只会对一个域名进行反垃圾


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/93831/showart_2043970.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP