From 5dbebc0f441a53fb506370e938b8471752596e18 Mon Sep 17 00:00:00 2001 From: WLTBAgent Date: Mon, 23 Feb 2026 22:20:51 +0000 Subject: [PATCH] Add validation to prevent empty usernames/passwords Build script now validates that IMAP username and password are not empty before proceeding with the build. This prevents the binary from being built with empty credentials which would cause connection errors like: "dial tcp :143" (empty hostname) --- build.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 3d38b5d..befc53e 100755 --- a/build.sh +++ b/build.sh @@ -38,7 +38,17 @@ read -p "IMAP Port (default: 993 for SSL, 143 for STARTTLS): " IMAP_PORT IMAP_PORT=${IMAP_PORT:-993} read -p "IMAP Username: " IMAP_USER +if [ -z "$IMAP_USER" ]; then + echo "❌ Error: IMAP username cannot be empty" + exit 1 +fi + read -sp "IMAP Password: " IMAP_PASS +if [ -z "$IMAP_PASS" ]; then + echo "❌ Error: IMAP password cannot be empty" + exit 1 +fi + echo "" read -p "SMTP Server hostname (default: teamworkapps.com): " SMTP_SERVER @@ -51,12 +61,15 @@ read -p "SMTP Username (default: same as IMAP): " SMTP_USER SMTP_USER=${SMTP_USER:-$IMAP_USER} read -sp "SMTP Password (default: same as IMAP): " SMTP_PASS -echo "" - if [ -z "$SMTP_PASS" ]; then SMTP_PASS="$IMAP_PASS" fi +if [ -z "$SMTP_PASS" ]; then + echo "❌ Error: SMTP password cannot be empty (IMAP password also empty)" + exit 1 +fi + read -p "Use SSL/TLS? (Y/n, default: Y): " USE_SSL USE_SSL=${USE_SSL:-Y}