Loading ...
Sorry, an error occurred while loading the content.
 

why does virtual_alias_maps cause double lookups?

Expand Messages
  • Jon Falconer
    Hi, I m new to Postfix and am configuring a new system to replace our old sendmail system. I want to us LDAP for most lookups and not use UNIX accounts. In
    Message 1 of 1 , Feb 28, 2006
      Hi,

      I'm new to Postfix and am configuring a new system to replace our old
      sendmail system. I want to us LDAP for most lookups and not use UNIX
      accounts. In order to implement aliasing and forwarding for virtual
      mailboxes I believe I need to use virtual_alias_maps. But I would like to
      know if I've got something wrong since it looks up the same thing twice as
      you can see in the log entries below. Is this normal? If not, what do I
      need to change. Is there a better approach?

      Thanks for your help,

      Jon

      ----------------------------------------------------------

      Feb 28 15:08:00 ecf3 postfix/smtpd[25162]: connect from itss-d600.puc.edu[10.50.100.30]
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=104 fd=10 ACCEPT from IP=127.0.0.1:54387 (IP=0.0.0.0:389)
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=104 op=0 BIND dn="" method=128
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=104 op=0 RESULT tag=97 err=0 text=
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=104 op=1 SRCH base="ou=accounts,dc=ds,dc=puc,dc=edu" scope=2 deref=0 filter="(|(mail=puc.edu)(mailAlternateAddress=puc.edu))"
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=104 op=1 SRCH attr=mailDrop
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=104 op=1 SEARCH RESULT tag=101 err=0 nentries=0 text=
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=104 op=2 SRCH base="ou=accounts,dc=ds,dc=puc,dc=edu" scope=2 deref=0 filter="(|(mail=puc.edu)(mailAlternateAddress=puc.edu))"
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=104 op=2 SRCH attr=mailDrop
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=104 op=2 SEARCH RESULT tag=101 err=0 nentries=0 text=
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=105 fd=26 ACCEPT from IP=127.0.0.1:57399 (IP=0.0.0.0:389)
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=105 op=0 BIND dn="" method=128
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=105 op=0 RESULT tag=97 err=0 text=
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=105 op=1 SRCH base="ou=accounts,dc=ds,dc=puc,dc=edu" scope=2 deref=0 filter="(|(mail=test@...)(mailAlternateAddress=test@...))"
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=105 op=1 SRCH attr=mailDrop
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=105 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=
      Feb 28 15:08:00 ecf3 postfix/smtpd[25162]: 3DC4917047: client=itss-d600.puc.edu[10.50.100.30]
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=106 fd=27 ACCEPT from IP=127.0.0.1:57470 (IP=0.0.0.0:389)
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=106 op=0 BIND dn="" method=128
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=106 op=0 RESULT tag=97 err=0 text=
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=106 op=1 SRCH base="ou=accounts,dc=ds,dc=puc,dc=edu" scope=2 deref=0 filter="(|(mail=test@...)(mailAlternateAddress=test@...))"
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=106 op=1 SRCH attr=mailDrop
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=106 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=
      Feb 28 15:08:00 ecf3 postfix/cleanup[25165]: 3DC4917047: message-id=<001801c63cbb$c3076330$1e64320a@...>
      Feb 28 15:08:00 ecf3 postfix/qmgr[24918]: 3DC4917047: from=<jfalconer@...>, size=653, nrcpt=1 (queue active)
      Feb 28 15:08:00 ecf3 postfix/smtpd[25162]: disconnect from itss-d600.puc.edu[10.50.100.30]
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=107 fd=28 ACCEPT from IP=127.0.0.1:53897 (IP=0.0.0.0:389)
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=107 op=0 BIND dn="" method=128
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=107 op=0 RESULT tag=97 err=0 text=
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=107 op=1 SRCH base="ou=accounts,dc=ds,dc=puc,dc=edu" scope=2 deref=0 filter="(mail=test@...)"
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=107 op=1 SRCH attr=mailMessageStore
      Feb 28 15:08:00 ecf3 slapd[9797]: conn=107 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=
      Feb 28 15:08:00 ecf3 postfix/virtual[25166]: 3DC4917047: to=<test@...>, relay=virtual, delay=0, status=sent (delivered to maildir)
      Feb 28 15:08:00 ecf3 postfix/qmgr[24918]: 3DC4917047: removed
      Feb 28 15:09:40 ecf3 slapd[9797]: conn=106 fd=27 closed
      Feb 28 15:09:40 ecf3 slapd[9797]: conn=105 fd=26 closed
      Feb 28 15:09:40 ecf3 slapd[9797]: conn=107 fd=28 closed


      postconf -n
      ----------------------------------------------------
      alias_database = hash:/usr/local/etc/postfix/aliases
      alias_maps = hash:/usr/local/etc/postfix/aliases
      command_directory = /usr/local/sbin
      config_directory = /usr/local/etc/postfix
      daemon_directory = /usr/local/libexec/postfix
      debug_peer_level = 2
      default_destination_concurrency_limit = 2
      home_mailbox = Maildir/
      html_directory = no
      in_flow_delay = 0
      inet_interfaces = all
      mail_owner = postfix
      mail_spool_directory = /var/mail
      mailq_path = /usr/local/bin/mailq
      manpage_directory = /usr/local/man
      mydestination = $myhostname, localhost.$mydomain, localhost
      mydomain = puc.edu
      mynetworks = 10.0.0.0/8, 192.168.0.0/16
      myorigin = $mydomain
      newaliases_path = /usr/local/bin/newaliases
      queue_directory = /var/spool/postfix
      readme_directory = no
      sample_directory = /usr/local/etc/postfix
      sendmail_path = /usr/local/sbin/sendmail
      setgid_group = maildrop
      unknown_local_recipient_reject_code = 550
      virtual_alias_maps = ldap:/usr/local/etc/postfix/ldap_virtual_alias
      virtual_gid_maps = static:500
      virtual_mailbox_base = /home/mail
      virtual_mailbox_domains = puc.edu
      virtual_mailbox_limit = 40000000
      virtual_mailbox_maps = ldap:/usr/local/etc/postfix/ldap_virtual_acct
      virtual_minimum_uid = 500
      virtual_uid_maps = static:500


      /usr/local/etc/postfix/ldap_virtual_alias
      -----------------------------------------
      server_host = localhost
      server_port = 389
      search_base = ou=accounts, dc=ds, dc=puc, dc=edu
      #query_filter = (&(|(mail=%s)(mailAlternateAddress=%s))(|(mailAccountStatus=active)(mailAccountStatus=shared)))
      query_filter = (|(mail=%s)(mailAlternateAddress=%s))
      result_attribute = mailDrop


      /usr/local/etc/postfix/ldap_virtual_acct
      ----------------------------------------
      server_host = localhost
      server_port = 389
      search_base = ou=accounts, dc=ds, dc=puc, dc=edu
      #query_filter = (&(|(mail=%s)(mailAlternateAddress=%s))(|(mailAccountStatus=active)(mailAccountStatus=shared)))
      query_filter = (mail=%s)
      result_attribute = mailMessageStore


      LDAP entry
      --------------------------------------------
      dn: uid=test,ou=accounts,dc=ds,dc=puc,dc=edu
      objectClass: top
      objectClass: person
      objectClass: organizationalPerson
      objectClass: inetOrgPerson
      objectClass: posixAccount
      objectClass: pucMailAccount
      uid: test
      cn: Testy Tester
      sn: Tester
      givenName: Testy
      mail: test@...
      mailDrop: test@...
      uidNumber: 9999
      gidNumber: 999
      gecos: Testy Tester,,,
      homeDirectory: /home/system/test
      loginShell: /bin/csh
      displayName: Testy Tester
      mailAccountStatus: active
      mailAlternateAddress: tt@...
      mailMessageStore: ttester/
      mailQuota: 1000
      userPassword:: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Your message has been successfully submitted and would be delivered to recipients shortly.