Skip to content

Commit e00ed17

Browse files
committed
Merge pull request hestiacp#1 from serghey-rodin/master
update with master
2 parents 76a56e3 + 6cd65c5 commit e00ed17

File tree

14 files changed

+1668
-206
lines changed

14 files changed

+1668
-206
lines changed

bin/v-add-user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
2828
is_user_free() {
2929
check_sysuser=$(cut -f 1 -d : /etc/passwd | grep -w "$user" )
3030
if [ ! -z "$check_sysuser" ] || [ -e "$USER_DATA" ]; then
31-
echo "Error: user $user exist"
31+
echo "Error: user $user exists"
3232
log_event "$E_EXISTS" "$EVENT"
3333
exit $E_EXISTS
3434
fi

func/domain.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,9 @@ is_web_domain_cert_valid() {
327327
fi
328328

329329
if [ -e "$ssl_dir/$domain.ca" ]; then
330-
ca_vrf=$(openssl verify $ssl_dir/$domain.ca 2>/dev/null |grep 'OK')
331-
if [ -z "$ca_vrf" ]; then
332-
echo "Error: ssl certificate authority is not valid"
333-
log_event "$E_INVALID" "$EVENT"
334-
exit $E_INVALID
335-
fi
336-
337-
crt_vrf=$(openssl verify -untrusted $ssl_dir/$domain.ca \
338-
$ssl_dir/$domain.crt 2>/dev/null |grep 'OK')
330+
crt_vrf=$(openssl verify -purpose sslserver \
331+
-CAfile $ssl_dir/$domain.ca $ssl_dir/$domain.crt 2>/dev/null |\
332+
grep 'OK')
339333
if [ -z "$crt_vrf" ]; then
340334
echo "Error: root or/and intermediate cerificate not found"
341335
log_event "$E_NOTEXIST" "$EVENT"

install/debian/exim4.conf.template

Lines changed: 80 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
##########################################################################
1+
######################################################################
2+
# #
3+
# Exim configuration file for Vesta Control Panel #
4+
# #
5+
######################################################################
6+
27
#SPAMASSASSIN = yes
3-
SPAM_SCORE = 50
4-
CLAMD = yes
5-
##########################################################################
8+
#SPAM_SCORE = 50
9+
#CLAMD = yes
610

711
domainlist local_domains = dsearch;/etc/exim4/domains/
812
domainlist relay_to_domains = dsearch;/etc/exim4/domains/
9-
hostlist relay_from_hosts = 127.0.0.1
10-
hostlist whitelist = net-iplsearch;/etc/exim4/white-blocks.conf
11-
hostlist spammers = net-iplsearch;/etc/exim4/spam-blocks.conf
13+
hostlist relay_from_hosts = 127.0.0.1
14+
hostlist whitelist = net-iplsearch;/etc/exim4/white-blocks.conf
15+
hostlist spammers = net-iplsearch;/etc/exim4/spam-blocks.conf
1216
no_local_from_check
1317
untrusted_set_sender = *
1418
acl_smtp_connect = acl_check_spammers
@@ -43,43 +47,38 @@ DKIM_FILE = /etc/exim4/domains/${lc:${domain:$h_from:}}/dkim.pem
4347
DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}}
4448

4549

46-
##########################################################################
50+
51+
######################################################################
52+
# ACL CONFIGURATION #
53+
# Specifies access control lists for incoming SMTP mail #
54+
######################################################################
4755
begin acl
48-
##########################################################################
56+
4957
acl_check_spammers:
50-
accept hosts = +whitelist
58+
accept hosts = +whitelist
59+
5160
drop message = Your host in blacklist on this server.
5261
log_message = Host in blacklist
5362
hosts = +spammers
54-
deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\\n$dnslist_text
55-
dnslists = ${readfile {/etc/exim4/dnsbl.conf}{:}}
63+
5664
accept
5765

