Wietse Venema writes:
> > Would it be difficult to extend the pipemap functionality so it does a
> > lookup in the second map for each of the results produced by the first
> > map?
>
> Unfortunately, yes. The Postfix dictionary abstraction is a simple
> key->value service, and has no notion of "multiple-results".
Ah, I see.
> The various *SQL and LDAP tables internally concatenate multiple
> query results into a single comma-separated string and hope that's
> useful. The higher layers see a single output string.
> The dictionary API would have to be redesigned to support a list of
> results, with LDAP, ... returning a list instead of a single comma
> separated string. This is a major change.
Not only in table APIs, but also in programs that use those tables.
What should output from "postmap -q -" look like when applied to a
list of lookup keys? The output already uses newline to separate
one lookup result from the next lookup result. JSON objects?
That would be overkill. I had thought something like:
- The first map returns a result;
- The second maps splits this result by newline or comma, does a lookup for
each of the keys, concats this back together, and passes it on as the new
result.
I can imagine that using the comma as delimiter is unwanted in such a
generic part of postfix, but I had hoped that, since the higher layers
are able to make sense of a comma separated string, that it would be
possible for pipemap to do so as well.
Thanks a lot,
Roel