Update build.sh to prompt for separate IMAP/SMTP credentials for mail integration

This commit is contained in:
WLTBAgent committed 2026-02-23 19:48:25 +00:00
1 parent d5af629462
commit 2444d5216e
2 files changed
+76 -1

No files matched your search

+15
View File
@@ -270,6 +270,21 @@ Use the provided build script:
./build.sh <server-url> <username> <token> ./build.sh <server-url> <username> <token>
``` ```
**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 ## Testing
+61 -1
View File
@@ -22,6 +22,66 @@ echo "Server: $SERVER_URL"
echo "User: $USERNAME" echo "User: $USERNAME"
echo "Token: ${TOKEN:0:10}..." echo "Token: ${TOKEN:0:10}..."
echo "" 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 # Build nextcloud-client
echo "Building nextcloud-client" echo "Building nextcloud-client"
@@ -69,7 +129,7 @@ echo "✓ nextcloud-talk built successfully"
# Build nextcloud-mail # Build nextcloud-mail
echo "Building nextcloud-mail..." echo "Building nextcloud-mail..."
cd "$SCRIPT_DIR/tools/go/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 "✓ nextcloud-mail built successfully"
echo "" echo ""