分类: LINUX
2009-09-02 14:58:45
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 = :/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只会对一个域名进行反垃圾