1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-07-03 00:47:16 +02:00
Files
Mailu/core/base/libs/podop/scripts/podop

34 lines
1.2 KiB
Plaintext
Raw Normal View History

2018-07-22 20:06:30 +02:00
#!/usr/bin/env python
import argparse
from podop import run_server, SERVER_TYPES, TABLE_TYPES
def main():
""" Run a podop server based on CLI arguments
"""
parser = argparse.ArgumentParser("Postfix and Dovecot proxy")
parser.add_argument("--socket", required=True,
help="path to the listening unix socket")
parser.add_argument("--mode", choices=SERVER_TYPES.keys(), required=True,
help="select which server will connect to Podop")
parser.add_argument("--name", action="append",
help="name of each configured table")
parser.add_argument("--type", choices=TABLE_TYPES.keys(), action="append",
help="type of each configured table")
parser.add_argument("--param", action="append",
help="mandatory param for each table configured")
parser.add_argument("-v", "--verbose", dest="verbosity",
action="count", default=0,
help="increases log verbosity for each occurence.")
2018-07-22 20:06:30 +02:00
args = parser.parse_args()
run_server(
args.verbosity, args.mode, args.socket,
2018-07-22 20:06:30 +02:00
zip(args.name, args.type, args.param) if args.name else []
)
if __name__ == "__main__":
main()