From 2444d5216e71e21d8fe20dad4f62ce38006574e5 Mon Sep 17 00:00:00 2001 From: WLTBAgent Date: Mon, 23 Feb 2026 19:48:25 +0000 Subject: [PATCH] Update build.sh to prompt for separate IMAP/SMTP credentials for mail integration --- README.md | 15 ++++++++++++++ build.sh | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 76 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 128bda8..364ec90 100644 --- a/README.md +++ b/README.md @@ -270,6 +270,21 @@ Use the provided build script: ./build.sh ``` +**The build script will:** +1. Build Nextcloud API tools (Files, Contacts, Calendar, etc.) with the provided credentials +2. **Prompt you for separate IMAP/SMTP credentials** for the email integration +3. Build nextcloud-mail with email-specific credentials +4. Install all binaries to `~/bin/` + +**Email credentials needed:** +- IMAP server hostname (default: teamworkapps.com) +- IMAP port (default: 993 for SSL) +- IMAP username and password +- SMTP server hostname (default: teamworkapps.com) +- SMTP port (default: 465 for SSL) +- SMTP username and password +- SSL/TLS setting (default: yes) + --- ## Testing diff --git a/build.sh b/build.sh index 09f254e..13747e9 100755 --- a/build.sh +++ b/build.sh @@ -22,6 +22,66 @@ echo "Server: $SERVER_URL" echo "User: $USERNAME" echo "Token: ${TOKEN:0:10}..." echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "Email Integration Setup (IMAP/SMTP)" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "" +echo "Nextcloud Mail uses different credentials from the other Nextcloud tools." +echo "These are IMAP/SMTP credentials, not Nextcloud API credentials." +echo "" + +# Prompt for email credentials +read -p "IMAP Server hostname (default: teamworkapps.com): " IMAP_SERVER +IMAP_SERVER=${IMAP_SERVER:-teamworkapps.com} + +read -p "IMAP Port (default: 993 for SSL, 143 for STARTTLS): " IMAP_PORT +IMAP_PORT=${IMAP_PORT:-993} + +read -p "IMAP Username: " IMAP_USER +read -sp "IMAP Password: " IMAP_PASS +echo "" + +read -p "SMTP Server hostname (default: teamworkapps.com): " SMTP_SERVER +SMTP_SERVER=${SMTP_SERVER:-teamworkapps.com} + +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 Password (default: same as IMAP): " SMTP_PASS +echo "" + +if [ -z "$SMTP_PASS" ]; then + SMTP_PASS="$IMAP_PASS" +fi + +read -p "Use SSL/TLS? (Y/n, default: Y): " USE_SSL +USE_SSL=${USE_SSL:-Y} + +if [ "$USE_SSL" = "Y" ] || [ "$USE_SSL" = "y" ]; then + USE_SSL="true" +else + USE_SSL="false" +fi + +read -p "Ignore certificate validity errors? (y/N, default: N): " IGNORE_CERTS +IGNORE_CERTS=${IGNORE_CERTS:-N} + +if [ "$IGNORE_CERTS" = "Y" ] || [ "$IGNORE_CERTS" = "y" ]; then + IGNORE_CERTS="true" +else + IGNORE_CERTS="false" +fi + +echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "Email Credentials Summary:" +echo " IMAP: $IMAP_USER@$IMAP_SERVER:$IMAP_PORT (SSL: $USE_SSL)" +echo " SMTP: $SMTP_USER@$SMTP_SERVER:$SMTP_PORT (SSL: $USE_SSL)" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "" # Build nextcloud-client echo "Building nextcloud-client" @@ -69,7 +129,7 @@ echo "✓ nextcloud-talk built successfully" # Build nextcloud-mail echo "Building nextcloud-mail..." cd "$SCRIPT_DIR/tools/go/nextcloud-mail" -go build -ldflags="-X main.BuildIMAPServer=$SERVER_URL -X main.BuildIMAPPort=993 -X main.BuildIMAPUser=$USERNAME -X main.BuildIMAPPassword=$TOKEN -X main.BuildSMTPServer=$SERVER_URL -X main.BuildSMTPPort=465 -X main.BuildSMTPUser=$USERNAME -X main.BuildSMTPPassword=$TOKEN -X main.BuildUseSSL=true -X main.BuildIgnoreCerts=false" -o ~/bin/nextcloud-mail . +go build -ldflags="-X main.BuildIMAPServer=$IMAP_SERVER -X main.BuildIMAPPort=$IMAP_PORT -X main.BuildIMAPUser=$IMAP_USER -X main.BuildIMAPPassword=$IMAP_PASS -X main.BuildSMTPServer=$SMTP_SERVER -X main.BuildSMTPPort=$SMTP_PORT -X main.BuildSMTPUser=$SMTP_USER -X main.BuildSMTPPassword=$SMTP_PASS -X main.BuildUseSSL=$USE_SSL -X main.BuildIgnoreCerts=$IGNORE_CERTS" -o ~/bin/nextcloud-mail . echo "✓ nextcloud-mail built successfully" echo ""