Added maximum upload attachment size option
This commit is contained in:
31
installer.sh
31
installer.sh
@@ -26,18 +26,24 @@ PKGA="add-apt-repository"
|
|||||||
PKGI="${PKGM} install -y"
|
PKGI="${PKGM} install -y"
|
||||||
|
|
||||||
if [ $IMODE = n ]; then
|
if [ $IMODE = n ]; then
|
||||||
if (whiptail --title "Ubuntu 18.04 Mail Server" --yesno " Do you want to install a mail server?" 8 78)
|
if (whiptail --title "Ubuntu 18.04 Mail Server" --yesno " Do you want to install a mail server?" 11 78)
|
||||||
then
|
then
|
||||||
echo "" >/dev/null
|
echo "" >/dev/null
|
||||||
else
|
else
|
||||||
whiptail --title "Credits" --msgbox " Made by: your local Wizard and God" 8 78
|
whiptail --title "Credits" --msgbox " Made by: your local Wizard and God" 11 78
|
||||||
clear
|
clear
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
echo "" >/dev/null
|
echo "" >/dev/null
|
||||||
password=$(whiptail --nocancel --passwordbox "Please enter your password (should contain at least 2 digits and 6 characters)" 8 82 --title "Config" 3>&1 1>&2 2>&3)
|
password=$(whiptail --nocancel --passwordbox "Please enter your password (should contain at least 2 digits and 6 characters)" 11 82 --title "Config" 3>&1 1>&2 2>&3)
|
||||||
domain=$(whiptail --nocancel --inputbox " Enter the domain without www or mail." 8 82 --title "Config" 3>&1 1>&2 2>&3)
|
domain=$(whiptail --nocancel --inputbox " Enter the domain without www or mail." 11 82 --title "Config" 3>&1 1>&2 2>&3)
|
||||||
email=$(whiptail --nocancel --inputbox " Enter the administrator e-mail" 8 82 --title "Config" 3>&1 1>&2 2>&3)
|
email=$(whiptail --nocancel --inputbox " Enter the administrator e-mail" 11 82 --title "Config" 3>&1 1>&2 2>&3)
|
||||||
|
uploadsize=$(whiptail --nocancel --title "Config" --radiolist " Choose the maximum attachment size:" 11 82 4 \
|
||||||
|
"10" "MB " on \
|
||||||
|
"25" "MB" off \
|
||||||
|
"50" "MB" off \
|
||||||
|
"100" "MB" off \
|
||||||
|
3>&1 1>&2 2>&3)
|
||||||
elif [ $IMODE = l ]; then
|
elif [ $IMODE = l ]; then
|
||||||
echo "" >/dev/null
|
echo "" >/dev/null
|
||||||
echo "Ubuntu 18.04 Mailserver installation script."
|
echo "Ubuntu 18.04 Mailserver installation script."
|
||||||
@@ -47,6 +53,8 @@ echo "Please enter your password (should contain at least 2 digits and 6 charact
|
|||||||
read password
|
read password
|
||||||
echo "Administrator E-mail:"
|
echo "Administrator E-mail:"
|
||||||
read email
|
read email
|
||||||
|
echo "Enter the maximum attachment size in MB (without MB)
|
||||||
|
read uploadsize
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##---------------##
|
##---------------##
|
||||||
@@ -379,7 +387,7 @@ sed -i 's/PASSword/'$db_pass'/g' /etc/amavis/conf.d/50-user
|
|||||||
##------------------##
|
##------------------##
|
||||||
# Incoming SPF #
|
# Incoming SPF #
|
||||||
##------------------##
|
##------------------##
|
||||||
msg " Configuring Incoming SPF"
|
msg " Configuring incoming SPF"
|
||||||
sleep 2
|
sleep 2
|
||||||
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/spf/incoming_spf.sh -O /tmp/incoming_spf.sh
|
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/spf/incoming_spf.sh -O /tmp/incoming_spf.sh
|
||||||
source /tmp/incoming_spf.sh > $OUTPUT 2>&1
|
source /tmp/incoming_spf.sh > $OUTPUT 2>&1
|
||||||
@@ -393,6 +401,15 @@ wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$bra
|
|||||||
source /tmp/rainloop.sh > $OUTPUT 2>&1
|
source /tmp/rainloop.sh > $OUTPUT 2>&1
|
||||||
ln -s /opt/rainloop /var/www/"$domain"/html/
|
ln -s /opt/rainloop /var/www/"$domain"/html/
|
||||||
|
|
||||||
|
##-------------------------##
|
||||||
|
# Max attachment size #
|
||||||
|
##-------------------------##
|
||||||
|
msg " Configuring attachment sizes"
|
||||||
|
sleep 2
|
||||||
|
sed -i 's/body_size 8/body_size '$uploadsize'/g' /etc/nginx/nginx.conf
|
||||||
|
sed -i 's/attachment_size_limit = 25/attachment_size_limit = '$uploadsize'/g' /var/www/$domain/html/rainloop/data/_data_/_default_/configs/application.ini
|
||||||
|
sed -i 's/max_filesize = 2/max_filesize = '$uploadsize'/g' /etc/php/$phpver/fpm/php.ini /etc/php/$phpver/cli/php.ini
|
||||||
|
|
||||||
##--------------##
|
##--------------##
|
||||||
# Fail2Ban #
|
# Fail2Ban #
|
||||||
##--------------##
|
##--------------##
|
||||||
@@ -432,7 +449,7 @@ chmod +x /etc/update-motd.d/01-custom
|
|||||||
##---------##
|
##---------##
|
||||||
# Ufw #
|
# Ufw #
|
||||||
##---------##
|
##---------##
|
||||||
msg " Configuring ufw"
|
msg " Configuring UFW"
|
||||||
sleep 2
|
sleep 2
|
||||||
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/ufw/config.sh -O /tmp/ufw-config.sh
|
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/"$branch"/config/ufw/config.sh -O /tmp/ufw-config.sh
|
||||||
source /tmp/ufw-config.sh
|
source /tmp/ufw-config.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user