Skip to content

Commit 3dde921

Browse files
committed
Implement exim4 rate limits.
1 parent 1b1b8a1 commit 3dde921

File tree

4 files changed

+56
-2
lines changed

4 files changed

+56
-2
lines changed

install/debian/8/exim/exim4.conf.template

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,20 @@ DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}}
5656
# ACL CONFIGURATION #
5757
# Specifies access control lists for incoming SMTP mail #
5858
######################################################################
59+
60+
acl_not_smtp = acl_not_smtp
61+
5962
begin acl
6063

64+
acl_not_smtp:
65+
deny message = Web site is sending too much emails [limitlog]: deny / account / $authenticated_id / $sender_rate / $sender_rate_period
66+
ratelimit = 40 / 1h / $authenticated_id
67+
68+
warn ratelimit = 0 / 1h / strict / $authenticated_id
69+
log_message = Sender rate [limitlog]: log / account / $authenticated_id / $sender_rate / $sender_rate_period
70+
71+
accept
72+
6173
acl_check_spammers:
6274
accept hosts = +whitelist
6375

@@ -89,6 +101,12 @@ acl_check_mail:
89101
acl_check_rcpt:
90102
accept hosts = :
91103

104+
deny message = Email account is sending too much emails [limitlog]: deny / email / $authenticated_id / $sender_rate / $sender_rate_period
105+
ratelimit = 40 / 1h / $authenticated_id
106+
107+
warn ratelimit = 0 / 1h / strict / $authenticated_id
108+
log_message = Sender rate [limitlog]: log / email / $authenticated_id / $sender_rate / $sender_rate_period
109+
92110
deny message = Restricted characters in address
93111
domains = +local_domains
94112
local_parts = ^[.] : ^.*[@%!/|]

install/ubuntu/14.04/exim/exim4.conf.template

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#SPAMASSASSIN = yes
88
#SPAM_SCORE = 50
9-
#CLAMD = yes
9+
#CLAMD = yes
1010

1111
add_environment = <; PATH=/bin:/usr/bin
1212
keep_environment =
@@ -56,8 +56,20 @@ DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}}
5656
# ACL CONFIGURATION #
5757
# Specifies access control lists for incoming SMTP mail #
5858
######################################################################
59+
60+
acl_not_smtp = acl_not_smtp
61+
5962
begin acl
6063

64+
acl_not_smtp:
65+
deny message = Web site is sending too much emails [limitlog]: deny / account / $authenticated_id / $sender_rate / $sender_rate_period
66+
ratelimit = 40 / 1h / $authenticated_id
67+
68+
warn ratelimit = 0 / 1h / strict / $authenticated_id
69+
log_message = Sender rate [limitlog]: log / account / $authenticated_id / $sender_rate / $sender_rate_period
70+
71+
accept
72+
6173
acl_check_spammers:
6274
accept hosts = +whitelist
6375

install/ubuntu/16.04/exim/exim4.conf.template

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#SPAMASSASSIN = yes
88
#SPAM_SCORE = 50
9-
#CLAMD = yes
9+
#CLAMD = yes
1010

1111
add_environment = <; PATH=/bin:/usr/bin
1212
keep_environment =
@@ -56,8 +56,20 @@ DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}}
5656
# ACL CONFIGURATION #
5757
# Specifies access control lists for incoming SMTP mail #
5858
######################################################################
59+
60+
acl_not_smtp = acl_not_smtp
61+
5962
begin acl
6063

64+
acl_not_smtp:
65+
deny message = Web site is sending too much emails [limitlog]: deny / account / $authenticated_id / $sender_rate / $sender_rate_period
66+
ratelimit = 40 / 1h / $authenticated_id
67+
68+
warn ratelimit = 0 / 1h / strict / $authenticated_id
69+
log_message = Sender rate [limitlog]: log / account / $authenticated_id / $sender_rate / $sender_rate_period
70+
71+
accept
72+
6173
acl_check_spammers:
6274
accept hosts = +whitelist
6375

install/ubuntu/18.04/exim/exim4.conf.template

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,20 @@ DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}}
5656
# ACL CONFIGURATION #
5757
# Specifies access control lists for incoming SMTP mail #
5858
######################################################################
59+
60+
acl_not_smtp = acl_not_smtp
61+
5962
begin acl
6063

64+
acl_not_smtp:
65+
deny message = Web site is sending too much emails [limitlog]: deny / account / $authenticated_id / $sender_rate / $sender_rate_period
66+
ratelimit = 40 / 1h / $authenticated_id
67+
68+
warn ratelimit = 0 / 1h / strict / $authenticated_id
69+
log_message = Sender rate [limitlog]: log / account / $authenticated_id / $sender_rate / $sender_rate_period
70+
71+
accept
72+
6173
acl_check_spammers:
6274
accept hosts = +whitelist
6375

0 commit comments

Comments
 (0)