1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-05 15:57:23 +01:00

Merge branch 'jammyjellyfish2204' of https://github.com/mail-in-a-box/mailinabox into jammyjellyfish2204

# Conflicts:
#	CHANGELOG.md
#	README.md
#	conf/nginx-top.conf
#	management/backup.py
#	setup/bootstrap.sh
#	setup/management.sh
#	setup/nextcloud.sh
#	setup/system.sh
#	setup/web.sh
#	setup/webmail.sh
#	setup/zpush.sh
#	tests/test_mail.py
This commit is contained in:
downtownallday
2022-06-21 23:58:17 -04:00
20 changed files with 216 additions and 132 deletions

View File

@@ -159,7 +159,7 @@ def smtp_login(host, login, pw, port):
ipaddr = socket.gethostbyname(host) # IPv4 only!
reverse_ip = dns.reversename.from_address(ipaddr) # e.g. "1.0.0.127.in-addr.arpa."
try:
reverse_dns = dns.resolver.query(reverse_ip, 'PTR')[0].target.to_text(omit_final_dot=True) # => hostname
reverse_dns = dns.resolver.resolve(reverse_ip, 'PTR')[0].target.to_text(omit_final_dot=True) # => hostname
except dns.resolver.NXDOMAIN:
print("Reverse DNS lookup failed for %s. SMTP EHLO name check skipped." % ipaddr)
reverse_dns = None

View File

@@ -22,7 +22,6 @@ fi
source tests/lib/system.sh
source tests/lib/color-output.sh
dry_run=true
if [ "$1" == "--no-dry-run" ]; then
@@ -77,6 +76,11 @@ install_packages() {
# don't install slapd - it requires user input
pkgs="$(sed 's/slapd//g' <<< "$pkgs")"
# manually set PHP_VER if necessary
if grep "PHP_VER" <<<"$pkgs" >/dev/null; then
pkgs="$(sed "s/\${*PHP_VER}*/$PHP_VER/g" <<< "$pkgs")"
fi
if [ $OS_MAJOR -ge 22 ]; then
# don't install opendmarc on ubuntu 22 and higher - it requires
# interactive user input
@@ -93,6 +97,26 @@ install_packages() {
done
}
install_ppas() {
H1 "Add apt repositories"
grep 'hide_output add-apt-repository' setup/system.sh |
while read line; do
line=$(sed 's/^hide_output //' <<< "$line")
H2 "$line"
if ! $dry_run; then
exec_no_output $line
fi
done
}
# install PPAs from sources
install_ppas
# obtain PHP_VER variable from sources
PHP_VER=$(grep "^PHP_VER=" setup/functions.sh | awk -F= '{ print $2 }')
if ! $dry_run; then
H1 "Upgrade system"
H2 "apt update"