Skip to content

Commit

Permalink
add black white lists to rspadm
Browse files Browse the repository at this point in the history
  • Loading branch information
TopTuK committed Jun 26, 2022
1 parent 35645e0 commit b6b44f1
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 31 deletions.
6 changes: 3 additions & 3 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MYSQL_DATABASE=mailserver
MYSQL_USER=mailserver
MYSQL_PASSWORD=changeme1
MYSQL_ROOT_PASSWORD=changeme2
MYSQL_PASSWORD=changeme
MYSQL_ROOT_PASSWORD=changeme
MAILNAME=mail.pmi.moscow
[email protected]
RELAYHOST=
Expand All @@ -13,7 +13,7 @@ FILTER_VIRUS=true
ENABLE_IMAP=true
ENABLE_POP3=true
ENABLE_FTS=true
CONTROLLER_PASSWORD=changeme3
CONTROLLER_PASSWORD=changeme
WAITSTART_TIMEOUT=2m
RECIPIENT_DELIMITER=-
FTS_ARGS="partial=3 full=20 verbose=0 lowmemory=256"
Expand Down
6 changes: 3 additions & 3 deletions .vscode/targets.log
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ make all --print-data-base --no-builtin-variables --no-builtin-rules --question

# This program built for i386-apple-darwin11.3.0

# Make data base, printed on Sat Jun 25 19:29:37 2022
# Make data base, printed on Sun Jun 26 20:00:19 2022

# Variables

Expand Down Expand Up @@ -38,7 +38,7 @@ VSCODE_VERBOSE_LOGGING = true
# environment
__CFBundleIdentifier = com.microsoft.VSCode
# environment
VSCODE_IPC_HOOK_EXTHOST = /var/folders/px/8ppbyb4x0v79nw_flv_vq3q00000gn/T/vscode-ipc-52fa3233-c4f0-45e1-890b-5386583a1fbf.sock
VSCODE_IPC_HOOK_EXTHOST = /var/folders/px/8ppbyb4x0v79nw_flv_vq3q00000gn/T/vscode-ipc-76709393-fdad-4518-9af8-450855c5d89c.sock
# environment
VSCODE_CWD = /
# environment
Expand Down Expand Up @@ -344,6 +344,6 @@ lint: lint-dockerfile lint-yaml
# strcache size: total = 4096 / max = 4096 / min = 4096 / avg = 4096
# strcache free: total = 4087 / max = 4087 / min = 4087 / avg = 4087

# Finished Make data base on Sat Jun 25 19:29:37 2022
# Finished Make data base on Sun Jun 26 20:00:19 2022


33 changes: 16 additions & 17 deletions filter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,29 @@ RUN apk --no-cache add \
/etc/rspamd/override.d/redis.conf \
/etc/rspamd/local.d/worker-controller.inc && \
touch \
/etc/rspamd/local.d/maps.d/local_bl_domain.inc \
/etc/rspamd/local.d/maps.d/local_bl_from.inc \
/etc/rspamd/local.d/maps.d/local_bl_ip.inc \
/etc/rspamd/local.d/maps.d/local_bl_rcpt.inc \
/etc/rspamd/local.d/maps.d/local_wl_domain.inc \
/etc/rspamd/local.d/maps.d/local_wl_from.inc \
/etc/rspamd/local.d/maps.d/local_wl_ip.inc \
/etc/rspamd/local.d/maps.d/local_wl_rcpt.inc && \
/etc/rspamd/local.d/local_bl_domain.inc \
/etc/rspamd/local.d/local_bl_from.inc \
/etc/rspamd/local.d/local_bl_ip.inc \
/etc/rspamd/local.d/local_bl_rcpt.inc \
/etc/rspamd/local.d/local_wl_domain.inc \
/etc/rspamd/local.d/local_wl_from.inc \
/etc/rspamd/local.d/local_wl_ip.inc \
/etc/rspamd/local.d/local_wl_rcpt.inc && \
chown -R rspamd \
/run/rspamd \
/var/lib/rspamd \
/etc/rspamd/local.d/antivirus.conf \
/etc/rspamd/local.d/classifier-bayes.conf \
/etc/rspamd/override.d/redis.conf \
/etc/rspamd/local.d/worker-controller.inc \
/etc/rspamd/local.d/maps.d \
/etc/rspamd/local.d/maps.d/local_bl_domain.inc \
/etc/rspamd/local.d/maps.d/local_bl_from.inc \
/etc/rspamd/local.d/maps.d/local_bl_ip.inc \
/etc/rspamd/local.d/maps.d/local_bl_rcpt.inc \
/etc/rspamd/local.d/maps.d/local_wl_domain.inc \
/etc/rspamd/local.d/maps.d/local_wl_from.inc \
/etc/rspamd/local.d/maps.d/local_wl_ip.inc \
/etc/rspamd/local.d/maps.d/local_wl_rcpt.inc && \
/etc/rspamd/local.d/local_bl_domain.inc \
/etc/rspamd/local.d/local_bl_from.inc \
/etc/rspamd/local.d/local_bl_ip.inc \
/etc/rspamd/local.d/local_bl_rcpt.inc \
/etc/rspamd/local.d/local_wl_domain.inc \
/etc/rspamd/local.d/local_wl_from.inc \
/etc/rspamd/local.d/local_wl_ip.inc \
/etc/rspamd/local.d/local_wl_rcpt.inc && \
apk --no-cache del \
openssl

Expand Down
16 changes: 8 additions & 8 deletions filter/rootfs/etc/rspamd/local.d/multimap.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
local_bl_domain {
type = "from";
filter = "email:domain";
map = "$CONFDIR/local.d/maps.d/local_bl_domain.inc";
map = "$CONFDIR/local.d/local_bl_domain.inc";
prefilter = true;
action = "reject";
description = "Blacklisted domain";
}
local_bl_from {
type = "from";
map = "$CONFDIR/local.d/maps.d/local_bl_from.inc";
map = "$CONFDIR/local.d/local_bl_from.inc";
symbol = "LOCAL_BL_FROM";
description = "Blacklist map for LOCAL_BL_FROM";
}
local_bl_ip {
type = "ip";
map = "$CONFDIR/local.d/maps.d/local_bl_ip.inc";
map = "$CONFDIR/local.d/local_bl_ip.inc";
symbol = "LOCAL_BL_IP";
description = "Blacklist map for LOCAL_BL_IP";
}
local_bl_rcpt {
type = "rcpt";
map = "$CONFDIR/local.d/maps.d/local_bl_rcpt.inc";
map = "$CONFDIR/local.d/local_bl_rcpt.inc";
symbol = "LOCAL_BL_RCPT";
description = "Blacklist map for LOCAL_BL_RCPT";
}
Expand All @@ -33,25 +33,25 @@ local_bl_rcpt {
local_wl_domain {
type = "from";
filter = "email:domain:tld";
map = "$CONFDIR/local.d/maps.d/local_wl_domain.inc";
map = "$CONFDIR/local.d/local_wl_domain.inc";
symbol = "LOCAL_WL_DOMAIN";
description = "Whitelist map for LOCAL_WL_DOMAIN";
}
local_wl_from {
type = "from";
map = "$CONFDIR/local.d/maps.d/local_wl_from.inc";
map = "$CONFDIR/local.d/local_wl_from.inc";
symbol = "LOCAL_WL_FROM";
description = "Whitelist map for LOCAL_WL_FROM";
}
local_wl_ip {
type = "ip";
map = "$CONFDIR/local.d/maps.d/local_wl_ip.inc";
map = "$CONFDIR/local.d/local_wl_ip.inc";
symbol = "LOCAL_WL_IP";
description = "Whitelist map for LOCAL_WL_IP";
}
local_wl_rcpt {
type = "rcpt";
map = "$CONFDIR/local.d/maps.d/local_wl_rcpt.inc";
map = "$CONFDIR/local.d/local_wl_rcpt.inc";
symbol = "LOCAL_WL_RCPT";
description = "Whitelist map for LOCAL_WL_RCPT";
}
8 changes: 8 additions & 0 deletions filter/rootfs/usr/local/bin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ dockerize \
-template /etc/rspamd/local.d/worker-controller.inc.templ:/etc/rspamd/local.d/worker-controller.inc \
-template /etc/rspamd/override.d/redis.conf.templ:/etc/rspamd/override.d/redis.conf \
-template /etc/rspamd/local.d/classifier-bayes.conf.templ:/etc/rspamd/local.d/classifier-bayes.conf \
-template /etc/rspamd/local.d/local_bl_domain.inc.templ:/etc/rspamd/local.d/local_bl_domain.inc \
-template /etc/rspamd/local.d/local_bl_from.inc.templ:/etc/rspamd/local.d/local_bl_from.inc \
-template /etc/rspamd/local.d/local_bl_ip.inc.templ:/etc/rspamd/local.d/local_bl_ip.inc \
-template /etc/rspamd/local.d/local_bl_rcpt.inc.templ:/etc/rspamd/local.d/local_bl_rcpt.inc \
-template /etc/rspamd/local.d/local_wl_domain.inc.templ:/etc/rspamd/local.d/local_wl_domain.inc \
-template /etc/rspamd/local.d/local_wl_from.inc.templ:/etc/rspamd/local.d/local_wl_from.inc \
-template /etc/rspamd/local.d/local_wl_ip.inc.templ:/etc/rspamd/local.d/local_wl_ip.inc \
-template /etc/rspamd/local.d/local_wl_rcpt.inc.templ:/etc/rspamd/local.d/local_wl_rcpt.inc \
${FILTER_VIRUS_ARGS} \
-timeout ${WAITSTART_TIMEOUT} \
/usr/sbin/rspamd -c /etc/rspamd/rspamd.conf -f

0 comments on commit b6b44f1

Please sign in to comment.