Skip to content

Commit 888c8af

Browse files
committed
Small update to exim ratelimit.
1 parent 6381564 commit 888c8af

File tree

4 files changed

+54
-46
lines changed

4 files changed

+54
-46
lines changed

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

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

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

11-
disable_ipv6=true
12-
add_environment=<; PATH=/bin:/usr/bin
13-
keep_environment=
11+
add_environment = <; PATH=/bin:/usr/bin
12+
keep_environment =
13+
disable_ipv6 = true
1414

1515
domainlist local_domains = dsearch;/etc/exim4/domains/
1616
domainlist relay_to_domains = dsearch;/etc/exim4/domains/
@@ -61,12 +61,13 @@ acl_not_smtp = acl_not_smtp
6161

6262
begin acl
6363

64+
# Limit per user for PHP scripts
6465
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
66+
deny message = Website of user $authenticated_id is sending too many emails - rate overlimit = $sender_rate / $sender_rate_period
67+
ratelimit = 100 / 1h / $authenticated_id
6768

68-
warn ratelimit = 0 / 1h / strict / $authenticated_id
69-
log_message = Sender rate [limitlog]: log / account / $authenticated_id / $sender_rate / $sender_rate_period
69+
warn ratelimit = 0 / 1h / strict / $authenticated_id
70+
log_message = Sender rate [limitlog]: log / account / $authenticated_id / $sender_rate / $sender_rate_period
7071

7172
accept
7273

@@ -101,11 +102,12 @@ acl_check_mail:
101102
acl_check_rcpt:
102103
accept hosts = :
103104

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
105+
# Limit per email account for SMTP auhenticated users
106+
deny message = Email account $authenticated_id is sending too many emails - rate overlimit = $sender_rate / $sender_rate_period
107+
ratelimit = 200 / 1h / $authenticated_id
106108

107-
warn ratelimit = 0 / 1h / strict / $authenticated_id
108-
log_message = Sender rate [limitlog]: log / email / $authenticated_id / $sender_rate / $sender_rate_period
109+
warn ratelimit = 0 / 1h / strict / $authenticated_id
110+
log_message = Sender rate [limitlog]: log / email / $authenticated_id / $sender_rate / $sender_rate_period
109111

110112
deny message = Restricted characters in address
111113
domains = +local_domains
@@ -130,7 +132,7 @@ acl_check_rcpt:
130132
require message = relay not permitted
131133
domains = +local_domains : +relay_to_domains
132134

133-
deny message = smtp auth requried
135+
deny message = smtp auth required
134136
sender_domains = +local_domains
135137
!authenticated = *
136138

@@ -163,9 +165,9 @@ acl_check_data:
163165
.ifdef SPAMASSASSIN
164166
warn !authenticated = *
165167
hosts = !+relay_from_hosts
166-
condition = ${if < {$message_size}{100K}}
168+
condition = ${if < {$message_size}{1024K}}
167169
condition = ${if eq{$acl_m1}{yes}{yes}{no}}
168-
spam = nobody:true/defer_ok
170+
spam = debian-spamd:true/defer_ok
169171
add_header = X-Spam-Score: $spam_score_int
170172
add_header = X-Spam-Bar: $spam_bar
171173
add_header = X-Spam-Report: $spam_report

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

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

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

11-
disable_ipv6=true
12-
add_environment=<; PATH=/bin:/usr/bin
13-
keep_environment=
11+
add_environment = <; PATH=/bin:/usr/bin
12+
keep_environment =
13+
disable_ipv6 = true
1414

1515
domainlist local_domains = dsearch;/etc/exim4/domains/
1616
domainlist relay_to_domains = dsearch;/etc/exim4/domains/
@@ -61,12 +61,13 @@ acl_not_smtp = acl_not_smtp
6161

6262
begin acl
6363

64+
# Limit per user for PHP scripts
6465
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
66+
deny message = Website of user $authenticated_id is sending too many emails - rate overlimit = $sender_rate / $sender_rate_period
67+
ratelimit = 100 / 1h / $authenticated_id
6768

68-
warn ratelimit = 0 / 1h / strict / $authenticated_id
69-
log_message = Sender rate [limitlog]: log / account / $authenticated_id / $sender_rate / $sender_rate_period
69+
warn ratelimit = 0 / 1h / strict / $authenticated_id
70+
log_message = Sender rate [limitlog]: log / account / $authenticated_id / $sender_rate / $sender_rate_period
7071

7172
accept
7273

@@ -101,11 +102,12 @@ acl_check_mail:
101102
acl_check_rcpt:
102103
accept hosts = :
103104

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
105+
# Limit per email account for SMTP auhenticated users
106+
deny message = Email account $authenticated_id is sending too many emails - rate overlimit = $sender_rate / $sender_rate_period
107+
ratelimit = 200 / 1h / $authenticated_id
106108

