aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extras/tables/table-sqlite/table-sqlite.59
-rw-r--r--extras/tables/table-sqlite/table_sqlite.c3
2 files changed, 12 insertions, 0 deletions
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:
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);