Skip to content

Commit 4beb29a

Browse files
authored
Exim: Never show HELO for authenticated users (hestiacp#3462)
* Autenticated users never show Helo * Use .patch to update exim * Update upgrade script
1 parent ebe3f40 commit 4beb29a

File tree

5 files changed

+93
-16
lines changed

5 files changed

+93
-16
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,18 @@ acl_check_mail:
119119
deny condition = ${if eq{$sender_helo_name}{}}
120120
message = HELO required before MAIL
121121

122-
drop message = Helo name contains an IP address (HELO was $sender_helo_name) and not is valid
122+
drop !authenticated = *
123+
message = Helo name contains an IP address (HELO was $sender_helo_name) and not is valid
123124
condition = ${if match{$sender_helo_name}{\N((\d{1,3}[.-]\d{1,3}[.-]\d{1,3}[.-]\d{1,3})|([0-9a-f]{8})|([0-9A-F]{8}))\N}{yes}{no}}
124125
condition = ${if match {${lookup dnsdb{>: defer_never,ptr=$sender_host_address}}\}{$sender_helo_name}{no}{yes}}
125126
delay = 45s
126127

127-
drop condition = ${if isip{$sender_helo_name}}
128+
drop !authenticated = *
129+
condition = ${if isip{$sender_helo_name}}
128130
message = Access denied - Invalid HELO name (See RFC2821 4.1.3)
129131

130-
drop condition = ${if eq{[$interface_address]}{$sender_helo_name}}
132+
drop !authenticated = *
133+
condition = ${if eq{[$interface_address]}{$sender_helo_name}}
131134
message = $interface_address is _my_ address
132135

133136
accept

install/deb/exim/exim4.conf.template

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,22 @@ acl_check_spammers:
116116

117117

118118
acl_check_mail:
119-
deny condition = ${if eq{$sender_helo_name}{}}
120-
message = HELO required before MAIL
121-
122-
drop message = Helo name contains an IP address (HELO was $sender_helo_name) and not is valid
123-
condition = ${if match{$sender_helo_name}{\N((\d{1,3}[.-]\d{1,3}[.-]\d{1,3}[.-]\d{1,3})|([0-9a-f]{8})|([0-9A-F]{8}))\N}{yes}{no}}
124-
condition = ${if match {${lookup dnsdb{>: defer_never,ptr=$sender_host_address}}\}{$sender_helo_name}{no}{yes}}
125-
delay = 45s
126-
127-
drop condition = ${if isip{$sender_helo_name}}
128-
message = Access denied - Invalid HELO name (See RFC2821 4.1.3)
129-
130-
drop condition = ${if eq{[$interface_address]}{$sender_helo_name}}
131-
message = $interface_address is _my_ address
119+
deny condition = ${if eq{$sender_helo_name}{}}
120+
message = HELO required before MAIL
121+
122+
drop !authenticated = *
123+
message = Helo name contains an IP address (HELO was $sender_helo_name) and not is valid
124+
condition = ${if match{$sender_helo_name}{\N((\d{1,3}[.-]\d{1,3}[.-]\d{1,3}[.-]\d{1,3})|([0-9a-f]{8})|([0-9A-F]{8}))\N}{yes}{no}}
125+
condition = ${if match {${lookup dnsdb{>: defer_never,ptr=$sender_host_address}}\}{$sender_helo_name}{no}{yes}}
126+
delay = 45s
127+
128+
drop !authenticated = *
129+
condition = ${if isip{$sender_helo_name}}
130+
message = Access denied - Invalid HELO name (See RFC2821 4.1.3)
131+
132+
drop !authenticated = *
133+
condition = ${if eq{[$interface_address]}{$sender_helo_name}}
134+
message = $interface_address is _my_ address
132135

133136
accept
134137

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
36c36
2+
122c122,123
3+
< drop message = Helo name contains an IP address (HELO was $sender_helo_name) and not is valid
4+
---
5+
> drop !authenticated = *
6+
> message = Helo name contains an IP address (HELO was $sender_helo_name) and not is valid
7+
127c128,129
8+
< drop condition = ${if isip{$sender_helo_name}}
9+
---
10+
> drop !authenticated = *
11+
> condition = ${if isip{$sender_helo_name}}
12+
130c132,133
13+
< drop condition = ${if eq{[$interface_address]}{$sender_helo_name}}
14+
---
15+
> drop !authenticated = *
16+
> condition = ${if eq{[$interface_address]}{$sender_helo_name}}
17+
>
18+
>

install/upgrade/versions/1.7.2.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# Hestia Control Panel upgrade script for target version 1.7.2
4+
5+
#######################################################################################
6+
####### Place additional commands below. #######
7+
#######################################################################################
8+
####### upgrade_config_set_value only accepts true or false. #######
9+
####### #######
10+
####### Pass through information to the end user in case of a issue or problem #######
11+
####### #######
12+
####### Use add_upgrade_message "My message here" to include a message #######
13+
####### in the upgrade notification email. Example: #######
14+
####### #######
15+
####### add_upgrade_message "My message here" #######
16+
####### #######
17+
####### You can use \n within the string to create new lines. #######
18+
#######################################################################################
19+
20+
upgrade_config_set_value 'UPGRADE_UPDATE_WEB_TEMPLATES' 'false'
21+
upgrade_config_set_value 'UPGRADE_UPDATE_DNS_TEMPLATES' 'false'
22+
upgrade_config_set_value 'UPGRADE_UPDATE_MAIL_TEMPLATES' 'false'
23+
upgrade_config_set_value 'UPGRADE_REBUILD_USERS' 'false'
24+
upgrade_config_set_value 'UPGRADE_UPDATE_FILEMANAGER_CONFIG' 'false'

install/upgrade/versions/1.7.3.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
# Hestia Control Panel upgrade script for target version 1.7.3
4+
5+
#######################################################################################
6+
####### Place additional commands below. #######
7+
#######################################################################################
8+
####### upgrade_config_set_value only accepts true or false. #######
9+
####### #######
10+
####### Pass through information to the end user in case of a issue or problem #######
11+
####### #######
12+
####### Use add_upgrade_message "My message here" to include a message #######
13+
####### in the upgrade notification email. Example: #######
14+
####### #######
15+
####### add_upgrade_message "My message here" #######
16+
####### #######
17+
####### You can use \n within the string to create new lines. #######
18+
#######################################################################################
19+
20+
upgrade_config_set_value 'UPGRADE_UPDATE_WEB_TEMPLATES' 'false'
21+
upgrade_config_set_value 'UPGRADE_UPDATE_DNS_TEMPLATES' 'false'
22+
upgrade_config_set_value 'UPGRADE_UPDATE_MAIL_TEMPLATES' 'false'
23+
upgrade_config_set_value 'UPGRADE_REBUILD_USERS' 'false'
24+
upgrade_config_set_value 'UPGRADE_UPDATE_FILEMANAGER_CONFIG' 'false'
25+
26+
if grep -q 'drop message = Helo name contains an IP address (HELO was $sender_helo_name) and not is valid' /etc/exim4/exim4.conf.template; then
27+
echo "[ * ] Update exim4.conf.template ..."
28+
patch /etc/exim4/exim4.conf.template $HESTIA/install/upgrade/patch/3462-exim-helo-autenticted-users.patch
29+
fi

0 commit comments

Comments
 (0)