Skip to content

Commit cfa557b

Browse files
authored
Merge branch 'master' into patch-2
2 parents 3b04e34 + 927271a commit cfa557b

File tree

105 files changed

+627
-599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+627
-599
lines changed

bin/v-add-dns-domain

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,8 @@
1515

1616
# Argument definition
1717
user=$1
18-
domain=$(idn -t --quiet -u "$2" )
19-
domain=$(echo $domain | sed -e 's/\.*$//g' -e 's/^\.*//g')
20-
if [[ "$domain" =~ [[:upper:]] ]]; then
21-
domain=$(echo "$domain" |tr '[:upper:]' '[:lower:]')
22-
fi
23-
domain_idn="$domain"
24-
if [[ "$domain" = *[![:ascii:]]* ]]; then
25-
domain_idn=$(idn -t --quiet -a $domain)
26-
fi
18+
domain=$2
19+
domain_idn=$2
2720
ip=$3
2821
ns1=$4
2922
ns2=$5
@@ -40,6 +33,10 @@ source $VESTA/func/main.sh
4033
source $VESTA/func/domain.sh
4134
source $VESTA/conf/vesta.conf
4235

36+
# Additional argument formatting
37+
format_domain
38+
format_domain_idn
39+
4340

4441
#----------------------------------------------------------#
4542
# Verifications #
@@ -56,37 +53,35 @@ template=$(get_user_value '$DNS_TEMPLATE')
5653
is_dns_template_valid $template
5754

5855
if [ ! -z "$ns1" ]; then
59-
ns1=$(echo $4 | sed -e 's/\.*$//g' -e 's/^\.*//g')
56+
ns1=$(echo $4 |sed -e 's/\.*$//g' -e 's/^\.*//g')
6057
is_format_valid 'ns1'
6158
fi
6259
if [ ! -z "$ns2" ]; then
63-
ns2=$(echo $5 | sed -e 's/\.*$//g' -e 's/^\.*//g')
60+
ns2=$(echo $5 |sed -e 's/\.*$//g' -e 's/^\.*//g')
6461
is_format_valid 'ns2'
6562
fi
66-
6763
if [ ! -z "$ns3" ]; then
68-
ns3=$(echo $6 | sed -e 's/\.*$//g' -e 's/^\.*//g')
64+
ns3=$(echo $6 |sed -e 's/\.*$//g' -e 's/^\.*//g')
6965
is_format_valid 'ns3'
7066
fi
7167
if [ ! -z "$ns4" ]; then
72-
ns4=$(echo $7 | sed -e 's/\.*$//g' -e 's/^\.*//g')
68+
ns4=$(echo $7 |sed -e 's/\.*$//g' -e 's/^\.*//g')
7369
is_format_valid 'ns4'
7470
fi
7571
if [ ! -z "$ns5" ]; then
76-
ns5=$(echo $8 | sed -e 's/\.*$//g' -e 's/^\.*//g')
72+
ns5=$(echo $8 |sed -e 's/\.*$//g' -e 's/^\.*//g')
7773
is_format_valid 'ns5'
7874
fi
7975
if [ ! -z "$ns6" ]; then
80-
ns6=$(echo $9 | sed -e 's/\.*$//g' -e 's/^\.*//g')
76+
ns6=$(echo $9 |sed -e 's/\.*$//g' -e 's/^\.*//g')
8177
is_format_valid 'ns6'
8278
fi
8379
if [ ! -z "$ns7" ]; then
84-
ns7=$(echo ${10} | sed -e 's/\.*$//g' -e 's/^\.*//g')
80+
ns7=$(echo ${10} |sed -e 's/\.*$//g' -e 's/^\.*//g')
8581
is_format_valid 'ns7'
8682
fi
87-
8883
if [ ! -z "$ns8" ]; then
89-
ns8=$(echo ${11} | sed -e 's/\.*$//g' -e 's/^\.*//g')
84+
ns8=$(echo ${11} |sed -e 's/\.*$//g' -e 's/^\.*//g')
9085
is_format_valid 'ns8'
9186
fi
9287

@@ -203,10 +198,8 @@ increase_user_value "$user" '$U_DNS_DOMAINS'
203198
increase_user_value "$user" '$U_DNS_RECORDS' "$records"
204199

