fix running just pop server

This commit is contained in:
Balakrishnan Balasubramanian 2020-08-06 19:52:05 -04:00
parent 811f93a6d1
commit 089507c0ac
2 changed files with 20 additions and 1 deletions

View File

@ -16,6 +16,10 @@ Mail server for single user #asyncio #python
pipenv install
sudo $(pipenv --venv)/bin/python ./run.py --certfile /etc/letsencrypt/live/your.domain.com/fullchain.pem --keyfile /etc/letsencrypt/live/your.domain.com/privkey.pem /var/mails --password_hash <PASSWORD_HASH_FROM_ABOVE>
## Just pop server for debugging
pipenv run python -m mail4one.pop3 /path/to/mails 9995 your_password
## Nextups
* Support sending emails - Also support for popular services like mailgun/sendgrid

View File

@ -288,5 +288,20 @@ async def a_main(*args, **kwargs):
await server.serve_forever()
def debug_main():
logging.basicConfig(level=logging.DEBUG)
import sys
_, mails_path, port, password = sys.argv
mails_path = Path(mails_path)
port = int(port)
password_hash = add_season(password.encode(), Session.SALT).hex()
asyncio.run(a_main(mails_path, port, password_hash=password_hash))
if __name__ == "__main__":
asyncio.run(a_main(Path("/tmp/mails"), 9995, password_hash=add_season(b"dummy", Session.SALT).hexdigest()))
debug_main()