# Postfix + LDAP mailing list not delivered to users [SOLVED]

## aralic

I'm trying to setup an ldap entry that is a mail list. I've modeled it after the Postfix + LDAP readme (http://www.postfix.org/LDAP_README.html).

Problem is, when I send a test e-mail to the list, it appears to be trying to deliver the mail to the list as if it were a user rather than sending it to the list members. According to my tests, postmap is looking up the list and getting the members. I can't figure out why postfix is not delivering to the users that are resolved. Maybe someone can help?

Here is what I know:

1) I am able to succesfully resolve the user, via postmap.

# postmap -q test@local ldap:/etc/postfix/ldap_users.cf 

test@local

2) Test e-mails sent to this user work. They are delivered to /home/test/.maildir

3) I am able to successfully resolve the list, via postmap. It resolves a list of members and then searches on those members for their maildrop attributes (as in the 2nd case listed under 'expanding ldap groups' in the LDAP Readme).

# postmap -q postmaster@local ldap:/etc/postfix/ldap_groups.cf

test@local

# snip from postmap with verbose flag set, same search:

postmap: dict_open: ldap:/etc/postfix/ldap_groups.cf

postmap: dict_ldap_lookup: In dict_ldap_lookup

postmap: dict_ldap_lookup: No existing connection for LDAP source /etc/postfix/ldap_groups.cf, reopening

postmap: dict_ldap_connect: Connecting to server ldap://localhost:389

postmap: dict_ldap_connect: Actual Protocol version used is 3.

postmap: dict_ldap_connect: Cached connection handle for LDAP source /etc/postfix/ldap_groups.cf

postmap: dict_ldap_lookup: /etc/postfix/ldap_groups.cf: Searching with filter (&(mail=postmaster@local)(objectclass=mailGroup))

postmap: dict_ldap_get_values[1]: Search found 1 match(es)

postmap: dict_ldap_get_values[1]: looking up DN uid=test,ou=Users,dc=local

postmap: dict_ldap_get_values[2]: Search found 1 match(es)

postmap: dict_ldap_get_values[2]: search returned 1 value(s) for requested result attribute maildrop

postmap: dict_ldap_get_values[2]: Leaving dict_ldap_get_values

postmap: dict_ldap_get_values[1]: search returned 1 value(s) for special result attribute member

postmap: dict_ldap_get_values[1]: Leaving dict_ldap_get_values

postmap: dict_ldap_lookup: Search returned test@local

test@local

postmap: dict_ldap_close: Closed connection handle for LDAP source /etc/postfix/ldap_groups.cf

Here is what the log shows from a test e-mail sent to the list 'postmaster@local'.

#/var/log/mail/mail.log

May 17 14:04:33 Zebo postfix/pickup[3096]: D75FD150B2: uid=0 from=<root>

May 17 14:04:33 Zebo postfix/cleanup[3179]: D75FD150B2: message-id=<20080517200433.D75FD150B2@lan.local>

May 17 14:04:33 Zebo postfix/qmgr[3094]: D75FD150B2: from=<root@lan.local>, size=347, nrcpt=1 (queue active)

May 17 14:04:33 Zebo postfix/local[3181]: D75FD150B2: to=<postmaster@local>, relay=local, delay=0.09, delays=0.04/0.01/0/0.04, dsn=2.0.0, status=sent (delivered to maildir)

May 17 14:04:33 Zebo postfix/qmgr[3094]: D75FD150B2: removed

When I check the system, I see that it actually delivers it to /var/mail/.maildir, which is a new dir and owned by the user 'postmaster'. The message is there, in the /new directory as if this were a user.

#### My config info:

My ldap schema:

objectclass ( 1.3.6.1.4.1.<removed>

        NAME 'mailUser'

        DESC 'E-Mail User'

        SUP top

        AUXILIARY

        MUST ( uid $ mail $ maildrop )

        MAY ( cn )

        )

objectclass ( 1.3.6.1.4.1.<removed>

        NAME 'mailGroup'

        DESC 'E-Mail Group'

        STRUCTURAL

        MUST ( cn $ mail )

        MAY ( member $ description )

        )

# less /etc/postfix/ldap_groups.cf

server_host = localhost

search_base = ou=Groups,dc=local

bind = no

timeout = 5

query_filter = (&(mail=%s)(objectclass=mailGroup))

special_result_attribute = member

# less /etc/postfix/ldap_users.cf 

server_host = localhost

#search_base = dc=local

search_base = ou=Users,dc=local

bind = no

timeout = 5

query_filter = (&(mail=%s)(objectclass=mailUser))

result_attribute = maildrop

# ldif for the user: test@local

dn: uid=test,ou=Users,dc=local

objectClass: posixAccount

objectClass: top

objectClass: inetOrgPerson

objectClass: shadowAccount

objectClass: mailUser

givenName: test

sn: test

displayName: test

uid: test

homeDirectory: /home/test/

gecos: test

shadowFlag: 0

shadowMin: 0

shadowMax: 99999

shadowWarning: 0

shadowInactive: 99999

shadowLastChange: 12011

shadowExpire: 99999

cn: test

uidNumber: 49622

loginShell: /bin/bash

gidNumber: 38972

userPassword: <removed>

mail: test@local

maildrop: test@local

ldif for the list: postmaster@local

dn: cn=postmaster,ou=Mail,ou=Groups,dc=local

cn: postmaster

mail: postmaster@local

objectClass: mailGroup

member: uid=test,ou=Users,dc=local

description: Postmaster mail list

#postconf -n

alias_maps = ldap:/etc/postfix/ldap_users.cf, ldap:/etc/postfix/ldap_groups.cf

append_dot_mydomain = no

backwards_bounce_logfile_compatibility = no

command_directory = /usr/sbin

config_directory = /etc/postfix

daemon_directory = /usr/lib/postfix

debug_peer_level = 2

home_mailbox = .maildir/

html_directory = /usr/share/doc/postfix-2.4.6-r2/html

mail_owner = postfix

mailq_path = /usr/bin/mailq

manpage_directory = /usr/share/man

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

mydomain = local

myhostname = lan.local

newaliases_path = /usr/bin/newaliases

notify_classes = bounce, policy, protocol, resource, software

queue_directory = /var/spool/postfix

readme_directory = /usr/share/doc/postfix-2.4.6-r2/readme

sample_directory = /etc/postfix

sendmail_path = /usr/sbin/sendmail

setgid_group = postdrop

unknown_local_recipient_reject_code = 550Last edited by aralic on Tue May 20, 2008 3:31 am; edited 1 time in total

----------

## aralic

This was solved by changing the alias map for the group to 'virtual_alias_maps'.

E.g.

alias_maps = ldap:/etc/postfix/ldap_users.cf             

virtual_alias_maps = ldap:/etc/postfix/ldap_groups.cf

Works like a charm now.

----------

