- 论坛徽章:
- 0
|
本人做了一个 postfix + mysql 的正常的 ,但是 想要转移到ldap上 不知道如何下手 ,这方面网上的资料很少呀,希望那位大侠 指点一二. 多谢.
我是在bsd上面做的,其它平台应该类似. 呵呵
详细配置如下:
mail.cf
-------------------------------------------------------------------------------------
myhostname = mail.example.com
mydomain = example.com
mydestination = example.com
local_recipient_maps = $alias_maps $virtual_mailbox_maps unix:passwd.byname
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions =
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unknown_sender_domain,
reject_unknown_recipient_domain,
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
check_recipient_access mysql:/usr/local/etc/postfix/mysql-recipient.cf,
reject_unauth_pipelining,
reject_invalid_hostname,
reject_non_fqdn_hostname,
reject_rbl_client cbl.abuseat.org
reject_rbl_client dul.dnsbl.sorbs.net
reject_rbl_client sbl.spamhaus.org
reject_rbl_client list.dsbl.org
reject_rbl_client relays.ordb.org
reject_rbl_client opm.blitzed.org
reject_rhsbl_sender dsn.rfc-ignorant.org
permit
header_checks =
regexp:/usr/local/etc/postfix/header_checks.regexp
body_checks =
regexp:/usr/local/etc/postfix/body_checks.regexp
broken_sasl_auth_clients = yes
show_user_unknown_table_name = no
smtpd_sender_restrictions = check_sender_access mysql:/usr/local/etc/postfix/mysql-sender.cf
smtpd_client_restrictions = check_client_access mysql:/usr/local/etc/postfix/mysql-client.cf
alias_maps = mysql:/usr/local/etc/postfix/mysql-aliases.cf,hash:/usr/local/mailman/data/aliases
relocated_maps = mysql:/usr/local/etc/postfix/mysql-relocated.cf
transport_maps = mysql:/usr/local/etc/postfix/mysql-transport.cf
maildrop_destination_recipient_limit = 1
virtual_transport = maildrop
virtual_mailbox_domains = mysql:/usr/local/etc/postfix/mysql-virtual-domains.cf
virtual_alias_maps = mysql:/usr/local/etc/postfix/mysql-virtual.cf
virtual_mailbox_base = /mail/vmail
virtual_mailbox_maps = mysql:/usr/local/etc/postfix/mysql-virtual-maps.cf
virtual_uid_maps = mysql:/usr/local/etc/postfix/mysql-virtual-uid.cf
virtual_gid_maps = mysql:/usr/local/etc/postfix/mysql-virtual-gid.cf
#OPTIONAL PART
smtpd_helo_required = yes
disable_vrfy_command = yes
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_etrn_restrictions = reject
queue_directory = /var/spool/postfix
command_directory = /usr/local/sbin
daemon_directory = /usr/local/libexec/postfix
mail_owner = postfix
unknown_local_recipient_reject_code = 450
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/local/sbin/sendmail
newaliases_path = /usr/local/bin/newaliases
mailq_path = /usr/local/bin/mailq
setgid_group = maildrop
manpage_directory = /usr/local/man
sample_directory = /usr/local/etc/postfix
readme_directory = no
empty_address_recipient = MAILER-DAEMON
smtpd_banner = Welcome to BJOFFICE Mail Service System!
smtp_helo_name = example.com
message_size_limit = 20971520
virtual_mailbox_limit = 102400000
queue_minfree = 20480000
smtpd_helo_required = yes
strict_rfc821_envelopes = yes
disable_vrfy_command = yes
# kein VRFY
unknown_address_reject_code = 554
unknown_hostname_reject_code = 554
unknown_client_reject_code = 554
owner_request_special = no
recipient_delimiter = +
unknown_local_recipient_reject_code = 550
content_filter = smtp-amavis:[127.0.0.1]:10024
-------------------------------------------------------------------------------
# mysql-aliases.cf
user = vmailuser
password =
dbname = mail
table = postfix_alias
select_field = destination
where_field = alias
hosts = 127.0.0.1
# mysql-client.cf
user = vmailuser
password =
dbname = mail
table = postfix_access
select_field = access
where_field = source
additional_conditions = and type = 'client'
hosts = 127.0.0.1
# mysql-recipient.cf
user = vmailuser
password =
dbname = mail
table = postfix_access
select_field = access
where_field = source
additional_conditions = and type = 'recipient'
hosts = 127.0.0.1
# mysql-relocated.cf
user = vmailuser
password =
dbname = mail
table = postfix_relocated
select_field = destination
where_field = email
hosts = 127.0.0.1
# mysql-sender.cf
user = vmailuser
password =
dbname = mail
table = postfix_access
select_field = access
where_field = source
additional_conditions = and type = 'sender'
hosts = 127.0.0.1
# mysql-transport.cf
user = vmailuser
password =
dbname = mail
table = postfix_transport
select_field = destination
where_field = domain
hosts = 127.0.0.1
# mysql-virtual-domains.cf
user = vmailuser
password =
dbname = mail
table = postfix_virtual_domains
select_field = destination
where_field = domain
hosts = 127.0.0.1
# mysql-virtual-gid.cf
user = vmailuser
password =
dbname = mail
table = postfix_users
select_field = gid
where_field = email
additional_conditions = and postfix = 'y'
hosts = 127.0.0.1
# mysql-virtual-maps.cf
user = vmailuser
password =
dbname = mail
table = postfix_users
select_field = maildir
where_field = email
additional_conditions = and postfix = 'y'
hosts = 127.0.0.1
# mysql-virtual-uid.cf
user = vmailuser
password =
dbname = mail
table = postfix_users
select_field = uid
where_field = email
additional_conditions = and postfix = 'y'
hosts = 127.0.0.1
# mysql-virtual.cf
user = vmailuser
password =
dbname = mail
table = postfix_virtual
select_field = destination
where_field = email
hosts = 127.0.0.1
参考地址
http://genco.gen.tc/postfix_virtual.php#changelog
http://www.gfxcafe.com/Mail%20Howto.htm
[ 本帖最后由 tnthb 于 2007-3-28 12:20 编辑 ] |
|