dovecot.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # This file is part of acme-updater, written by Helmut Pozimski 2016-2017.
  2. #
  3. # stov is free software: you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation, version 2 of the License.
  6. #
  7. # stov is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. #
  12. # You should have received a copy of the GNU General Public License
  13. # along with stov. If not, see <http://www.gnu.org/licenses/>.
  14. # -*- coding: utf8 -*-
  15. """ Contains the dovecot module which manages certificates for the dovecot
  16. mail server.
  17. """
  18. from amulib import service
  19. def run(config=None, acme_dir="/var/lib/acme",
  20. named_key_path="/run/named/session.key"):
  21. """ manages the certificates for dovecot
  22. :param config: configuration for the service
  23. :type config: dict
  24. :param acme_dir: path to the acme state dir
  25. :type acme_dir: str
  26. :param named_key_path: path to the named session.key
  27. :type named_key_path: str
  28. """
  29. if not config:
  30. config = {
  31. "certificate_path": "/usr/share/ssl/certs/dovecot.pem",
  32. "key_path": "/usr/share/ssl/private/dovecot.pem",
  33. "tlsa": True,
  34. "tlsa_ports": [993]
  35. }
  36. service.run("dovecot", config, acme_dir, named_key_path)