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)
This commit is contained in:
WLTBAgent committed 2026-02-23 22:20:51 +00:00
1 parent d947baab35
commit 5dbebc0f44
1 file changed
+15 -2
+15 -2
View File
@@ -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}