|
|
@ -314,8 +314,9 @@ def alias_delete(email):
|
|
|
|
@click.argument('localpart')
|
|
|
|
@click.argument('localpart')
|
|
|
|
@click.argument('domain_name')
|
|
|
|
@click.argument('domain_name')
|
|
|
|
@click.argument('destination')
|
|
|
|
@click.argument('destination')
|
|
|
|
|
|
|
|
@click.option('-w', '--wildcard', is_flag=True)
|
|
|
|
@flask_cli.with_appcontext
|
|
|
|
@flask_cli.with_appcontext
|
|
|
|
def alias(localpart, domain_name, destination):
|
|
|
|
def alias(localpart, domain_name, destination, wildcard=False):
|
|
|
|
""" Create an alias
|
|
|
|
""" Create an alias
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
domain = models.Domain.query.get(domain_name)
|
|
|
|
domain = models.Domain.query.get(domain_name)
|
|
|
@ -325,6 +326,7 @@ def alias(localpart, domain_name, destination):
|
|
|
|
alias = models.Alias(
|
|
|
|
alias = models.Alias(
|
|
|
|
localpart=localpart,
|
|
|
|
localpart=localpart,
|
|
|
|
domain=domain,
|
|
|
|
domain=domain,
|
|
|
|
|
|
|
|
wildcard=wildcard,
|
|
|
|
destination=destination.split(','),
|
|
|
|
destination=destination.split(','),
|
|
|
|
email="%s@%s" % (localpart, domain_name)
|
|
|
|
email="%s@%s" % (localpart, domain_name)
|
|
|
|
)
|
|
|
|
)
|
|
|
|