postfix + ldap SOLVED
Andre Landwehr
andre.landwehr at gmx.net
Thu Oct 10 21:18:02 CEST 2002
On Wed, Oct 09, 2002 at 05:29:01PM +0200, Andre Landwehr wrote:
> On Wed, Oct 09, 2002 at 12:09:58PM +0200, Andre Landwehr wrote:
> > ich versuche den Postfix zu bewegen, Mail an lokale User
> > auszuliefern, die nur im ldap existieren. Dabei würde ich gerne
> > nur auf das uid Feld zurückgreifen, und das Feld mail für externe
> > Weiterleitungen nutzen.
Also denn, hier die Lösung des ganzen:
/etc/postfix/main.cf:
========>
mydestination = $myhostname, localhost.$mydomain, $mydomain, www.$mydomain, localhost
mail_spool_directory = /var/mail
virtual_mailbox_base = /var/mail
default_transport = smtp
local_transport = virtual
# Virtual maps ersetzen die alias_maps, da der lokale transport
# jetzt durch "virtual" statt "local" gemacht wird. Das
# Dateiformat ist aber gleich, sprich alte /etc/aliases können
# weiterverwendet werden. Zusätzlich hab ich die Möglichkeit,
# aliases im ldap anzulegen, objectclass inetLocalMailRecipient
# und account (oder posixAccount) reichen dafür
virtual_maps = hash:/etc/aliases, ldap:ldapaliases
ldapaliases_search_base = ou=People,dc=cn-hq,dc=priv
ldapaliases_bind = no
ldapaliases_scope = one
ldapaliases_query_filter =
(&(objectClass=inetLocalMailRecipient)(|(uid=%u)(userid=%u)(mail=%s)(mailLocalAddress=%s)))
ldapaliases_result_attribute = mailRoutingAddress
# jetzt kommen mappings damit der "virtual" Prozess sich in den
# richtigen User verwandeln kann und dann die richtige Mailbox
# beschreiben kann. Der query_filter sollte tunlichst überall
# gleich sein (das geht bestimmt auch kompakter, ich weiß nur
# nicht wie)
virtual_uid_maps = ldap:ldapuid
ldapuid_search_base = ou=People,dc=cn-hq,dc=priv
ldapuid_bind = no
ldapuid_scope = one
ldapuid_query_filter =
(&(objectClass=inetLocalMailRecipient)(|(uid=%u)(userid=%u)(mail=%s)(mailLocalAddress=%s)))
ldapuid_result_attribute = uidNumber
virtual_gid_maps = ldap:ldapgid
ldapgid_search_base = ou=People,dc=cn-hq,dc=priv
ldapgid_bind = no
ldapgid_scope = one
ldapgid_query_filter =
(&(objectClass=inetLocalMailRecipient)(|(uid=%u)(userid=%u)(mail=%s)(mailLocalAddress=%s)))
ldapgid_result_attribute = gidNumber
virtual_mailbox_maps = ldap:ldapmailbox
ldapmailbox_search_base = ou=People,dc=cn-hq,dc=priv
ldapmailbox_bind = no
ldapmailbox_scope = one
ldapmailbox_query_filter =
(&(objectClass=inetLocalMailRecipient)(|(uid=%u)(userid=%u)(mail=%s)(mailLocalAddress=%s)))
ldapmailbox_result_attribute = uid
<========
Die Mailboxen in /var/mail müssen natürlich existieren und dem
richtigen User gehören, da er sie sonst nicht schreiben darf...
========>
twintower:/var/mail# ll
total 32
-rw------- 1 andrel mail 24718 Oct 10 21:02 andrel
-rw------- 1 testuser mail 0 Oct 9 23:45 testuser
<========
Ich bedanke mich bei allen, die mir Tips gegeben haben (auch wenn
ich aus technischen Gründen meist nicht geantwortet haben ;-)) und
entschuldige mich förmlichst bei allen, die bei meinen
Tests mit lästigen bounces überflutet worden sind...
Andre
--
"The inside of a computer is as dumb as hell, but it goes like mad!"
(Physicist Richard Feynman)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lug-owl.de/pipermail/linux/attachments/20021010/e6460344/attachment.sig>
More information about the Linux
mailing list