205200
# Restart named
206-
if [ "$restart" != 'no' ]; then
207-
$BIN/v-restart-dns
208-
check_result $? "DNS restart failed"
209-
fi
201+
$BIN/v-restart-dns $restart
202+
check_result $? "DNS restart failed"
210203

211204
# Logging
212205
log_history "added dns domain $domain"

bin/v-add-dns-record

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ if [ -z "$priority" ]; then
2626
priority=10
2727
fi
2828

29-
domain_idn="$domain"
30-
if [[ "$domain" = *[![:ascii:]]* ]]; then
31-
domain_idn=$(idn -t --quiet -a $domain)
32-
fi
33-
3429
# Includes
3530
source $VESTA/func/main.sh
3631
source $VESTA/func/domain.sh
@@ -55,6 +50,10 @@ if [[ "$dvalue" =~ [\;[:space:]] ]]; then
5550
dvalue='"'"$dvalue"'"'
5651
fi
5752

53+
# Additional argument formatting
54+
format_domain
55+
format_domain_idn
56+
5857

5958
#----------------------------------------------------------#
6059
# Verifications #
@@ -121,10 +120,8 @@ update_object_value 'dns' 'DOMAIN' "$domain" '$RECORDS' "$records"
121120
increase_user_value "$user" '$U_DNS_RECORDS'
122121

123122
# Restart named
124-
if [ "$restart" != 'no' ]; then
125-
$BIN/v-restart-dns
126-
check_result $? $E_RESTART 'dns failed to restart'
127-
fi
123+
$BIN/v-restart-dns $restart
124+
check_result $? $E_RESTART 'dns failed to restart'
128125

129126
# Logging
130127
log_history "added $rtype dns record $record for $domain"

bin/v-add-domain

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,14 @@ if [ ! -z "$MAIL_SYSTEM" ]; then
6464
fi
6565

6666
# Restarting services
67-
if [ "$restart" != 'no' ]; then
68-
$BIN/v-restart-web
69-
check_result $? "can't restart web" > /dev/null
70-
if [ ! -z "$PROXY_SYSTEM" ]; then
71-
$BIN/v-restart-proxy
72-
check_result $? "can't restart proxy" > /dev/null
73-
fi
74-
$BIN/v-restart-dns
75-
check_result $? "can't restart dns" > /dev/null
76-
fi
67+
$BIN/v-restart-web $restart
68+
check_result $? "can't restart web" > /dev/null
69+
70+
$BIN/v-restart-proxy $restart
71+
check_result $? "can't restart proxy" > /dev/null
72+
73+
$BIN/v-restart-dns $restart
74+
check_result $? "can't restart dns" > /dev/null
7775

7876

7977
#----------------------------------------------------------#

bin/v-add-mail-account

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111

1212
# Argument definition
1313
user=$1
14-
domain=$(idn -t --quiet -u "$2" )
15-
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
16-
domain_idn=$(idn -t --quiet -a "$domain")
17-
account=$(echo $3 | tr '[:upper:]' '[:lower:]')
14+
domain=$2
15+
account=$3
1816
password=$4; HIDE=4
1917
quota=${5-unlimited}
2018

@@ -23,6 +21,11 @@ source $VESTA/func/main.sh
2321
source $VESTA/func/domain.sh
2422
source $VESTA/conf/vesta.conf
2523

24+
# Additional argument formatting
25+
if [[ "$account" =~ [[:upper:]] ]]; then
26+
account=$(echo "$account" |tr '[:upper:]' '[:lower:]')
27+
fi
28+
2629

2730
#----------------------------------------------------------#
2831
# Verifications #

bin/v-add-mail-account-alias

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
# Argument definition
1313
user=$1
14-
domain=$(idn -t --quiet -u "$2" )
15-
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
16-
domain_idn=$(idn -t --quiet -a "$domain")
14+
domain=$2
1715
account=$3
1816
malias=$4
1917

@@ -22,6 +20,10 @@ source $VESTA/func/main.sh
2220
source $VESTA/func/domain.sh
2321
source $VESTA/conf/vesta.conf
2422

