def smtpcli(argv):
    bindto = None
    port = 25
    sourcefile = None
    paged = False
    logname = None
    try:
        optlist, longopts, args = getopt.getopt(argv[1:], "b:hp:s:l:g")
    except getopt.GetoptError:
            print(smtpcli.__doc__)
            return
    for opt, val in optlist:
        if opt == "-b":
            bindto = val
        if opt == "-l":
            logname = val
        elif opt == "-s":
            sourcefile = val
        elif opt == "-g":
            paged = True
        elif opt == "-h":
            print(smtpcli.__doc__)
            return
        elif opt == "-p":
            try:
                port = int(val)
            except ValueError:
                print(smtpcli.__doc__)
                return

    theme = UI.DefaultTheme(PROMPT)
    parser = CLI.get_cli(EmailClientCLI, paged=paged, theme=theme)
    if len(args) > 0:
        if len(args) > 1:
            port = int(args[1])
        else:
            port = 25
        host = args[0]
    else:
        host = ""
    if logname:
        parser.commands.logfile(["logfile", logname])
    if host:
        parser.commands.connect(["connect"]+IF(bindto, ["-s", bindto], [])+[host, port])
    else:
        parser.commands._print("Be sure to run 'connect' before anything else.\n")

    if sourcefile:
        try:
            parser.parse(sourcefile)
        except CLI.CommandQuit:
            pass
    else:
        parser.interact()
Only accepts an accesing_obj that is superuser (e.g. user #1)
dataset/ETHPy150Open kdart/pycopia/net/pycopia/smtpCLI.py/smtpcli--crossover with--dataset/ETHPy150Open evennia/evennia/evennia/locks/lockfuncs.py/superuser