66+
5867
acl_check_mail:
59-
deny
60-
condition = ${if eq{$sender_helo_name}{}}
68+
deny condition = ${if eq{$sender_helo_name}{}}
6169
message = HELO required before MAIL
62-
# drop
63-
# condition = ${if isip{$sender_helo_name}}
64-
# message = Access denied - Invalid HELO name (See RFC2821 4.1.3)
70+
6571
drop message = Helo name contains a ip address (HELO was $sender_helo_name) and not is valid
6672
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}}
6773
condition = ${if match {${lookup dnsdb{>: defer_never,ptr=$sender_host_address}}\}{$sender_helo_name}{no}{yes}}
6874
delay = 45s
69-
# drop
70-
# condition = ${if match{$sender_helo_name}{\N^\[\N}{no}{yes}}
71-
# condition = ${if match{$sender_helo_name}{\N\.\N}{no}{yes}}
72-
# message = Access denied - Invalid HELO name (See RFC2821 4.1.1.1)
73-
drop
74-
condition = ${if isip{$sender_helo_name}}
75+
76+
drop condition = ${if isip{$sender_helo_name}}
7577
message = Access denied - Invalid HELO name (See RFC2821 4.1.3)
76-
# drop
77-
# condition = ${if match{$sender_helo_name}{\N\.$\N}}
78-
# message = Access denied - Invalid HELO name (See RFC2821 4.1.1.1)
79-
# drop message = "REJECTED - Bad HELO - Host impersonating [$sender_helo_name]"
80-
# condition = ${if match{$sender_helo_name}{$primary_hostname}}
78+
8179
drop condition = ${if eq{[$interface_address]}{$sender_helo_name}}
8280
message = $interface_address is _my_ address
81+
8382
accept
8483

8584

@@ -102,6 +101,10 @@ acl_check_rcpt:
102101
accept authenticated = *
103102
control = submission/domain=
104103

104+
deny message = Rejected because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text
105+
hosts = !+whitelist
106+
dnslists = ${readfile {/etc/exim4/dnsbl.conf}{:}}
107+
105108
require message = relay not permitted
106109
domains = +local_domains : +relay_to_domains
107110

@@ -113,27 +116,30 @@ acl_check_rcpt:
113116

114117
.ifdef CLAMD
115118
warn set acl_m0 = no
119+
116120
warn condition = ${if exists {/etc/exim4/domains/$domain/antivirus}{yes}{no}}
117121
set acl_m0 = yes
118122
.endif
123+
119124
.ifdef SPAMASSASSIN
120125
warn set acl_m1 = no
126+
121127
warn condition = ${if exists {/etc/exim4/domains/$domain/antispam}{yes}{no}}
122128
set acl_m1 = yes
123129
.endif
130+
124131
accept
125132

126133

127134
acl_check_data:
128135
.ifdef CLAMD
129-
deny message = Message contains a virus ($malware_name) and has been rejected
136+
deny message = Message contains a virus ($malware_name) and has been rejected
130137
malware = *
131138
condition = ${if eq{$acl_m0}{yes}{yes}{no}}
132139
.endif
133140

134141
.ifdef SPAMASSASSIN
135-
warn
136-
!authenticated = *
142+
warn !authenticated = *
137143
hosts = !+relay_from_hosts
138144
condition = ${if < {$message_size}{100K}}
139145
condition = ${if eq{$acl_m1}{yes}{yes}{no}}
@@ -142,23 +148,29 @@ acl_check_data:
142148
add_header = X-Spam-Bar: $spam_bar
143149
add_header = X-Spam-Report: $spam_report
144150
set acl_m2 = $spam_score_int
145-
warn
146-
condition = ${if !eq{$acl_m2}{} {yes}{no}}
151+
152+
warn condition = ${if !eq{$acl_m2}{} {yes}{no}}
147153
condition = ${if >{$acl_m2}{SPAM_SCORE} {yes}{no}}
148154
add_header = X-Spam-Status: Yes
149155
message = SpamAssassin detected spam (from $sender_address to $recipients).
150156
.endif
157+
151158
accept
152159

