Skip to content

Commit fbfaa96

Browse files
Fix sending issues due to mail rate implementation. (hestiacp#2676)
* Fix sending issues due to mail rate implementation. Fixes hestiacp#2666 * Adjust if condition. * Add "Message about fix" Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
1 parent 4bea80b commit fbfaa96

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

install/deb/exim/exim4.conf.4.94.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ acl_check_rcpt:
134134

135135
# Limit per email account for SMTP auhenticated users
136136
deny message = Email account $authenticated_id is sending too many emails - rate overlimit = $sender_rate / $sender_rate_period
137-
set acl_c_msg_limit = ${if exists{/etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains/}}/limits} {${extract{1}{:}{${lookup{$sender_address_local_part@$sender_address_domain}lsearch{/etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains/}}/limits}}}}} {${readfile{/etc/exim4/limit.conf}}} }
137+
set acl_c_msg_limit = ${if exists{/etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains/}}/limits} {${extract{1}{:}{${lookup{$authenticated_id}lsearch{/etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains/}}/limits}}}}} {${readfile{/etc/exim4/limit.conf}}} }
138138
ratelimit = $acl_c_msg_limit / 1h / strict/ $authenticated_id
139139

140140
warn ratelimit = ${eval:$acl_c_msg_limit / 2} / 1h / strict / $authenticated_id

install/deb/exim/exim4.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ acl_check_rcpt:
138138

139139
# Limit per email account for SMTP auhenticated users
140140
deny message = Email account $authenticated_id is sending too many emails - rate overlimit = $sender_rate / $sender_rate_period
141-
set acl_c_msg_limit = ${if exists{/etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains/}}/limits} {${extract{1}{:}{${lookup{$sender_address_local_part@$sender_address_domain}lsearch{/etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains/}}/limits}}}}} {${readfile{/etc/exim4/limit.conf}}} }
141+
set acl_c_msg_limit = ${if exists{/etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains/}}/limits} {${extract{1}{:}{${lookup{$authenticated_id}lsearch{/etc/exim4/domains/${lookup{$sender_address_domain}dsearch{/etc/exim4/domains/}}/limits}}}}} {${readfile{/etc/exim4/limit.conf}}} }
142142
ratelimit = $acl_c_msg_limit / 1h / strict/ $authenticated_id
143143

144144
warn ratelimit = ${eval:$acl_c_msg_limit / 2} / 1h / strict / $authenticated_id

install/upgrade/versions/1.6.1.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
# Hestia Control Panel upgrade script for target version 1.6.0
4+
5+
#######################################################################################
6+
####### Place additional commands below. #######
7+
#######################################################################################
8+
####### Pass through information to the end user in case of a issue or problem #######
9+
####### #######
10+
####### Use add_upgrade_message "My message here" to include a message #######
11+
####### in the upgrade notification email. Example: #######
12+
####### #######
13+
####### add_upgrade_message "My message here" #######
14+
####### #######
15+
####### You can use \n within the string to create new lines. #######
16+
#######################################################################################
17+
18+
upgrade_config_set_value 'UPGRADE_UPDATE_WEB_TEMPLATES' 'no'
19+
upgrade_config_set_value 'UPGRADE_UPDATE_DNS_TEMPLATES' 'no'
20+
upgrade_config_set_value 'UPGRADE_UPDATE_MAIL_TEMPLATES' 'no'
21+
upgrade_config_set_value 'UPGRADE_REBUILD_USERS' 'no'
22+
upgrade_config_set_value 'UPGRADE_UPDATE_FILEMANAGER_CONFIG' 'false'
23+
24+
# Fix exim rate limit send issue
25+
if [ "$MAIL_SYSTEM" = "exim4" ]; then
26+
acl=$(cat /etc/exim4/exim4.conf.template | grep '${extract{1}{:}{${lookup{$sender_address_local_part@$sender_address_domain}')
27+
if [ ! -z "$acl" ]; then
28+
echo "[ * ] Fixed an issue with rate limits and alias mail addresses"
29+
sed -i 's/${extract{1}{:}{${lookup{$sender_address_local_part@$sender_address_domain}/${extract{1}{:}{${lookup{$authenticated_id}/' /etc/exim4/exim4.conf.template
30+
fi
31+
fi

0 commit comments

Comments
 (0)