- 论坛徽章:
- 0
|
我也遇到了跟你一样的问题。用的postfix
我的配置文件为:
修改/etc/postfix/main.cf的配置:
myhostname = mail.cngnu.org
mydomain = cngnu.org
myorigin = $mydomain
mydestination = $mydomain,$myhostname
mynetworks_style = host
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases
home_mailbox = Maildir/
mailbox_transport = cyrus
fallback_transport = cyrus
virtual_maps = hash:/etc/postfix/virtual,mysql:/etc/postfix/virtual.mysql
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
check_recipient_access mysql:/etc/postfix/filter.mysql,
reject_invalid_hostname,
reject_non_fqdn_hostname,
reject_unknown_sender_domain,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
reject_unauth_pipelining,
reject_unauth_destination,
permit
并新建了如下二个文件:
[root@mail postfix]# vi virtual.mysql
#
# mysql config file for alias lookups on postfix
#
# the user name and password to log into the mysql server
hosts = localhost
user = mail
password = secret
# the database name on the servers
dbname = mail
# the table name
table = USER
select_field = FORWARD
where_field = USERNAME
additional_conditions = and STATUS = 1 limit 1
[root@mail postfix]# vi filter.mysql
#
# mysql config file for filter flag on postfix
#
# the user name and password to log into the mysql server
hosts = localhost
user = mail
password = secret
# the database name on the servers
dbname = mail
# the table name
table = USER
select_field = FILTER
# OK : ignore filter
# DUNNO : filter
where_field = MAIL
additional_conditions = and STATUS = 1 limit 1 |
|