diff --git a/build.sh b/build.sh index 724a4b5..efb3c21 100755 --- a/build.sh +++ b/build.sh @@ -58,9 +58,21 @@ read -p "SMTP Port (default: 465 for SSL, 587 for STARTTLS): " SMTP_PORT SMTP_PORT=${SMTP_PORT:-465} read -p "SMTP Username (default: same as IMAP): " SMTP_USER -SMTP_USER=${SMTP_USER:-$IMAP_USER} +read -sp SMTP_USER +if [ -z "$SMTP_USER" ] && [ -z "$SMTP_PASS" ]; then + # Only use IMAP defaults if BOTH SMTP username and password are empty + SMTP_USER=${SMTP_USER:-$IMAP_USER} +else + SMTP_USER=${SMTP_USER} +fi read -sp "SMTP Password (default: same as IMAP): " SMTP_PASS +if [ -z "$SMTP_USER" ] && [ -z "$SMTP_PASS" ]; then + # Only use IMAP defaults if BOTH SMTP username and password are empty + SMTP_PASS=${SMTP_PASS:-$IMAP_PASS} +else + SMTP_PASS=${SMTP_PASS} +fi if [ -z "$SMTP_PASS" ]; then SMTP_PASS="$IMAP_PASS" fi