Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _modules/scripts/new_options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ adapt_new_options() {
echo ENABLE_IPV6=${IPV6_BOOL} >> mailcow.conf
;;
SKIP_CLAMD)
echo '# Skip ClamAV (clamd-mailcow) anti-virus (Rspamd will auto-detect a missing ClamAV container) - y/n' >> mailcow.conf
echo '# Skip ClamAV (clamd-mailcow) anti-virus - y/n' >> mailcow.conf
echo 'SKIP_CLAMD=n' >> mailcow.conf
;;
SKIP_OLEFY)
Expand Down
15 changes: 15 additions & 0 deletions data/Dockerfiles/rspamd/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,21 @@ EOF
fi
fi

CLAMD_AUTO_DISABLE_CONF=/etc/rspamd/override.d/antivirus.conf
if [[ "${SKIP_CLAMD}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
# Only auto-disable when antivirus.conf still points to the default local Mailcow
# ClamAV target. This avoids breaking custom external ClamAV setups.
if grep -Eq '^[[:space:]]*servers[[:space:]]*=[[:space:]]*"clamd:3310";' /etc/rspamd/local.d/antivirus.conf 2>/dev/null; then
cat <<EOF > "${CLAMD_AUTO_DISABLE_CONF}"
clamav {
enabled = false;
}
EOF
fi
else
rm -f "${CLAMD_AUTO_DISABLE_CONF}"
fi

# Provide additional lua modules
ln -s /usr/lib/$(uname -m)-linux-gnu/liblua5.1-cjson.so.0.0.0 /usr/lib/rspamd/cjson.so

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ services:
- REDIS_SLAVEOF_PORT=${REDIS_SLAVEOF_PORT:-}
- REDISPASS=${REDISPASS}
- SPAMHAUS_DQS_KEY=${SPAMHAUS_DQS_KEY:-}
- SKIP_CLAMD=${SKIP_CLAMD:-n}
volumes:
- ./data/hooks/rspamd:/hooks:Z
- ./data/conf/rspamd/custom/:/etc/rspamd/custom:z
Expand Down
2 changes: 1 addition & 1 deletion generate_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ SKIP_HTTP_VERIFICATION=n
# Skip Unbound (DNS Resolver) Healthchecks (NOT Recommended!) - y/n
SKIP_UNBOUND_HEALTHCHECK=n

# Skip ClamAV (clamd-mailcow) anti-virus (Rspamd will auto-detect a missing ClamAV container) - y/n
# Skip ClamAV (clamd-mailcow) anti-virus - y/n
SKIP_CLAMD=${SKIP_CLAMD}

# Skip Olefy (olefy-mailcow) anti-virus for Office documents (Rspamd will auto-detect a missing Olefy container) - y/n
Expand Down