From 1db908399ed178d024d3f46b8b2c76032a2d0835 Mon Sep 17 00:00:00 2001 From: Kumi Date: Tue, 19 Apr 2022 08:54:28 +0200 Subject: [PATCH] Preparation for usage on vessel, pyinstaller --- .gitignore | 5 ++++- requirements.txt | 3 ++- settings.ini | 2 +- worker.py | 8 +++++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 0deb7f8..f972e97 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ venv/ *.pyc __pycache__/ maildir/ -*.pem \ No newline at end of file +*.pem +build/ +dist/ +*.spec \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 61b9e53..7c4eb04 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -aiosmtpd \ No newline at end of file +aiosmtpd +pyopenssl diff --git a/settings.ini b/settings.ini index a14bb1d..8abf77a 100644 --- a/settings.ini +++ b/settings.ini @@ -2,5 +2,5 @@ maildir = maildir [USERS] -test = $argon2id$v=19$m=65536,t=3,p=4$0ZfYHQjV5IlHxtPqKP5O7A$LZ/vfXP1QoymVaPwwhH/0+FOK+Ek5fwr7YC98/E402A +test = $6$GCsvefFgXbOm7hyT$uYal5FY5iMsksr2zCUHIAfR1i7rqLEqJxNbqAlcBmK/3npjeLZsfvRKn8KI7yAiWLZL6.8xWRAh0KxslEfed80 diff --git a/worker.py b/worker.py index e883d82..ea316cc 100644 --- a/worker.py +++ b/worker.py @@ -4,6 +4,8 @@ from aiosmtpd.smtp import AuthResult import asyncio import logging +from argparse import ArgumentParser + from classes.smtpdhandler import SmtpdHandler from classes.config import Config from classes.authenticator import Authenticator @@ -12,10 +14,14 @@ from classes.ssl import SSL if __name__ == "__main__": log = logging.basicConfig() + parser = ArgumentParser() + parser.add_argument("-c", "--config", help="Path to config file", default="settings.ini") + args = parser.parse_args() + loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) - config = Config("settings.ini") + config = Config(args.config) authenticator = Authenticator(config) handler = SmtpdHandler(config)