diff --git a/imageroot/actions/clone-module/50configure-module b/imageroot/actions/clone-module/50configure-module index 0d5274a..a304132 100755 --- a/imageroot/actions/clone-module/50configure-module +++ b/imageroot/actions/clone-module/50configure-module @@ -13,7 +13,7 @@ configure_retval = agent.tasks.run(agent_id=os.environ['AGENT_ID'], action='conf "lets_encrypt": os.environ["TRAEFIK_LETS_ENCRYPT"] == 'True', "host": os.environ["TRAEFIK_HOST"], "http2https": os.environ["TRAEFIK_HTTP2HTTPS"] == 'True', - "restore": True, + "restore": True, # restore the configuration to the relay rule and the alwaysBccAddress "retention_days": int(os.environ["RETENTION_DAYS"]), }) agent.assert_exp(configure_retval['exit_code'] == 0, "The configure-module subtask failed!") diff --git a/imageroot/actions/configure-module/90add-relay-rule b/imageroot/actions/configure-module/90add-relay-rule index 3396e84..b7c4126 100755 --- a/imageroot/actions/configure-module/90add-relay-rule +++ b/imageroot/actions/configure-module/90add-relay-rule @@ -27,6 +27,7 @@ ip_address = rdb.hget(f'node/{node_id}/vpn', 'ip_address') if providers: mail_id = providers[0]["module_id"] + # we configure the first time and if we are in a clone or restore action if not os.environ.get("MAIL_SERVER") or data.get("restore", False): # first configuration, we add the relay rule response = agent.tasks.run(f"module/{mail_id}", action='add-relay-rule', data={ diff --git a/imageroot/actions/restore-module/50configure-module b/imageroot/actions/restore-module/50configure-module index 24a86cf..114ba36 100755 --- a/imageroot/actions/restore-module/50configure-module +++ b/imageroot/actions/restore-module/50configure-module @@ -18,7 +18,7 @@ configure_retval = agent.tasks.run(agent_id=os.environ['AGENT_ID'], action='conf "lets_encrypt": renv["TRAEFIK_LETS_ENCRYPT"] == 'True', "host": renv["TRAEFIK_HOST"], "http2https": renv["TRAEFIK_HTTP2HTTPS"] == 'True', - "restore": True, + "restore": True, # restore the configuration to the relay rule and the alwaysBccAddress 'retention_days': int(renv['RETENTION_DAYS']), }) agent.assert_exp(configure_retval['exit_code'] == 0, "The configure-module subtask failed!")