From 2fbda2efed9d53338ebdee0b431c0436f8f5cc6b Mon Sep 17 00:00:00 2001 From: Sebijk Date: Sun, 6 Mar 2022 16:53:53 +0100 Subject: [PATCH] add postfix transport list creator --- tools/postfix_transportlist.php | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 tools/postfix_transportlist.php diff --git a/tools/postfix_transportlist.php b/tools/postfix_transportlist.php new file mode 100644 index 0000000..967744f --- /dev/null +++ b/tools/postfix_transportlist.php @@ -0,0 +1,45 @@ +FetchArray()) { + if ($row['saliase'] != '') { + $domainList2 = explode(':', $row['saliase']); + foreach ($domainList2 as $domain) { + if (!in_array($domain, $domains)) { + $domains[] = $domain; + } + } + } + } + return $domains; +} +$res = $db->Query('SELECT saliase FROM {pre}gruppen WHERE saliase IS NOT NULL;'); // Get custom alias domains from groups +$domains = getDomainAliasesFromQuery($res,$domains); +$res = $db->Query('SELECT saliase FROM {pre}users WHERE saliase IS NOT NULL;'); // Get custom alias domains from users +$domains = getDomainAliasesFromQuery($res,$domains); + +foreach ($domains as $domain) { + echo $domain.' b1gmailtransport:dummy'."\n"; +}