由 kc19800322 » 週四 6月 05, 2008 12:10 pm
感謝酷學園的SaPow大大給的方法,讓我可以做mail aliases,在這邊提供給大家叁考
virtual_alias_maps = ldap:accounts,ldap:aliases,$alias_maps
主要是在這多加$alias_maps,讓他可以去抓/etc/aliases
main.cf
myhostname = mail.abc.com.tw
mydomain = abc.com.tw
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $mydomain, $myhostname, localhost.abc.com.tw, , localhost, autoreply.abc.com.tw
relayhost =
mynetworks = 127.0.0.0/8, 192.168.88.0/24, 10.0.88.0/24
#MAILDIR=$HOME/Maildir
mailbox_command = procmail -a "$EXTENSION" DEFAULT= $HOME
local_recipient_maps=
mailbox_size_limit = 153600000
recipient_delimiter = +
inet_interfaces = all
home_maildir = Maildir/
virtual_mailbox_limit = 153600000
#LDAP Configure
local_transport = virtual
accounts_server_host = 10.0.88.50
accounts_search_base = ou=Users,dc=abc,dc=com,dc=tw
accounts_query_filter = (&(objectClass=inetOrgPerson)(uid=%s))
accounts_result_attribute = uid
account_bind = no
mailbox_server_host = 10.0.88.50
mailbox_search_base = ou=Users,dc=abc,dc=com,dc=tw
mailbox_query_filter = (&(objectClass=inetOrgPerson)(uid=%s))
mailbox_result_format = %s/
mailbox_result_attribute = uid
mailbox_bind = no
aliases_server_host = 10.0.88.50
aliases_search_base = ou=Users,dc=abc,dc=com,dc=tw
aliases_query_filter = (&(objectClass=inetLocalMailRecipient)(mail=%s))
aliases_result_attribute = uid
aliases_bind =no
virtual_alias_maps = ldap:accounts,ldap:aliases,$alias_maps
virtual_mailbox_base =/home/
virtual_mailbox_maps = ldap:mailbox
virtual_transport = maildrop
virtual_uid_maps = hash:/etc/postfix/virtual_uids
virtual_gid_maps = static:513
小弟有另一個想法,想在LDAP上建立一個"ou=aliases",然後在上面建立mail aliases,全部都用ldap管理
,可是卻不瞭解postfix要如何去抓這裡的資料,因為aliases建立出來的屬性是cn
可是我們正常帳號抓的屬性是uid,不知道哪裡有文件可以叁考,請大大們再給小弟一點建議吧!
謝謝!!!