Viktor Dukhovni: > 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. > > Wietse wanted it to be a more general mechanism for iterating over > domain components to produce a result.
Consider, for example, the pipe(8) daemon which has iterating macros. There, the iteration is over the set of recipient addresses, while with ldap_table it would be over the set of domain labels. For example, ($recipient) expands into (recipient1) (recipient2)... Instead of hard-coding the "(" and the ")" they are configurable so that the same mechanimsm can be used for other text. I shamelessly stole this from Sendmail which I used for 10+ years before Postfix. 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. Wietse > I could not come up with any plausible use-cases beyond generation > of comma separated "dc=label" lists. > > If anyone can suggest additional use-cases where one might use some > iterator to build a string out of the domain components for LDAP > or even the various SQL tables, please post. > I still think that "%," is reasonably natural, and has no obvious > useful generalizations without simply passing the domain to > for processing via interpreted code. > > -- > Viktor. >