From 3070e504ad563d9b83c651aef7a36ecbe9162ffa Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 26 Dec 2023 17:52:08 +0100 Subject: [PATCH] Make rspamd an optional dependency, because rspamd is only necessary when you really care about incoming mail, is resource-heavy, and for some reason some setups cant install libhyperscan which is required by rspamd --- conf/yunohost/services.yml | 1 + debian/control | 3 ++- hooks/conf_regen/31-rspamd | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/conf/yunohost/services.yml b/conf/yunohost/services.yml index 693793465..68ee162ca 100644 --- a/conf/yunohost/services.yml +++ b/conf/yunohost/services.yml @@ -43,6 +43,7 @@ redis-server: rspamd: log: /var/log/rspamd/rspamd.log category: email + ignore_if_package_is_not_installed: rspamd slapd: category: database test_conf: slapd -Tt diff --git a/debian/control b/debian/control index 9736e392e..cb9ed2490 100644 --- a/debian/control +++ b/debian/control @@ -25,7 +25,7 @@ Depends: ${python3:Depends}, ${misc:Depends} , dnsmasq, resolvconf, libnss-myhostname , postfix, postfix-ldap, postfix-policyd-spf-perl, postfix-pcre , dovecot-core, dovecot-ldap, dovecot-lmtpd, dovecot-managesieved, dovecot-antispam - , rspamd, opendkim-tools, postsrsd, procmail, mailutils + , opendkim-tools, postsrsd, procmail, mailutils , redis-server , acl , git, curl, wget, cron, unzip, jq, bc, at, procps @@ -35,6 +35,7 @@ Recommends: yunohost-admin, yunohost-portal (>= 12.0) , bash-completion, rsyslog , unattended-upgrades , libdbd-ldap-perl, libnet-dns-perl + , rspamd Conflicts: iptables-persistent , apache2 , bind9 diff --git a/hooks/conf_regen/31-rspamd b/hooks/conf_regen/31-rspamd index 6333a755f..4ab396929 100755 --- a/hooks/conf_regen/31-rspamd +++ b/hooks/conf_regen/31-rspamd @@ -2,6 +2,12 @@ set -e +if ! dpkg --list | grep -q 'ii *rspamd ' +then + echo 'rspamd is not installed, skipping' + exit 0 +fi + do_pre_regen() { pending_dir=$1