1234567891011121314151617181920212223242526272829303132333435 |
- # SPDX-FileCopyrightText: 2016-2023 Helmut Pozimski <helmut@pozimski.eu>
- #
- # SPDX-License-Identifier: GPL-2.0-only
- # -*- coding: utf8 -*-
- """ Contains the dovecot module which manages certificates for the dovecot
- mail server.
- """
- from amulib import service
- from amulib.cert_path_provider import CertPathProvider
- def run(cert_path_provider: CertPathProvider, config=None,
- named_key_path="/run/named/session.key", dns_server="localhost"):
- """ manages the certificates for dovecot
- :param cert_path_provider: provider for certificate paths
- :type cert_path_provider: CertPathProvider
- :param config: configuration for the service
- :type config: dict
- :param named_key_path: path to the named session.key
- :type named_key_path: str
- :param dns_server: dns server to use
- :type dns_server: str
- """
- if not config:
- config = {
- "certificate_path": "/usr/share/ssl/certs/dovecot.pem",
- "key_path": "/usr/share/ssl/private/dovecot.pem",
- "tlsa": True,
- "tlsa_ports": [993]
- }
- service.run(cert_path_provider, "dovecot", config, named_key_path, dns_server)
|