在postfix + openldap的環境下如果要寄發群組信件
其實跟本機帳號一樣,只要編輯/etc/mail/aliases
再newaliases 就可以了
只是要管理兩個地方,比較不方便而已

如果要統一由ldap介面管理的話,首先必須重新compile postfix
cd /usr/ports/mail/postfix
make config
│[X] LDAP_SASL  Enable OpenLDAP client-to-server auth via SASL
postfix+openldap  
make install

編輯/usr/local/etc/postfix/main.cf
新增以下兩行
append_at_myorigin = yes
virtual_alias_maps = ldap:/usr/local/etc/postfix/ldap-group.cf

ldap-group.cf內容如下
server_host = ldap://127.0.0.1
port = 389
version = 3
scope = sub
search_base = dc=xxxxxxxx,dc=com,dc=tw
query_filter = mailRoutingAddress=%s
result_attribute = memberUid

接下來透過ldap的管理工具新增一個群組,把已經存在的使用者加到這個群組
並且設定這個群組的email信箱即可,最後就可以看到類似以下的ldif格式

dn: cn=mis,dc=xxxxxxxx,dc=com,dc=tw
objectClass: posixGroup
objectClass: top
objectClass: inetLocalMailRecipient
cn: mis
memberUid: user1  <= 群組名單
memberUid: user2  <= 群組名單
gidNumber: 73236
structuralObjectClass: posixGroup
entryUUID: 27492cd6-c96f-1234-84d9-fb4cfa1b0050
creatorsName: cn=Manager,dc=xxxxxxxx,dc=com,dc=tw
createTimestamp: 20120102092319Z
mailRoutingAddress: mis@xxxxxxxx.com.tw  <= 群組信箱
entryCSN: 20120102092656.905322Z#000000#000#000000
modifiersName: cn=Manager,dc=xxxxxxxx,dc=com,dc=tw
modifyTimestamp: 20120102092656Z

arrow
arrow
    全站熱搜

    helloworld 發表在 痞客邦 留言(0) 人氣()