On Thu, Apr 17, 2014 at 12:20 PM, Viktor Dukhovni <postfix-us...@dukhovni.org> wrote: > On Thu, Apr 17, 2014 at 10:53:53AM -0400, Mello, Cody wrote: > >> > This needs a better user interface. >> >> In which ways? Do you mean to avoid making people follow the RFC2247 >> style of writing the base DN? Or is there something else? > > The "%," notation could perhaps be less cryptic or more general. >
I think that "%," is fine, but I could see it being easily missed by someone casually reading documentation or someone else's configuration file. Keeping the simple substitution would keep the syntax from becoming overly complicated, but being able to parametrize the variable to be more general could be useful for people with different or more complex directories. On Thu, Apr 17, 2014 at 1:08 PM, Wietse Venema <wie...@porcupine.org> wrote: > In the case of ldap_table I'd also like to see that the decorative > "dc=" text is configurable. If the comma is configurable, even better. > > For example, "dc=%{labels:d,}" produces a comma-separated list of > "dc=example, dc=com" given an email address of u...@example.com. > I think that this should go a bit further. For example, someone might want to turn "dept.school.edu" into "o=dept,dc=school,dc=edu". Perhaps a list of prefixes, where the last prefix is applied repeatedly? While better syntax is possible, it could be something along the lines of "%d[o=,dc=]" or perhaps "%d[o=,dc=][,]" to specify the comma. For reference, the way that Dovecot approaches this is by having variable modifiers that operate on the following modifier. So, for example, "%d" refers to the domain part of the address, and the "%D" modifier does the transformation. So "%Dd" for "u...@example.com" becomes "example,dc=com". I'm not too crazy about how it drops the first "dc=", but it does allow whoever is configuring the server to pick the first prefix. So writing "o=%Dd" would work on "u...@dept.school.edu" the same way as above. - Cody