23+
# Additional argument formatting
24+
format_domain
25+
format_domain_idn
26+
2527

2628
#----------------------------------------------------------#
2729
# Verifications #

bin/v-add-mail-account-autoreply

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
# Argument definition
1313
user=$1
14-
domain=$(idn -t --quiet -u "$2" )
15-
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
16-
domain_idn=$(idn -t --quiet -a "$domain")
14+
domain=$2
1715
account=$3
1816
autoreply=$4
1917

@@ -29,6 +27,10 @@ else
2927
MAIL_USER=exim
3028
fi
3129

30+
# Additional argument formatting
31+
format_domain
32+
format_domain_idn
33+
3234

3335
#----------------------------------------------------------#
3436
# Verifications #

bin/v-add-mail-account-forward

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
# Argument definition
1313
user=$1
14-
domain=$(idn -t --quiet -u "$2" )
15-
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
16-
domain_idn=$(idn -t --quiet -a "$domain")
14+
domain=$2
1715
account=$3
1816
forward=$4
1917

@@ -22,6 +20,10 @@ source $VESTA/func/main.sh
2220
source $VESTA/func/domain.sh
2321
source $VESTA/conf/vesta.conf
2422

23+
# Additional argument formatting
24+
format_domain
25+
format_domain_idn
26+
2527

2628
#----------------------------------------------------------#
2729
# Verifications #

bin/v-add-mail-account-fwd-only

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111

1212
# Argument definition
1313
user=$1
14-
domain=$(idn -t --quiet -u "$2" )
15-
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
16-
domain_idn=$(idn -t --quiet -a "$domain")
14+
domain=$2
1715
account=$3
1816

1917
# Includes
@@ -28,6 +26,10 @@ else
2826
MAIL_USER=exim
2927
fi
3028

29+
# Additional argument formatting
30+
format_domain
31+
format_domain_idn
32+
3133

3234
#----------------------------------------------------------#
3335
# Verifications #

bin/v-add-mail-domain

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,7 @@
1111

1212
# Argument definition
1313
user=$1
14-
domain=$(idn -t --quiet -u "$2" )
15-
domain=$(echo $domain | sed -e 's/\.*$//g' -e 's/^\.*//g')
16-
if [[ "$domain" =~ [[:upper:]] ]]; then
17-
domain=$(echo "$domain" |tr '[:upper:]' '[:lower:]')
18-
fi
19-
domain_idn="$domain"
20-
if [[ "$domain" = *[![:ascii:]]* ]]; then
21-
domain_idn=$(idn -t --quiet -a $domain)
22-
fi
14+
domain=$2
2315
antispam=${3-yes}
2416
antivirus=${4-yes}
2517
dkim=${5-yes}
@@ -37,6 +29,10 @@ else
3729
MAIL_USER=exim
3830
fi
3931

32+
# Additional argument formatting
33+
format_domain
34+
format_domain_idn
35+
4036

4137
#----------------------------------------------------------#
4238
# Verifications #
@@ -126,7 +122,7 @@ if [ ! -z "$DNS_SYSTEM" ] && [ "$dkim" = 'yes' ]; then
126122
$BIN/v-add-dns-record $user $domain $record TXT "$policy" '' '' 'no'
127123

128124
record='mail._domainkey'
129-
selector="\"k=rsa\; p=$p\""
125+
selector="\"v=DKIM1\; k=rsa\; p=$p\""
130126
$BIN/v-add-dns-record $user $domain $record TXT "$selector"
131127
fi
132128
fi

bin/v-add-mail-domain-antispam

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@
1111

1212
# Argument definition
1313
user=$1
14-
domain=$(idn -t --quiet -u "$2" )
15-
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
16-
domain_idn=$(idn -t --quiet -a "$domain")
14+
domain=$2
1715

1816
# Includes
1917
source $VESTA/func/main.sh
2018
source $VESTA/func/domain.sh
2119
source $VESTA/conf/vesta.conf
2220

21+
# Additional argument formatting
22+
format_domain
23+
format_domain_idn
24+
2325

2426
#----------------------------------------------------------#
2527
# Verifications #

0 commit comments

Comments
 (0)