Commit 8618476f authored by Paul Cammish's avatar Paul Cammish
Browse files

Correctly parse mail quota files when present, reduce ClamAV resource requrements

parent 79fac69d
CHANGELOG
---------
2022-09-29
sympl-mail
* Correctly parse quota files when present
* Drastically reduce antivirus resource requirments
2022-07-19
sympl-firewall
* Reduce automatic whitelist/blacklist matching
......
sympl-mail (11.20220929.0) stable; urgency=medium
* Correctly parse quota files when present. Fixes #328
* Drastically reduce ClamAV resource usage
-- Paul Cammish <sympl@kelduum.net> Thu, 29 Sep 2022 09:39:00 +0100
sympl-mail (11.20220323.0) stable; urgency=medium
* Correctly regenerate dhparams for dovecot
......
......@@ -81,6 +81,22 @@ fi
#
echo "TMPDIR='/var/tmp/'" >> /etc/default/clamav-daemon
#
# Limit ClamAV resource usage to something more reasonable
#
# Drop the priorities as it's okay to wait an extra few seconds for
# mail.
if [ ! -f /etc/systemd/system/clamav-daemon.service.d/sympl.conf ]; then
echo -e "[Service]\nIOSchedulingPriority = 5\nCPUSchedulingPolicy = 5\nCPUQuota = 30%\nNice = 10" > /etc/systemd/system/clamav-daemon.service.d/sympl.conf
systemctl daemon-reload
fi
# Prevent loading the whole database in to ram twice and hot-swapping
# when updating - this leaves a small window where mail mail not get
# scanned
if ! grep -q 'ConcurrentDatabaseReload' /etc/clamav/clamd.conf ; then
echo "ConcurrentDatabaseReload no" >> /etc/clamav/clamd.conf
fi
#
# Enable the spamassassin module
#
......
......@@ -50,6 +50,11 @@ if [ "$1" = "purge" ] ; then
echo "I: Disallowing clamav to operate using its supplementary groups"
sed -i -e 's/^AllowSupplementaryGroups .*$/AllowSupplementaryGroups false/' /etc/clamav/clamd.conf
fi
# remove the clamav resource limitations
if -f /etc/systemd/system/clamav-daemon.service.d/sympl.conf ; then rm /etc/systemd/system/clamav-daemon.service.d/sympl.conf ; fi
systemctl daemon-reload
fi
#
......
......@@ -35,10 +35,10 @@ address_directory:
#
quota = ${if match{ \
${if exists{VHOST_DIR/${domain}/VHOST_MAILBOX_DIR/${local_part}/quota} \
{${readfile{VHOST_DIR/${domain}/VHOST_MAILBOX_DIR/${local_part}/quota}}} \
{${readfile{VHOST_DIR/${domain_data}/VHOST_MAILBOX_DIR/${local_part_data}/quota}}} \
{ \
${if exists{VHOST_DIR/${domain}/VHOST_CONFIG_DIR/mailbox-quota} \
{${readfile{VHOST_DIR/${domain}/VHOST_CONFIG_DIR/mailbox-quota}}} \
{${readfile{VHOST_DIR/${domain_data}/VHOST_CONFIG_DIR/mailbox-quota}}} \
{ \
${if exists{ETC_DIR/exim4/mailbox-quota} \
{${readfile{ETC_DIR/exim4/mailbox-quota}}} \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment