dovecot.py 998 B

1234567891011121314151617181920212223242526272829303132
  1. # SPDX-FileCopyrightText: 2016-2017 Helmut Pozimski <helmut@pozimski.eu>
  2. #
  3. # SPDX-License-Identifier: GPL-2.0-only
  4. # -*- coding: utf8 -*-
  5. """ Contains the dovecot module which manages certificates for the dovecot
  6. mail server.
  7. """
  8. from amulib import service
  9. def run(config=None, acme_dir="/var/lib/acme",
  10. named_key_path="/run/named/session.key", dns_server="localhost"):
  11. """ manages the certificates for dovecot
  12. :param config: configuration for the service
  13. :type config: dict
  14. :param acme_dir: path to the acme state dir
  15. :type acme_dir: str
  16. :param named_key_path: path to the named session.key
  17. :type named_key_path: str
  18. """
  19. if not config:
  20. config = {
  21. "certificate_path": "/usr/share/ssl/certs/dovecot.pem",
  22. "key_path": "/usr/share/ssl/private/dovecot.pem",
  23. "tlsa": True,
  24. "tlsa_ports": [993]
  25. }
  26. service.run("dovecot", config, acme_dir, named_key_path, dns_server)