Skip to content

Commit d4ce68f

Browse files
authored
Merge pull request #280 from erik73/logging
Add log settings to config
2 parents 4ebffb3 + 1894416 commit d4ce68f

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

mailfilter/config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ map:
1919
options:
2020
enable_antivirus: false
2121
enable_dkim_signing: false
22+
log_level: warning
2223
schema:
2324
enable_antivirus: bool
2425
enable_dkim_signing: bool
26+
log_level: list(debug|silent|info|notice|warning|error)?

mailfilter/rootfs/etc/cont-init.d/10-create_config.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ rspamdpw="$(date | md5sum)"
4040
encryptedpw="$(rspamadm pw --encrypt -p ${rspamdpw})"
4141
encryptedenpw="$(rspamadm pw --encrypt -p ${rspamdpw})"
4242
myip="$(ip route get 1 | awk '{print $NF;exit}')"
43+
loglevel=$(bashio::config 'log_level')
4344
sed -i "4 s/password = /password = "${encryptedpw}";/g" /etc/rspamd/local.d/worker-controller.inc
4445
sed -i "5 s/enable_password = /enable_password = "${encryptedenpw}";/g" /etc/rspamd/local.d/worker-controller.inc
4546
sed -i '2 s/^bind.*$/bind_socket = "'${myip}:11332'";/g' /etc/rspamd/local.d/worker-proxy.inc
47+
sed -i '17 s/level = /level = "'${loglevel}'";/g' /etc/rspamd/local.d/logging.inc
4648

4749
#Remove antivirus service files if disabled
4850
if bashio::config.false "enable_antivirus"; then

mailfilter/rootfs/etc/rspamd/local.d/logging.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Relevant documentation: https://rspamd.com/doc/configuration/logging.html
1515
type= "syslog";
1616
facility "mail";
17-
level = "warning";
17+
level =
1818
log_format =<<EOD
1919
id: <$mid>,$if_qid{ qid: <$>,}$if_ip{ ip: $,}$if_user{ user: $,}$if_smtp_from{ from: <$>,}
2020
(default: $is_spam ($action): [$scores] [$symbols_scores_params]),

0 commit comments

Comments
 (0)