Reduce API usage
This commit is contained in:
parent
56ea451ed1
commit
6fd13bc071
2 changed files with 2 additions and 2 deletions
2
main.py
2
main.py
|
@ -37,7 +37,7 @@ def main(config_dir, dry_run, keep):
|
|||
use_tls=config["Re2o"]["use_TLS"],
|
||||
)
|
||||
users_emails = re2o_client.list("localemail/users")
|
||||
users = filter(lambda x: x["local_email_enabled"], re2o_client.list("users/user/"))
|
||||
users = set(map(lambda x: x['email_address'][0]['user'], users_emails))
|
||||
local_email_domain = re2o_client.view("preferences/optionaluser/")["local_email_domain"]
|
||||
env = Environment(loader=FileSystemLoader(str(config_dir)))
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# List of virtual mailboxes. Do not edit as it is generated by re2o.
|
||||
|
||||
{% for user in users %}
|
||||
{{user.pseudo}}{{local_email_domain}} whatever
|
||||
{{user}}{{local_email_domain}} whatever
|
||||
{% endfor %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue