Skip to content
Snippets Groups Projects
Commit bb2ef265 authored by Bob Mottram's avatar Bob Mottram
Browse files

Build email flood defenses

parent a70e52d5
No related branches found
No related tags found
No related merge requests found
......@@ -2023,4 +2023,16 @@ function email_remove_html {
fi
}
function email_flooding_defense {
acl_check_rcpt_file=/etc/exim4/conf.d/acl/30_exim4-config_check_rcpt
if [ ! -f "$acl_check_rcpt_file" ]; then
return
fi
if grep -q '# Flooding defense' "$acl_check_rcpt_file"; then
return
fi
sed -i "/acl_check_rcpt:/a \\\\n # Flooding defense\\n deny\\n ratelimit = 5 / 15m / per_rcpt / strict / \$sender_address\\n log_message = Denied (sender address), sending rate of: \$sender_rate by \$sender_address" "$acl_check_rcpt_file"
systemctl restart exim4
}
# NOTE: deliberately no exit 0
......@@ -154,6 +154,7 @@ if [ -d "$PROJECT_DIR" ]; then
populate_keyservers
disable_email_encryption_at_rest
email_remove_html
email_flooding_defense
if [ -f /var/log/freedns_@_update.log ]; then
rm /var/log/freedns_@_update.log
fi
......
......@@ -1200,6 +1200,9 @@ function setup_email {
function_check email_remove_html
email_remove_html
function_check email_flooding_defense
email_flooding_defense
}
function setup_web {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment