|
|
@ -304,6 +304,7 @@ def config_update(verbose=False, delete_objects=False):
|
|
|
|
if verbose:
|
|
|
|
if verbose:
|
|
|
|
print(f'Deleting domain: {domain.name}')
|
|
|
|
print(f'Deleting domain: {domain.name}')
|
|
|
|
db.session.delete(domain)
|
|
|
|
db.session.delete(domain)
|
|
|
|
|
|
|
|
|
|
|
|
db.session.commit()
|
|
|
|
db.session.commit()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -351,7 +352,7 @@ def config_import(verbose=0, secrets=False, debug=False, quiet=False, color=Fals
|
|
|
|
raise click.ClickException(msg) from exc
|
|
|
|
raise click.ClickException(msg) from exc
|
|
|
|
raise
|
|
|
|
raise
|
|
|
|
|
|
|
|
|
|
|
|
# don't commit when running dry
|
|
|
|
# do not commit when running dry
|
|
|
|
if dry_run:
|
|
|
|
if dry_run:
|
|
|
|
log.changes('Dry run. Not committing changes.')
|
|
|
|
log.changes('Dry run. Not committing changes.')
|
|
|
|
db.session.rollback()
|
|
|
|
db.session.rollback()
|
|
|
@ -400,13 +401,27 @@ def config_export(full=False, secrets=False, color=False, dns=False, output=None
|
|
|
|
finally:
|
|
|
|
finally:
|
|
|
|
os.umask(old_umask)
|
|
|
|
os.umask(old_umask)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@mailu.command()
|
|
|
|
|
|
|
|
@click.argument('email')
|
|
|
|
|
|
|
|
@click.option('-r', '--really', is_flag=True)
|
|
|
|
|
|
|
|
@with_appcontext
|
|
|
|
|
|
|
|
def user_delete(email, really=False):
|
|
|
|
|
|
|
|
"""disable or delete user"""
|
|
|
|
|
|
|
|
if user := models.User.query.get(email):
|
|
|
|
|
|
|
|
if really:
|
|
|
|
|
|
|
|
db.session.delete(user)
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
user.enabled = False
|
|
|
|
|
|
|
|
db.session.commit()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@mailu.command()
|
|
|
|
@mailu.command()
|
|
|
|
@click.argument('email')
|
|
|
|
@click.argument('email')
|
|
|
|
@with_appcontext
|
|
|
|
@with_appcontext
|
|
|
|
def alias_delete(email):
|
|
|
|
def alias_delete(email):
|
|
|
|
"""delete alias"""
|
|
|
|
"""delete alias"""
|
|
|
|
alias = models.Alias.query.get(email)
|
|
|
|
if alias := models.Alias.query.get(email):
|
|
|
|
if alias:
|
|
|
|
|
|
|
|
db.session.delete(alias)
|
|
|
|
db.session.delete(alias)
|
|
|
|
db.session.commit()
|
|
|
|
db.session.commit()
|
|
|
|
|
|
|
|
|
|
|
|