From f2ded792c51fff41b0727f8833e2dae2bc3d8b60 Mon Sep 17 00:00:00 2001 From: Sergo Date: Fri, 4 Aug 2023 08:42:51 +0300 Subject: [PATCH] filter emails to search by --- config/default.json | 3 ++- src/services/aliases/aliases.class.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config/default.json b/config/default.json index 5680920..62b451a 100644 --- a/config/default.json +++ b/config/default.json @@ -12,6 +12,7 @@ "wildDuck": { "url": "http://localhost", "token": "aaaaa", - "domain": "test-codemowers.eu" + "domain": "test-codemowers.eu", + "preferredDomain": "k-space.ee" } } \ No newline at end of file diff --git a/src/services/aliases/aliases.class.ts b/src/services/aliases/aliases.class.ts index 59941e1..928ec99 100644 --- a/src/services/aliases/aliases.class.ts +++ b/src/services/aliases/aliases.class.ts @@ -93,7 +93,9 @@ export class AliasesService const emails = params.session?.user?.emails; const addressInfoResponse = await Promise.any( - emails.map((email: string) => + emails + .filter((email: string) => email.endsWith(config.get("wildDuck.preferredDomain"))) + .map((email: string) => wildDuckClient.get(`addresses/resolve/${email}`), ), );