Skip to content

Commit

Permalink
QA fix 6814 (#33)
Browse files Browse the repository at this point in the history
Reconfigure LDAP client if Mail user domain changes
  • Loading branch information
DavidePrincipi authored Jan 23, 2024
1 parent 775dcaf commit e684127
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions imageroot/actions/configure-module/20config
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,10 @@ if "mail_module" in data and "mail_domain" in data:
agent.assert_exp(psql.returncode == 0) # check the command is succesfull

user_domain_name = rdb.hget(f"module/{mail_module}/srv/tcp/imap", "user_domain") or ""
user_domain = agent.ldapproxy.Ldapproxy().get_domain(user_domain_name) or {}

domain_setup(mail_domain, user_domain)
# Bind the new domain, overriding previous values (unbind)
agent.bind_user_domains([user_domain_name])
user_domain = agent.ldapproxy.Ldapproxy().get_domain(user_domain_name) or {}
domain_setup(mail_domain, user_domain)
agent.set_env("MAIL_MODULE", mail_module)
agent.set_env("MAIL_DOMAIN", mail_domain)
agent.set_env("RESTART_WEBAPP", "1")
Expand All @@ -274,6 +273,7 @@ if "MAIL_MODULE" in os.environ and ("mail_module" not in data or data["mail_modu
user_domain = agent.ldapproxy.Ldapproxy().get_domain(user_domain_name) or {}

if user_domain["port"] != os.environ["USER_DOMAIN_PORT"]:
agent.bind_user_domains([user_domain_name])
domain_setup(user_domain_name, user_domain)
agent.set_env("RESTART_WEBAPP", "1")

Expand Down

0 comments on commit e684127

Please sign in to comment.