diff options
author | fgma <fgma@users.noreply.github.com> | 2019-10-16 22:12:43 +0200 |
---|---|---|
committer | fgma <fgma@users.noreply.github.com> | 2019-10-16 22:12:43 +0200 |
commit | 44ed8f5cae77f5c70c57a91cdca481856b2ff94a (patch) | |
tree | 51839b078f49f8fde85ac59c6312b19df482ac74 | |
parent | Merge pull request #57 from jdelic/upstream-pr/automake-16 (diff) | |
download | OpenSMTPD-extras-44ed8f5cae77f5c70c57a91cdca481856b2ff94a.tar.xz OpenSMTPD-extras-44ed8f5cae77f5c70c57a91cdca481856b2ff94a.zip |
support for mailaddrmap lookups in table-postgres
-rw-r--r-- | extras/tables/table-postgres/table_postgres.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/extras/tables/table-postgres/table_postgres.c b/extras/tables/table-postgres/table_postgres.c index 9385c5b..e1aa613 100644 --- a/extras/tables/table-postgres/table_postgres.c +++ b/extras/tables/table-postgres/table_postgres.c @@ -40,6 +40,7 @@ enum { SQL_SOURCE, SQL_MAILADDR, SQL_ADDRNAME, + SQL_MAILADDRMAP, SQL_MAX }; @@ -234,6 +235,7 @@ config_connect(struct config *conf) { "query_source", 1 }, { "query_mailaddr", 1 }, { "query_addrname", 1 }, + { "query_mailaddrmap", 1 }, }; size_t i; char *conninfo, *q; @@ -381,6 +383,7 @@ table_postgres_lookup(int service, struct dict *params, const char *key, char *d r = 1; switch(service) { case K_ALIAS: + case K_MAILADDRMAP: memset(dst, 0, sz); for (i = 0; i < PQntuples(res); i++) { if (dst[0] && strlcat(dst, ", ", sz) >= sz) { |