diff --git a/build.sh b/build.sh index efb3c21..36ab352 100755 --- a/build.sh +++ b/build.sh @@ -22,15 +22,16 @@ echo "Server: $SERVER_URL" echo "User: $USERNAME" echo "Token: ${TOKEN:0:10}..." echo "" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "Email Integration Setup (IMAP/SMTP)" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" -echo "Nextcloud Mail uses different credentials from the other Nextcloud tools." +echo "Nextcloud Mail uses different credentials from other Nextcloud tools." echo "These are IMAP/SMTP credentials, not Nextcloud API credentials." echo "" # Prompt for email credentials +echo "" read -p "IMAP Server hostname (default: teamworkapps.com): " IMAP_SERVER IMAP_SERVER=${IMAP_SERVER:-teamworkapps.com} @@ -50,7 +51,7 @@ if [ -z "$IMAP_PASS" ]; then fi echo "" - +echo "" read -p "SMTP Server hostname (default: teamworkapps.com): " SMTP_SERVER SMTP_SERVER=${SMTP_SERVER:-teamworkapps.com} @@ -58,30 +59,13 @@ 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 -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 +SMTP_USER=${SMTP_USER:-$IMAP_USER} 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 -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} @@ -101,11 +85,13 @@ else fi echo "" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "Email Credentials Summary:" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "" echo " IMAP: $IMAP_USER@$IMAP_SERVER:$IMAP_PORT (SSL: $USE_SSL)" echo " SMTP: $SMTP_USER@$SMTP_SERVER:$SMTP_PORT (SSL: $USE_SSL)" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" # Build nextcloud-client @@ -147,32 +133,6 @@ go build \ -o ~/bin/nextcloud-mail echo "✓ nextcloud-mail built successfully" -# Verification: Show what credentials were embedded -echo "" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo " Build Verification Summary" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo " IMAP Server: $IMAP_SERVER" -echo " IMAP Port: $IMAP_PORT" -echo " IMAP Username: $IMAP_USER" -echo " IMAP Password: [$(echo "$IMAP_PASS" | sed 's/./*/g')]" -echo " SMTP Server: $SMTP_SERVER" -echo " SMTP Port: $SMTP_PORT" -echo " SMTP Username: $SMTP_USER" -echo " SMTP Password: [$(echo "$SMTP_PASS" | sed 's/./*/g')]" -echo " Use SSL: $USE_SSL" -echo " Ignore Certs: $IGNORE_CERTS" -echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -echo "" - -if [ -z "$IMAP_USER" ] || [ -z "$IMAP_PASS" ]; then - echo "⚠️ Warning: IMAP username or password appears to be empty!" - echo " The binary was built but may not work correctly." - echo " If this is incorrect, please rebuild with valid credentials." -fi - -echo "" - echo "" echo "All tools built successfully!" echo ""