Общая схема показана на рис.
После установки Sun Directory Server создадим скрипт для запуска Directory Server и Administration Server (смотрим пост). Ставим у себя Sun Java(TM) System Server Console.
Создаем в ILM 2007 агент управления для Sun Directory
Определяемся какие атрибуты мы будем синхронизировать:
настройка правил слияния:
настройка переноса атрибутов:
Атрибут mailQuota я поставил 50МБ
И создадим профили Full Import – Full Synchronization – Exprort
Вставим в процедуру Provision код
Public Sub Provision(ByVal mventry As MVEntry) Implements IMVSynchronization.Provision.Const SUN_OU = "ou=People,dc=dn,dc=local"' =======================================
SUN ONE Directory' =======================================
adMA = mventry.ConnectedMAs(Sun_MA)Connectors = adMA.Connectors.CountIf 0 = Connectors ThenDim objClass As ValueCollectionSelect Case mventry.ObjectType.ToLower()Case "person"Container = SUN_OUdn = adMA.EscapeDNComponent("uid=" + mventry("uid").Value).Concat(Container)csentry = adMA.Connectors.StartNewConnector("inetOrgPerson")
csentry.DN = dnSetSunDirPW(csentry, "1Q2w3e4r5")
csentry.CommitNewConnector()objClass = Utils.ValueCollection(csentry.ObjectClass.ToStringArray())objClass.Add("mailRecipient")
csentry.ObjectClass = objClassCase "group"Container = "ou=Groups," + SUN_OU
dn = adMA.EscapeDNComponent("uid=" + mventry("uid").Value).Concat(Container)csentry = adMA.Connectors.StartNewConnector("groupOfUniqueNames")
csentry.DN = dncsentry.CommitNewConnector()objClass = Utils.ValueCollection(csentry.ObjectClass.ToStringArray())objClass.Add("mailRecipient")
csentry.ObjectClass = objClassEnd SelectElseIf 1 = Connectors ThenSelect Case mventry.ObjectType.ToLower()Case "group"Container = "ou=Groups," + SUN_OU
Case "person"Container = SUN_OUEnd Selectdn = adMA.EscapeDNComponent("uid=" + mventry("uid").Value).Concat(Container)csentry = adMA.Connectors.ByIndex(0)If csentry.DN.ToString.ToLower <> dn.ToString.ToLower Thencsentry.DN = dnEnd IfElse
Throw New UnexpectedDataException("multiple connectors:" + Connectors.ToString)End If
На этом настройка ILM закончена. Теперь пример конфигов Postfix:
main.cf :
virtual_mailbox_domains = $mydomainvirtual_mailbox_base = /home/vmail/virtual_uid_maps = static:800virtual_gid_maps = static:800virtual_transport = virtualvirtual_create_maildirsize = yesvirtual_mailbox_maps = ldap:/etc/postfix/ldap-users-sun.cfvirtual_alias_maps = ldap:/etc/postfix/ldap-groups-sun.cfvirtual_mailbox_limit_maps = ldap:/etc/postfix/ldap-quota.cfvirtual_mailbox_limit_override = yes
ldap-users-sun.cf:
server_host = sunldap.dn.localsearch_base = ou=People,dc=dn,dc=localversion = 3query_filter = (&(objectclass=inetOrgPerson)(|(mail=%s)(mailAlternateAddress=%s))(nsAccountLock=false))result_attribute = uidresult_format = %s/Maildir/bind = yesbind_dn = uid=ldap,dc=dn,dc=localbind_pw = password
ldap-groups-sun.cf:
server_host = sunldap.dn.localsearch_base = ou=People,dc=dn,dc=localversion = 3query_filter = (&(objectclass=groupOfUniqueNames)(|(mailAlternateAddress=%s)(mail=%s)))leaf_result_attribute = mailresult_attribute = mailspecial_result_attribute = uniqueMemberbind = yesbind_dn = uid=ldap,dc=dn,dc=localbind_pw = password
ldap-quota.cf:
server_host = sunldap.dn.localsearch_base = ou=People,dc=dn,dc=localversion = 3query_filter = (&(objectclass=inetOrgPerson)(|(mail=%s)(mailalternativeadderss=%s))(!(nsaccountlock=false)))result_attribute = mailQuotabind = yesbind_dn = uid=ldap,dc=dn,dc=localbind_pw = password
Конфиги Dovecot:
dovecot.conf:
protocols = pop3listen = *ssl_disable = yesdisable_plaintext_auth=nomail_location = maildir:~/Maildirmail_access_groups = vmailprotocol pop3 {pop3_uidl_format = %08Xu%08Xvpop3_client_workarounds = outlook-no-nuls oe-ns-eoh}auth_cache_size = 1024auth_username_format = %Lumail_uid=800mail_gid=800auth_ntlm_use_winbind = yesauth_winbind_helper_path = /usr/bin/ntlm_authauth default {mechanisms = plain login ntlmpassdb ldap {args = /etc/dovecot-ldap-sun.cf}userdb prefetch {}userdb ldap {args = /etc/dovecot-ldap-sun.cf}}
dovecot-ldap-sun.cf:
hosts = sunldap.dn.localbase = ou=People,dc=dn,dc=localdn = uid=ldap,dc=dn,dc=localdnpass=passwordldap_version = 3deref = neverscope=subtreeuser_filter = (&(objectClass=mailRecipient)(uid=%n)(nsAccountLock=false))pass_filter = (&(ObjectClass=person)(uid=%n))user_attrs = uid=home=/home/vmail/%$default_pass_scheme = CRYPTdebug_level = 0
Вот и все…
Комментариев нет:
Отправить комментарий