Results 1 to 3 of 3

Thread: Virtual domain in Postfix with LDAP

  1. #1

    Virtual domain in Postfix with LDAP

    Hi all,

    I try to configure Postfix with Zarafa on a virtual domain environment.

    The local delivery is made with 'spare.local' domain and the users have public mails from 'spare.be' domain.

    The server, I use, is installed on a CentOS 5.1 distribution with Postfix, Mysql, OpenLDAP, Samba, Zarafa and other little stuffs installed.

    For the configuration of Zarafa, Postfix and OpenLDAP, I use an home made script based on the one provided by Zarafa. My script bypass some steps in the zarafa script because I set directly the good values. But I add several new features like the configuration of Samba as a PDC, connected to the OpenLDAP.

    I added 3 test users:
    • alice with 'alice@spare.be' as main mail address and her aliases: 'alice.merveilles@spare.be' and 'amerveilles@spare.be'[/*:m:1qbp986p]
    • bob with 'bob@spare.be' and his aliases are: 'bob.eponge@spare.be' and 'beponge@spare.be'[/*:m:1qbp986p]
    • charlie with main mail as 'cha-bro@spare.be' and the aliases: 'charlie@spare.be', 'charlie.brown@spare.be' and 'cbrown@spare.be'[/*:m:1qbp986p]


    When I try to send a mail to a user with the mail adress 'user@spare.be', postfix and zarafa delivered it correctly. But when I try other mail address, I receive a 5.3.0. error with message : "internal software error. Command output: Starting delivery for user USER Access denied or Unknown user 'USER', error code: 0x80040111".

    For instance: I mail to 'alice@spare.be', it is delivered, but a mail to 'alice.merveilles@spare.be' returns the 530 message.

    I put some debug in Postfix and I can see no LDAP lookups which resolve main mail or alias to local user (as defined in LDAP).

    If I use the default virtual transport (virtual_transport = virtual instead of the 'zarafa:' one, I can see the lookups to the LDAP. But I see in the postfix log the mail is deferred : "delivery failed to mailbox /home/vmail/USER: cannot create file exclusively: No such file or directory".

    In other words, I need a mix of both : LDAP lookups with zarafa transport.

    Here are some of the Postfix configuration files:
    • The result of the 'postconf -n' command:
      Code:
      alias_database = hash:/etc/aliases
      alias_maps = hash:/etc/aliases
      command_directory = /usr/sbin
      config_directory = /etc/postfix
      daemon_directory = /usr/libexec/postfix
      debug_peer_level = 2
      html_directory = no
      inet_interfaces = localhost
      mail_owner = postfix
      mailbox_command = /usr/bin/zarafa-dagent "\$user"
      mailq_path = /usr/bin/mailq.postfix
      manpage_directory = /usr/share/man
      mydestination = $myhostname, localhost.$mydomain, localhost
      mydomain = spare.local
      myorigin = spare.be
      newaliases_path = /usr/bin/newaliases.postfix
      queue_directory = /var/spool/postfix
      readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
      sample_directory = /usr/share/doc/postfix-2.3.3/samples
      sendmail_path = /usr/sbin/sendmail.postfix
      setgid_group = postdrop
      unknown_local_recipient_reject_code = 550
      virtual_alias_maps = ldap:/etc/postfix/ldap-users.cf ldap:/etc/postfix/ldap-virtual-alias.cf
      virtual_mailbox_domains = spare.be
      virtual_mailbox_maps = ldap:/etc/postfix/ldap-users.cf ldap:/etc/postfix/ldap-virtual-alias.cf
      virtual_transport = zarafa:
      [/*:m:1qbp986p]
    • The /etc/postfix/ldap-users.cf file:
      Code:
      server_host = localhost
      server_port = 389
      version = 3
      bind = yes
      bind_dn = cn=Manager,dc=spare,dc=local
      bind_pw = pwd
      search_base = ou=Users,dc=spare,dc=local
      scope = sub
      query_filter = (mail=%s)
      result_attribute = uid
      [/*:m:1qbp986p]
    • The /etc/postfix/ldap-virtual-alias.cf file:
      Code:
      server_host = localhost
      server_port = 389
      version = 3
      bind = yes
      bind_dn = cn=Manager,dc=spare,dc=local
      bind_pw = pwd
      search_base = ou=Users,dc=spare,dc=local
      scope = sub
      query_filter = (mailAlternateAddress=%s)
      result_attribute = uid
      [/*:m:1qbp986p]


    If you have suggestions, ideas, they are welcome.

    If you need more information, I will post them if you tell me what you want.

    Thank you in advance,
    Bénoni Delfosse

  2. #2
    Senior Member
    Join Date
    May 2006
    Location
    Delft
    Posts
    1,935

    Re: Virtual domain in Postfix with LDAP

    Hi Benoni,

    Can you try these settings:

    Code:
    zarafa_destination_recipient_limit = 1
    virtual_mailbox_domains = zarafa.com
    virtual_mailbox_base = /home/vmail
    virtual_uid_maps = static:100
    virtual_gid_maps = static:101
    virtual_minimum_uid = 100
    virtual_mailbox_maps = ldap:ldap-users
    ldap-users_server_host = localhost
    ldap-users_search_base = ou=Users,dc=zarafa,dc=com
    ldap-users_scope = sub
    ldap-users_query_filter = (mail=%s)
    ldap-users_result_attribute = uid
    virtual_alias_maps = ldap:ldap_virtual_alias
    ldap_virtual_alias_server_host = localhost
    ldap_virtual_alias_search_base = ou=Users,dc=zarafa,dc=com
    ldap_virtual_alias_scope = sub
    ldap_virtual_alias_query_filter = (mailAlternateAddress=%s)
    ldap_virtual_alias_result_attribute = mail
    Milo

  3. #3

    Re: Virtual domain in Postfix with LDAP

    Hi Milo,

    If the settings you provides are the ones in the documentation, I already test them, I begun with them.

    But they don't work at all for my case.

    As I said, there is no looklup in LDAP with the zarafa transport (with 2 domains, a local and a public).

    So for now, I found a workaround: I use qpSMTPd as front end which translates public addresses into local ones before queues the mails in Postfix.
    Like that, Postfix can use the zarafa transport with a good user mail account and mails are delivered correctly.

    I will do the same setup on a virtual machine but only with the Zarafa part, no samba as PDC, fax, ... to see if I missed something in my current setup.

    And I will give you the result in this topic.

    Regards,
    Bénoni Delfosse.

Similar Threads

  1. Using postfix w/ virtual users, lmtp problem with dagent
    By prdoeser in forum Installation and Configuration
    Replies: 2
    Last Post: 30-05-2012, 09:53 PM
  2. Problem configuring Postfix with virtual users
    By KasumiNinja in forum Administration and Integration Archives
    Replies: 10
    Last Post: 01-04-2011, 08:34 AM
  3. postfix problem with relay (virtual users)
    By thomasjohansen in forum Installation and Configuration Archives
    Replies: 2
    Last Post: 17-12-2010, 02:26 PM
  4. postfix virtual-user network config?
    By laserbrain in forum Installation and Configuration Archives
    Replies: 1
    Last Post: 16-10-2010, 01:41 AM
  5. Postfix virtual mailboxes and virtual domains
    By choeflake in forum Installation and Configuration Archives
    Replies: 2
    Last Post: 16-09-2008, 08:12 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •