VirtualMailManager/cli/subcommands.py
branchv0.6.x
changeset 456 7847f949d0a2
parent 455 b15960e9c53c
child 458 4ff0fa3ba0fa
equal deleted inserted replaced
455:b15960e9c53c 456:7847f949d0a2
   212         usage(EX_MISSING_ARGS, _(u'Missing domain name.'), ctx.scmd)
   212         usage(EX_MISSING_ARGS, _(u'Missing domain name.'), ctx.scmd)
   213     elif ctx.argc < 4:
   213     elif ctx.argc < 4:
   214         ctx.hdlr.domain_add(ctx.args[2].lower())
   214         ctx.hdlr.domain_add(ctx.args[2].lower())
   215     else:
   215     else:
   216         ctx.hdlr.domain_add(ctx.args[2].lower(), ctx.args[3])
   216         ctx.hdlr.domain_add(ctx.args[2].lower(), ctx.args[3])
   217     if not ctx.cget('domain.auto_postmaster'):
   217     if ctx.cget('domain.auto_postmaster'):
   218         return
   218         w_std(_(u'Creating account for postmaster@%s') % ctx.args[2].lower())
   219     ctx.scmd = 'useradd'
   219         ctx.scmd = 'useradd'
   220     ctx.args = [prog, ctx.scmd, u'postmaster@' + ctx.args[2].lower()]
   220         ctx.args = [prog, ctx.scmd, u'postmaster@' + ctx.args[2].lower()]
   221     ctx.argc = 3
   221         ctx.argc = 3
   222     user_add(ctx)
   222         user_add(ctx)
   223 
   223 
   224 
   224 
   225 def domain_delete(ctx):
   225 def domain_delete(ctx):
   226     """delete the given domain and all its alias domains"""
   226     """delete the given domain and all its alias domains"""
   227     if ctx.argc < 3:
   227     if ctx.argc < 3: