Results 1 to 3 of 3

Thread: Distribution lists: controlling Zimbra's Postfix

  1. #1
    Join Date
    Jun 2007
    Posts
    2
    Rep Power
    8

    Default Distribution lists: controlling Zimbra's Postfix

    Before I ask the question - my idea of the target setup is: Zimbra + account provisioning and external LDAP which keeps passwords, photos, groups and similar.
    I have been looking into Zimbra Distribution lists - they are OK - but the problem is, that you have to create them manually. Currently I have my own postfix hooked into my LDAP server and there I have configured a few lookups, so that emails are sent to groups, or for example, to all people having attribute 'title' equal to 'Teacher'. I don't want to run two postfix MTAs. The easiest for me would be to modify Zimbra's postfix and add my own lookups that will use my external LDAP server. Is this possible or Zimbra will overwrite the configuration file next time it is started? If there is a way of modifying the configuration, then how to do it, so that everything still plays well. I understand I might have problems with upgrading - but that's something I will have to solve on my own. The idea is to get my lookups into postfix. Any clues more than welcome

  2. #2
    Join Date
    Jun 2007
    Posts
    2
    Rep Power
    8

    Default

    It is possible to add custom lookups into Zimbra's postfix - but one has to be very careful because during ugprade some stuff might suddenly disappear.
    To idea was just to add new virtual_alias_maps into main.cf, so that I could use my other LDAP server, that keeps accounts and Samba stuff as a base for dynamic/group based distribution lists.
    In /opt/zimbra/conf create files you will use for lookup. I did create ldap-static.cf and ldap-dyn.cf. Inside you put all the postfix-ldap directives. In my case these are:

    Code:
    server_host = ldap://example.com
    search_base = ou=Groups,dc=example,dc=com
    query_filter = (&(objectClass=posixGroup)(displayName=%s))
    result_attribute = memberUid
    domain = example.com
    version = 3
    bind = no
    Lines above are for static groups (i.e. system groups are also distribution lists).

    And for dynamic stuff, where you do some more sophisticated magic:

    Code:
    server_host = ldap://example.com
    search_base = o=Email,dc=example,dc=com
    query_filter = (l=%s)
    special_result_attribute = description
    result_attribute = mail
    bind = no
    The "description" attribute contains the LDAP query that will be used to match the users. "result_attribute" says which attribute contains the valid e-mail address. The query can look like this:
    Code:
    ldap://example.com/ou=Users,dc=example,dc=com?title,mail?sub?(title=CrazyPeople)
    Which means, that e-mail will be sent to all people having the title attribute 'CrazyPeople' (which is a multi-value field, thus you can really do a lot of magic with them).

    Once we have that we need to tell postfix to use our lookups. To do so edit the file /opt/zimbra/conf/zmmta.cf and substitute the following line:
    Code:
    POSTCONF virtual_alias_maps      LOCAL virtual_alias_maps
    into

    Code:
    POSTCONF virtual_alias_maps      ldap:/opt/zimbra/conf/ldap-static.cf,ldap:/opt/zimbra/conf/ldap-dyn.cf,ldap:/opt/zimbra/conf/ldap-vmm.cf
    You are done. Now just:
    Code:
    su - c zimbra
    postfix reload
    and you can start spamming your old friends

    This way you can create your own distribution lists and use full power of the system data, like groups or titles. Probably you can do similar things directly in Zimbra, but I am using account provisioning for Zimbra with external LDAP auth and I do need these mail distribution lists, since they require nearly no maintenance.
    If anybody knows how to do such thing IN Zimbra - I would love to hear more about the solution.

  3. #3
    Join Date
    Jan 2010
    Posts
    161
    Rep Power
    5

    Default

    I know this is old.. but how do you do this for multiple distribution lists?

Similar Threads

  1. Nested distribution lists
    By Britt in forum Administrators
    Replies: 6
    Last Post: 05-10-2013, 04:01 AM
  2. Spamassasin / AV for distribution lists?
    By lilwong in forum Administrators
    Replies: 7
    Last Post: 06-24-2008, 11:04 PM
  3. Distribution Lists
    By dillera in forum Administrators
    Replies: 5
    Last Post: 01-27-2008, 10:07 PM
  4. Distribution Lists
    By swu in forum Administrators
    Replies: 1
    Last Post: 07-12-2007, 07:08 PM
  5. Postfix RBL lists debug ?
    By RaNd in forum Administrators
    Replies: 1
    Last Post: 03-30-2007, 11:44 PM

Posting Permissions

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