107-
warn ratelimit = 0 / 1h / strict / $authenticated_id
108-
log_message = Sender rate [limitlog]: log / email / $authenticated_id / $sender_rate / $sender_rate_period
109+
warn ratelimit = 0 / 1h / strict / $authenticated_id
110+
log_message = Sender rate [limitlog]: log / email / $authenticated_id / $sender_rate / $sender_rate_period
109111

110112
deny message = Restricted characters in address
111113
domains = +local_domains
@@ -130,7 +132,7 @@ acl_check_rcpt:
130132
require message = relay not permitted
131133
domains = +local_domains : +relay_to_domains
132134

133-
deny message = smtp auth requried
135+
deny message = smtp auth required
134136
sender_domains = +local_domains
135137
!authenticated = *
136138

@@ -163,9 +165,9 @@ acl_check_data:
163165
.ifdef SPAMASSASSIN
164166
warn !authenticated = *
165167
hosts = !+relay_from_hosts
166-
condition = ${if < {$message_size}{100K}}
168+
condition = ${if < {$message_size}{1024K}}
167169
condition = ${if eq{$acl_m1}{yes}{yes}{no}}
168-
spam = nobody:true/defer_ok
170+
spam = debian-spamd:true/defer_ok
169171
add_header = X-Spam-Score: $spam_score_int
170172
add_header = X-Spam-Bar: $spam_bar
171173
add_header = X-Spam-Report: $spam_report

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ acl_not_smtp = acl_not_smtp
6161

6262
begin acl
6363

64+
# Limit per user for PHP scripts
6465
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
66+
deny message = Website of user $authenticated_id is sending too many emails - rate overlimit = $sender_rate / $sender_rate_period
67+
ratelimit = 100 / 1h / $authenticated_id
6768

68-
warn ratelimit = 0 / 1h / strict / $authenticated_id
69-
log_message = Sender rate [limitlog]: log / account / $authenticated_id / $sender_rate / $sender_rate_period
69+
warn ratelimit = 0 / 1h / strict / $authenticated_id
70+
log_message = Sender rate [limitlog]: log / account / $authenticated_id / $sender_rate / $sender_rate_period
7071

7172
accept
7273

@@ -101,11 +102,12 @@ acl_check_mail:
101102
acl_check_rcpt:
102103
accept hosts = :
103104

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
105+
# Limit per email account for SMTP auhenticated users
106+
deny message = Email account $authenticated_id is sending too many emails - rate overlimit = $sender_rate / $sender_rate_period
107+
ratelimit = 200 / 1h / $authenticated_id
106108

107-
warn ratelimit = 0 / 1h / strict / $authenticated_id
108-
log_message = Sender rate [limitlog]: log / email / $authenticated_id / $sender_rate / $sender_rate_period
109+
warn ratelimit = 0 / 1h / strict / $authenticated_id
110+
log_message = Sender rate [limitlog]: log / email / $authenticated_id / $sender_rate / $sender_rate_period
109111

110112
deny message = Restricted characters in address
111113
domains = +local_domains

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ acl_not_smtp = acl_not_smtp
6161

6262
begin acl
6363

64+
# Limit per user for PHP scripts
6465
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
66+
deny message = Website of user $authenticated_id is sending too many emails - rate overlimit = $sender_rate / $sender_rate_period
67+
ratelimit = 100 / 1h / $authenticated_id
6768

68-
warn ratelimit = 0 / 1h / strict / $authenticated_id
69-
log_message = Sender rate [limitlog]: log / account / $authenticated_id / $sender_rate / $sender_rate_period
69+
warn ratelimit = 0 / 1h / strict / $authenticated_id
70+
log_message = Sender rate [limitlog]: log / account / $authenticated_id / $sender_rate / $sender_rate_period
7071

7172
accept
7273

@@ -101,11 +102,12 @@ acl_check_mail:
101102
acl_check_rcpt:
102103
accept hosts = :
103104

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
105+
# Limit per email account for SMTP auhenticated users
106+
deny message = Email account $authenticated_id is sending too many emails - rate overlimit = $sender_rate / $sender_rate_period
107+
ratelimit = 200 / 1h / $authenticated_id
106108

107-
warn ratelimit = 0 / 1h / strict / $authenticated_id
108-
log_message = Sender rate [limitlog]: log / email / $authenticated_id / $sender_rate / $sender_rate_period
109+
warn ratelimit = 0 / 1h / strict / $authenticated_id
110+
log_message = Sender rate [limitlog]: log / email / $authenticated_id / $sender_rate / $sender_rate_period
109111

110112
deny message = Restricted characters in address
111113
domains = +local_domains

0 commit comments

Comments
 (0)