mirror of
https://github.com/chatmail/relay.git
synced 2026-05-20 04:48:06 +00:00
wip
This commit is contained in:
@@ -17,6 +17,7 @@ from pyinfra.operations import apt, files, pip, server, systemd
|
|||||||
|
|
||||||
from .acmetool import deploy_acmetool
|
from .acmetool import deploy_acmetool
|
||||||
|
|
||||||
|
root_owned = dict(user="root", group="root", mode="644")
|
||||||
|
|
||||||
def _build_chatmaild(dist_dir) -> None:
|
def _build_chatmaild(dist_dir) -> None:
|
||||||
dist_dir = Path(dist_dir).resolve()
|
dist_dir = Path(dist_dir).resolve()
|
||||||
@@ -50,7 +51,6 @@ def _install_remote_venv_with_chatmaild(config) -> None:
|
|||||||
remote_dist_file = f"{remote_base_dir}/dist/{dist_file.name}"
|
remote_dist_file = f"{remote_base_dir}/dist/{dist_file.name}"
|
||||||
remote_venv_dir = f"{remote_base_dir}/venv"
|
remote_venv_dir = f"{remote_base_dir}/venv"
|
||||||
remote_chatmail_inipath = f"{remote_base_dir}/chatmail.ini"
|
remote_chatmail_inipath = f"{remote_base_dir}/chatmail.ini"
|
||||||
root_owned = dict(user="root", group="root", mode="644")
|
|
||||||
|
|
||||||
apt.packages(
|
apt.packages(
|
||||||
name="apt install python3-virtualenv",
|
name="apt install python3-virtualenv",
|
||||||
@@ -384,7 +384,7 @@ def _configure_dovecot(config: Config, debug: bool = False) -> bool:
|
|||||||
files.put(
|
files.put(
|
||||||
name="Upload expunge.timer",
|
name="Upload expunge.timer",
|
||||||
src=importlib.resources.files(__package__).joinpath("service/expunge.timer"),
|
src=importlib.resources.files(__package__).joinpath("service/expunge.timer"),
|
||||||
dest=f"/etc/systemd/system/metrics.timer",
|
dest=f"/etc/systemd/system/expunge.timer",
|
||||||
**root_owned,
|
**root_owned,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,9 @@
|
|||||||
Description=Expunge old mails after {{ config.delete_mails_after }} days
|
Description=Expunge old mails after {{ config.delete_mails_after }} days
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
# delete all mails after {{ config.delete_mails_after }} days, in the Inbox
|
# delete all mails after {{ config.delete_mails_after }} days, in the Inbox
|
||||||
ExecStart={{ config.execpath }} /home/vmail/mail/{{ config.mail_domain }} > /var/www/html/metrics
|
ExecStart=/home/vmail/mail/{{ config.mail_domain }} -path '*/cur/*' -mtime +{{ config.delete_mails_after }} -type f -delete
|
||||||
# or in any IMAP subfolder
|
# or in any IMAP subfolder
|
||||||
ExecStart=vmail find /home/vmail/mail/{{ config.mail_domain }} -path '*/.*/cur/*' -mtime +{{ config.delete_mails_after }} -type f -delete
|
ExecStart=vmail find /home/vmail/mail/{{ config.mail_domain }} -path '*/.*/cur/*' -mtime +{{ config.delete_mails_after }} -type f -delete
|
||||||
# even if they are unseen
|
# even if they are unseen
|
||||||
|
|||||||
Reference in New Issue
Block a user