diff --git a/imageroot/actions/configure-module/30Bind_user_domain b/imageroot/actions/configure-module/30Bind_user_domain new file mode 100755 index 0000000..817a59b --- /dev/null +++ b/imageroot/actions/configure-module/30Bind_user_domain @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 + +# +# Copyright (C) 2024 Nethesis S.r.l. +# SPDX-License-Identifier: GPL-3.0-or-later +# + +import agent +import os + +rdb = agent.redis_connect() + +providers = agent.list_service_providers(rdb, 'imap', 'tcp', { + 'module_uuid': os.environ['MAIL_SERVER'] +}) + +if providers: + user_domain = providers[0]['user_domain'] + agent.bind_user_domains([user_domain])