diff --git a/README.md b/README.md index 7519457..cf837bb 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ A script to facilitate easy installation of a Postfix + Gmail relay for custom e # Installing Run the following command to install ```shell -curl -fsSL https://raw.githubusercontent.com/TheGreatRambler/SimpleMailserver/main/install.sh | sudo -E bash - +su - -c "bash <(curl -fsSL https://raw.githubusercontent.com/TheGreatRambler/SimpleMailserver/main/install.sh)" ``` The installation script will ask for some values: * Domain name: Domain name used in the email, also required to configure SSL @@ -55,5 +55,5 @@ Check the mail using `runuser -l user -c 'mail'` with the user you entered. Ente # Uninstalling Run the following command to uninstall ```shell -curl -fsSL https://raw.githubusercontent.com/TheGreatRambler/SimpleMailserver/main/uninstall.sh | sudo -E bash - +su - -c "bash <(curl -fsSL https://raw.githubusercontent.com/TheGreatRambler/SimpleMailserver/main/uninstall.sh)" ``` \ No newline at end of file diff --git a/install.sh b/install.sh index 36462d6..6f94048 100755 --- a/install.sh +++ b/install.sh @@ -70,10 +70,10 @@ ln -s /snap/bin/certbot /usr/bin/certbot > /dev/null # Create certificate echo "----- Creating SSL certificate -----" -sudo certbot certonly --standalone --non-interactive \ +certbot certonly --standalone --non-interactive \ --domains $MAIL_SUBDOMAIN --agree-tos -m $CERTBOT_EMAIL > /dev/null if [[ $? -ne 0 ]]; then - echo "Certbot failed, check that you have AAAA records for ${MAIL_SUBDOMAIN}" + echo "Certbot failed, check that you have AAAA records for ${MAIL_SUBDOMAIN} and that port 80 is currently unused" exit 1 fi diff --git a/uninstall.sh b/uninstall.sh index dc1dd83..66648ea 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -39,7 +39,7 @@ apt-get purge dovecot-core dovecot-imapd dovecot-pop3d > /dev/null # Revert certain configs, certbot and UFW are common enough that the user # may have had them before running install.sh echo "----- Revert certbot/UFW config -----" -sudo certbot delete --cert-name $MAIL_SUBDOMAIN > /dev/null +yes | certbot delete --non-interactive --cert-name $MAIL_SUBDOMAIN > /dev/null ufw deny Postfix > /dev/null ufw deny "Postfix SMTPS" > /dev/null ufw deny "Postfix Submission" > /dev/null