Postfix + LDAP and query_filter

Discussion in 'Server Operation' started by somnium, Jan 14, 2014.

  1. somnium

    somnium New Member

    Hi@all,

    my ldap-users have two ldap attributes where their mail addresses and alias are stored in ([email protected] and [email protected]).

    unfortunately the domains are mixed between the two attributes:

    User1: [email protected] and [email protected]
    User2: [email protected] and [email protected]

    everything works fine with this query_filter for virtual aliases in postfix:

    [...]
    query_filter = (&(objectclass=gosaMailAccount)(|(mail=%s)(gosaMailAlternateAddress=%s)))
    result_attribute = uid, memberUid
    [...]

    now my problem:
    I want to split the two domains to two different mailserver, the old one with the old domain @foo.org and a new server with @bar.org. So, if a mail arrives at the old server with bar.org-domain, it should be relayed to the new server. but the virtual-checks are very early in the postfix-stack, so postfix finds always the bar.org domain and handles it as a local domain - even i removed bar.org from virtual_alias_domains.

    how can I change the filter not to find any @bar.org domains?

    i tried it with

    &(objectclass=gosaMailAccount)(|(mail=%s)(gosaMailAlternateAddress=%s)))(!(|(mail="*@bar.org")(gosaMailAlternateAddress="*@bar.org"))))

    and so on, but it doesn't work. I need something like "grep -v" behind the filter :eek: :D

    any ideas?
     

Share This Page