mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
Compare commits
2 Commits
docs-ssh-h
...
global-deb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b441891d1f | ||
|
|
1c37d1f59b |
@@ -110,7 +110,7 @@ def _configure_opendkim(domain: str, dkim_selector: str) -> bool:
|
||||
return need_restart
|
||||
|
||||
|
||||
def _configure_postfix(domain: str) -> bool:
|
||||
def _configure_postfix(domain: str, debug: bool = False) -> bool:
|
||||
"""Configures Postfix SMTP server."""
|
||||
need_restart = False
|
||||
|
||||
@@ -124,21 +124,20 @@ def _configure_postfix(domain: str) -> bool:
|
||||
)
|
||||
need_restart |= main_config.changed
|
||||
|
||||
master_config = files.put(
|
||||
src=importlib.resources.files(__package__)
|
||||
.joinpath("postfix/master.cf")
|
||||
.open("rb"),
|
||||
master_config = files.template(
|
||||
src=importlib.resources.files(__package__).joinpath("postfix/master.cf.j2"),
|
||||
dest="/etc/postfix/master.cf",
|
||||
user="root",
|
||||
group="root",
|
||||
mode="644",
|
||||
debug=debug,
|
||||
)
|
||||
need_restart |= master_config.changed
|
||||
|
||||
return need_restart
|
||||
|
||||
|
||||
def _configure_dovecot(mail_server: str) -> bool:
|
||||
def _configure_dovecot(mail_server: str, debug: bool = False) -> bool:
|
||||
"""Configures Dovecot IMAP server."""
|
||||
need_restart = False
|
||||
|
||||
@@ -149,6 +148,7 @@ def _configure_dovecot(mail_server: str) -> bool:
|
||||
group="root",
|
||||
mode="644",
|
||||
config={"hostname": mail_server},
|
||||
debug=debug,
|
||||
)
|
||||
need_restart |= main_config.changed
|
||||
auth_config = files.put(
|
||||
@@ -215,8 +215,9 @@ def deploy_chatmail(mail_domain: str, mail_server: str, dkim_selector: str) -> N
|
||||
)
|
||||
|
||||
_install_chatmaild()
|
||||
dovecot_need_restart = _configure_dovecot(mail_server)
|
||||
postfix_need_restart = _configure_postfix(mail_domain)
|
||||
debug = False
|
||||
dovecot_need_restart = _configure_dovecot(mail_server, debug=debug)
|
||||
postfix_need_restart = _configure_postfix(mail_domain, debug=debug)
|
||||
opendkim_need_restart = _configure_opendkim(mail_domain, dkim_selector)
|
||||
|
||||
systemd.service(
|
||||
|
||||
@@ -4,13 +4,17 @@ protocols = imap lmtp
|
||||
|
||||
auth_mechanisms = plain
|
||||
|
||||
{% if debug == true %}
|
||||
auth_verbose = yes
|
||||
auth_debug = yes
|
||||
auth_debug_passwords = yes
|
||||
auth_verbose_passwords = plain
|
||||
auth_cache_size = 100M
|
||||
mail_plugins = quota
|
||||
mail_debug = yes
|
||||
{% endif %}
|
||||
|
||||
|
||||
mail_plugins = quota
|
||||
|
||||
# Authentication for system users.
|
||||
passdb {
|
||||
|
||||
@@ -9,7 +9,11 @@
|
||||
# service type private unpriv chroot wakeup maxproc command + args
|
||||
# (yes) (yes) (no) (never) (100)
|
||||
# ==========================================================================
|
||||
smtp inet n - y - - smtpd -v
|
||||
{% if debug == true %}
|
||||
smtp inet n - y - - smtpd -v
|
||||
{% else %}
|
||||
smtp inet n - y - - smtpd
|
||||
{% endif %}
|
||||
#smtp inet n - y - 1 postscreen
|
||||
#smtpd pass - - y - - smtpd
|
||||
#dnsblog unix - - y - 0 dnsblog
|
||||
Reference in New Issue
Block a user