VirtualMailManager/cli/subcommands.py
changeset 618 d8736bb80bdc
parent 611 8e9b0046bc8f
child 638 0de0b9e75c9f
child 675 d24f094d1cb5
equal deleted inserted replaced
617:9eecf0160c39 618:d8736bb80bdc
   131     if ctx.argc < 3:
   131     if ctx.argc < 3:
   132         usage(EX_MISSING_ARGS, _(u'Missing alias address.'), ctx.scmd)
   132         usage(EX_MISSING_ARGS, _(u'Missing alias address.'), ctx.scmd)
   133     elif ctx.argc < 4:
   133     elif ctx.argc < 4:
   134         ctx.hdlr.alias_delete(ctx.args[2].lower())
   134         ctx.hdlr.alias_delete(ctx.args[2].lower())
   135     else:
   135     else:
   136         ctx.hdlr.alias_delete(ctx.args[2].lower(), ctx.args[3])
   136         ctx.hdlr.alias_delete(ctx.args[2].lower(), ctx.args[3:])
   137 
   137 
   138 
   138 
   139 def alias_info(ctx):
   139 def alias_info(ctx):
   140     """show the destination(s) of the specified alias"""
   140     """show the destination(s) of the specified alias"""
   141     if ctx.argc < 3:
   141     if ctx.argc < 3:
   218     if ctx.argc < 3:
   218     if ctx.argc < 3:
   219         usage(EX_MISSING_ARGS, _(u'Missing domain name.'), ctx.scmd)
   219         usage(EX_MISSING_ARGS, _(u'Missing domain name.'), ctx.scmd)
   220     elif ctx.argc < 4:
   220     elif ctx.argc < 4:
   221         ctx.hdlr.catchall_delete(ctx.args[2].lower())
   221         ctx.hdlr.catchall_delete(ctx.args[2].lower())
   222     else:
   222     else:
   223         ctx.hdlr.catchall_delete(ctx.args[2].lower(), ctx.args[3])
   223         ctx.hdlr.catchall_delete(ctx.args[2].lower(), ctx.args[3:])
   224 
   224 
   225 
   225 
   226 def catchall_info(ctx):
   226 def catchall_info(ctx):
   227     """show the catchall destination(s) of the specified domain"""
   227     """show the catchall destination(s) of the specified domain"""
   228     if ctx.argc < 3:
   228     if ctx.argc < 3:
   824     # Alias commands
   824     # Alias commands
   825     'aliasadd': cmd('aliasadd', 'aa', alias_add, 'address destination ...',
   825     'aliasadd': cmd('aliasadd', 'aa', alias_add, 'address destination ...',
   826                     _(u'create a new alias e-mail address with one or more '
   826                     _(u'create a new alias e-mail address with one or more '
   827                       u'destinations')),
   827                       u'destinations')),
   828     'aliasdelete': cmd('aliasdelete', 'ad', alias_delete,
   828     'aliasdelete': cmd('aliasdelete', 'ad', alias_delete,
   829                        'address [destination]',
   829                        'address [destination ...]',
   830                        _(u'delete the specified alias e-mail address or one '
   830                        _(u'delete the specified alias e-mail address or one '
   831                          u'of its destinations')),
   831                          u'of its destinations')),
   832     'aliasinfo': cmd('aliasinfo', 'ai', alias_info, 'address',
   832     'aliasinfo': cmd('aliasinfo', 'ai', alias_info, 'address',
   833                      _(u'show the destination(s) of the specified alias')),
   833                      _(u'show the destination(s) of the specified alias')),
   834     # AliasDomain commands
   834     # AliasDomain commands
   846     'catchalladd': cmd('catchalladd', 'caa', catchall_add,
   846     'catchalladd': cmd('catchalladd', 'caa', catchall_add,
   847                        'fqdn destination ...',
   847                        'fqdn destination ...',
   848                        _(u'add one or more catch-all destinations for a '
   848                        _(u'add one or more catch-all destinations for a '
   849                          u'domain')),
   849                          u'domain')),
   850     'catchalldelete': cmd('catchalldelete', 'cad', catchall_delete,
   850     'catchalldelete': cmd('catchalldelete', 'cad', catchall_delete,
   851                        'fqdn [destination]',
   851                        'fqdn [destination ...]',
   852                        _(u'delete the specified catch-all destination or all '
   852                        _(u'delete the specified catch-all destination or all '
   853                          u'of a domain\'s destinations')),
   853                          u'of a domain\'s destinations')),
   854     'catchallinfo': cmd('catchallinfo', 'cai', catchall_info, 'fqdn',
   854     'catchallinfo': cmd('catchallinfo', 'cai', catchall_info, 'fqdn',
   855                         _(u'show the catch-all destination(s) of the '
   855                         _(u'show the catch-all destination(s) of the '
   856                           u'specified domain')),
   856                           u'specified domain')),