add config option socket, rework example config and release 1.0.0

This commit is contained in:
2020-04-22 23:02:05 +02:00
parent 2d73d525b8
commit 01b516ce7c
6 changed files with 51 additions and 44 deletions

View File

@@ -40,7 +40,7 @@ def main():
"-s",
"--socket",
help="Socket used to communicate with the MTA.",
required=True)
default="")
parser.add_argument(
"-d",
"--debug",
@@ -95,6 +95,15 @@ def main():
if "global" not in config:
config["global"] = {}
if args.socket:
socket = args.socket
elif "socket" in config["global"]:
socket = config["global"]["socket"]
else:
raise RuntimeError(
f"listening socket is neither specified on the command line "
f"nor in the configuration file")
if "local_addrs" not in config["global"]:
config["global"]["local_addrs"] = [
"127.0.0.0/8",
@@ -177,7 +186,7 @@ def main():
rc = 0
try:
Milter.runmilter("pymodmilter", socketname=args.socket, timeout=30)
Milter.runmilter("pymodmilter", socketname=socket, timeout=30)
except Milter.milter.error as e:
logger.error(e)
rc = 255

View File

@@ -1 +1 @@
__version__ = "0.0.9"
__version__ = "1.0.0"