|
|
|
@ -304,6 +304,7 @@ def config_update(verbose=False, delete_objects=False):
|
|
|
|
|
if verbose:
|
|
|
|
|
print(f'Deleting domain: {domain.name}')
|
|
|
|
|
db.session.delete(domain)
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
# don't commit when running dry
|
|
|
|
|
# do not commit when running dry
|
|
|
|
|
if dry_run:
|
|
|
|
|
log.changes('Dry run. Not committing changes.')
|
|
|
|
|
db.session.rollback()
|
|
|
|
@ -400,15 +401,29 @@ def config_export(full=False, secrets=False, color=False, dns=False, output=None
|
|
|
|
|
finally:
|
|
|
|
|
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()
|
|
|
|
|
@click.argument('email')
|
|
|
|
|
@with_appcontext
|
|
|
|
|
def alias_delete(email):
|
|
|
|
|
"""delete alias"""
|
|
|
|
|
alias = models.Alias.query.get(email)
|
|
|
|
|
if alias:
|
|
|
|
|
if alias := models.Alias.query.get(email):
|
|
|
|
|
db.session.delete(alias)
|
|
|
|
|
db.session.commit()
|
|
|
|
|
db.session.commit()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@mailu.command()
|
|
|
|
|