introduce variable to control Amavis' loglevel (#1947)
This commit is contained in:
parent
ba37ed115d
commit
04e98dc49f
|
@ -2,9 +2,8 @@
|
||||||
|
|
||||||
## Variables
|
## Variables
|
||||||
|
|
||||||
1. If an option doesn't work as documented here, check if you are running the latest image!
|
1. Values in **bold** are the default values.
|
||||||
2. Values in **bold** are the default values.
|
2. If an option doesn't work as documented here, check if you are running the latest image. The current `master` branch corresponds to the image `mailserver/docker-mailserver:edge`.
|
||||||
3. Since `docker-mailserver v7.1.0`, comparisons for environment variables are executed differently. If you previously used `VARIABLE=''` as the `empty` value, **update** to now use `VARIABLE=`.
|
|
||||||
|
|
||||||
### Assignments
|
### Assignments
|
||||||
|
|
||||||
|
@ -34,6 +33,15 @@ Amavis content filter (used for ClamAV & SpamAssassin)
|
||||||
- 0 => Amavis is disabled
|
- 0 => Amavis is disabled
|
||||||
- **1** => Amavis is enabled
|
- **1** => Amavis is enabled
|
||||||
|
|
||||||
|
##### AMAVIS_LOGLEVEL
|
||||||
|
|
||||||
|
[This page](https://lists.amavis.org/pipermail/amavis-users/2011-March/000158.html) provides information on Amavis' logging statistics.
|
||||||
|
|
||||||
|
- -1/-2/-3 => Only show errors
|
||||||
|
- **0** => Show warnings
|
||||||
|
- 1/2 => Show default informational output
|
||||||
|
- 3/4/5 => log debug information (very verbose)
|
||||||
|
|
||||||
##### ENABLE_CLAMAV
|
##### ENABLE_CLAMAV
|
||||||
|
|
||||||
- **0** => Clamav is disabled
|
- **0** => Clamav is disabled
|
||||||
|
|
|
@ -22,8 +22,6 @@ The contents could look like this
|
||||||
``` sh
|
``` sh
|
||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
sed -i -E 's|(log_level).*|\1 = -1;|g' /etc/amavis/conf.d/49-docker-mailserver
|
|
||||||
|
|
||||||
cat >/etc/amavis/conf.d/50-user << "END"
|
cat >/etc/amavis/conf.d/50-user << "END"
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,12 @@ ENABLE_CLAMAV=0
|
||||||
# 1 => Enabled
|
# 1 => Enabled
|
||||||
ENABLE_AMAVIS=1
|
ENABLE_AMAVIS=1
|
||||||
|
|
||||||
|
# -1/-2/-3 => Only show errors
|
||||||
|
# **0** => Show warnings
|
||||||
|
# 1/2 => Show default informational output
|
||||||
|
# 3/4/5 => log debug information (very verbose)
|
||||||
|
AMAVIS_LOGLEVEL=0
|
||||||
|
|
||||||
# If you enable Fail2Ban, don't forget to add the following lines to your `docker-compose.yml`:
|
# If you enable Fail2Ban, don't forget to add the following lines to your `docker-compose.yml`:
|
||||||
# cap_add:
|
# cap_add:
|
||||||
# - NET_ADMIN
|
# - NET_ADMIN
|
||||||
|
|
|
@ -16,6 +16,7 @@ declare -a FUNCS_SETUP FUNCS_FIX FUNCS_CHECK FUNCS_MISC DAEMONS_START
|
||||||
# ? >> Setup of default and global values / variables
|
# ? >> Setup of default and global values / variables
|
||||||
# ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
|
# ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
|
||||||
|
|
||||||
|
VARS[AMAVIS_LOGLEVEL]="${AMAVIS_LOGLEVEL:=0}"
|
||||||
VARS[DEFAULT_RELAY_HOST]="${DEFAULT_RELAY_HOST:=}"
|
VARS[DEFAULT_RELAY_HOST]="${DEFAULT_RELAY_HOST:=}"
|
||||||
VARS[DMS_DEBUG]="${DMS_DEBUG:=0}"
|
VARS[DMS_DEBUG]="${DMS_DEBUG:=0}"
|
||||||
VARS[DOVECOT_MAILBOX_FORMAT]="${DOVECOT_MAILBOX_FORMAT:=maildir}"
|
VARS[DOVECOT_MAILBOX_FORMAT]="${DOVECOT_MAILBOX_FORMAT:=maildir}"
|
||||||
|
|
|
@ -1501,6 +1501,10 @@ function _setup_security_stack
|
||||||
then
|
then
|
||||||
cp /tmp/docker-mailserver/amavis.cf /etc/amavis/conf.d/50-user
|
cp /tmp/docker-mailserver/amavis.cf /etc/amavis/conf.d/50-user
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sed -i -E \
|
||||||
|
"s|(log_level).*|\1 = ${AMAVIS_LOGLEVEL};|g" \
|
||||||
|
/etc/amavis/conf.d/49-docker-mailserver
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ setup_file() {
|
||||||
-e ENABLE_CLAMAV=0 \
|
-e ENABLE_CLAMAV=0 \
|
||||||
-e ENABLE_SPAMASSASSIN=0 \
|
-e ENABLE_SPAMASSASSIN=0 \
|
||||||
-e DMS_DEBUG=0 \
|
-e DMS_DEBUG=0 \
|
||||||
|
-e AMAVIS_LOGLEVEL=2 \
|
||||||
-h mail.my-domain.com -t "${NAME}"
|
-h mail.my-domain.com -t "${NAME}"
|
||||||
# TODO: find a better way to know when we have waited long enough
|
# TODO: find a better way to know when we have waited long enough
|
||||||
# for clamav to should have come up, if it were enabled
|
# for clamav to should have come up, if it were enabled
|
||||||
|
|
|
@ -25,6 +25,7 @@ setup_file() {
|
||||||
-e SA_TAG=-5.0 \
|
-e SA_TAG=-5.0 \
|
||||||
-e SA_TAG2=2.0 \
|
-e SA_TAG2=2.0 \
|
||||||
-e SA_KILL=3.0 \
|
-e SA_KILL=3.0 \
|
||||||
|
-e AMAVIS_LOGLEVEL=2 \
|
||||||
-e SA_SPAM_SUBJECT="SPAM: " \
|
-e SA_SPAM_SUBJECT="SPAM: " \
|
||||||
-e VIRUSMAILS_DELETE_DELAY=7 \
|
-e VIRUSMAILS_DELETE_DELAY=7 \
|
||||||
-e ENABLE_SRS=1 \
|
-e ENABLE_SRS=1 \
|
||||||
|
|
Loading…
Reference in New Issue