From 59f87adc0894c6b23ea0c03937355a24f3440767 Mon Sep 17 00:00:00 2001 From: fgma Date: Thu, 17 Oct 2019 11:48:50 +0000 Subject: support for mailaddrmap lookups in table-sqlite --- extras/tables/table-sqlite/table_sqlite.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extras/tables/table-sqlite/table_sqlite.c b/extras/tables/table-sqlite/table_sqlite.c index 4da84f3..d5ec28b 100644 --- a/extras/tables/table-sqlite/table_sqlite.c +++ b/extras/tables/table-sqlite/table_sqlite.c @@ -39,6 +39,7 @@ enum { SQL_SOURCE, SQL_MAILADDR, SQL_ADDRNAME, + SQL_MAILADDRMAP, SQL_MAX }; @@ -105,6 +106,7 @@ table_sqlite_update(void) { "query_source", 1 }, { "query_mailaddr", 1 }, { "query_addrname", 1 }, + { "query_mailaddrmap", 1 }, }; sqlite3 *_db; sqlite3_stmt *_statements[SQL_MAX]; @@ -346,6 +348,7 @@ table_sqlite_lookup(int service, struct dict *params, const char *key, char *dst switch(service) { case K_ALIAS: + case K_MAILADDRMAP: memset(dst, 0, sz); do { value = sqlite3_column_text(stmt, 0); -- cgit v1.2.3-59-g8ed1b From cc18ce9a47729ea8758da67cfe267b979f92ae05 Mon Sep 17 00:00:00 2001 From: fgma Date: Thu, 17 Oct 2019 13:57:26 +0200 Subject: new parameter added to manpage --- extras/tables/table-sqlite/table-sqlite.5 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/extras/tables/table-sqlite/table-sqlite.5 b/extras/tables/table-sqlite/table-sqlite.5 index d0963a6..8452aa8 100644 --- a/extras/tables/table-sqlite/table-sqlite.5 +++ b/extras/tables/table-sqlite/table-sqlite.5 @@ -98,6 +98,15 @@ This is used to provide a query for looking up a domain. The question mark is replaced with the appropriate data. For the domain it would be the right hand side of the SMTP address. This expects one VARCHAR to be returned with a matching domain name. +.Pp + +.It Xo +.Ic query_mailaddrmap +.Ar SQL statement +.Xc +This is used to provide a query for looking up a senders. The question mark +is replaced with the appropriate data. This expects one VARCHAR to be returned +with the address the sender is allowed to send mails from. .El A generic SQL statement would be something like: -- cgit v1.2.3-59-g8ed1b