153160

154161
acl_check_mime:
155-
deny message = Blacklisted file extension detected
156-
condition = ${if match {${lc:$mime_filename}}{\N(\.ade|\.adp|\.bat|\.chm|\.cmd|\.com|\.cpl|\.exe|\.hta|\.ins|\.isp|\.jse|\.lib|\.lnk|\.mde|\.msc|\.msp|\.mst|\.pif|\.scr|\.sct|\.shb|\.sys|\.vb|\.vbe|\.vbs|\.vxd|\.wsc|\.wsf|\.wsh)$\N}{1}{0}}
162+
deny message = Blacklisted file extension detected
163+
condition = ${if match {${lc:$mime_filename}}{\N(\.ade|\.adp|\.bat|\.chm|\.cmd|\.com|\.cpl|\.exe|\.hta|\.ins|\.isp|\.jse|\.lib|\.lnk|\.mde|\.msc|\.msp|\.mst|\.pif|\.scr|\.sct|\.shb|\.sys|\.vb|\.vbe|\.vbs|\.vxd|\.wsc|\.wsf|\.wsh)$\N}{1}{0}}
164+
157165
accept
158166

159-
##########################################################################
167+
168+
169+
######################################################################
170+
# AUTHENTICATION CONFIGURATION #
171+
######################################################################
160172
begin authenticators
161-
##########################################################################
173+
162174
dovecot_plain:
163175
driver = dovecot
164176
public_name = PLAIN
@@ -171,9 +183,14 @@ dovecot_login:
171183
server_socket = /var/run/dovecot/auth-client
172184
server_set_id = $auth1
173185

174-
##########################################################################
186+
187+
188+
######################################################################
189+
# ROUTERS CONFIGURATION #
190+
# Specifies how addresses are handled #
191+
######################################################################
175192
begin routers
176-
##########################################################################
193+
177194
#smarthost:
178195
# driver = manualroute
179196
# domains = ! +local_domains
@@ -253,9 +270,12 @@ terminate_alias:
253270
condition = ${lookup{$local_part@$domain}lsearch{/etc/exim4/domains/$domain/aliases}{true}{false}}
254271

255272

256-
##########################################################################
273+
274+
######################################################################
275+
# TRANSPORTS CONFIGURATION #
276+
######################################################################
257277
begin transports
258-
##########################################################################
278+
259279
remote_smtp:
260280
driver = smtp
261281
#helo_data = $sender_address_domain
@@ -265,7 +285,6 @@ remote_smtp:
265285
dkim_canon = relaxed
266286
dkim_strict = 0
267287

268-
269288
procmail:
270289
driver = pipe
271290
command = "/usr/bin/procmail -d $local_part"
@@ -306,7 +325,7 @@ local_spam_delivery:
306325
delivery_date_add
307326
envelope_to_add
308327
return_path_add
309-
directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/$domain/$local_part/.spam"
328+
directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/$domain/$local_part/.Spam"
310329
quota = ${extract{6}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}M
311330
quota_directory = "${extract{5}{:}{${lookup{$local_part}lsearch{/etc/exim4/domains/$domain/passwd}}}}/mail/$domain/$local_part"
312331
quota_warn_threshold = 75%
@@ -335,8 +354,24 @@ devnull:
335354
driver = appendfile
336355
file = /dev/null
337356

338-
##########################################################################
357+
358+
359+
######################################################################
360+
# RETRY CONFIGURATION #
361+
######################################################################
339362
begin retry
363+
364+
# Address or Domain Error Retries
365+
# ----------------- ----- -------
340366
* * F,2h,15m; G,16h,1h,1.5; F,4d,6h
341-
##########################################################################
367+
368+
369+
370+
######################################################################
371+
# REWRITE CONFIGURATION #
372+
######################################################################
342373
begin rewrite
374+
375+
376+
377+
######################################################################

0 commit comments

Comments
 (0)