email_migration/.env.template
Elmar Sönser 1d7fe31845 Add dual authentication support and comprehensive provider examples
Core functionality:
- Add dual authentication support (username + email fallback)
- Enhance IMAPConnection to try username first, then email
- Add SOURCE_USERNAME and DEST_USERNAME configuration options
- Improve authentication error handling and logging

Configuration updates:
- Add Host Europe to Securehost.de migration examples
- Include authentication method explanations for various providers
- Add comprehensive provider-specific settings (Host Europe, Securehost.de, etc.)
- Document username vs email login methods with examples

Documentation updates:
- Add dual authentication section in README
- Include Host Europe and Securehost.de specific examples
- Expand troubleshooting section with authentication help
- Add provider-specific troubleshooting guidance
- Include migration best practices

Features:
- Automatic fallback from username to email authentication
- Enhanced logging showing which authentication method succeeded
- Support for various hosting providers and their login requirements
- Improved error messages for authentication failures
2025-09-24 14:16:49 +02:00

192 lines
6.8 KiB
Text

# ============================================================================
# EMAIL MIGRATION CONFIGURATION FILE
# ============================================================================
# Copy this file to '.env' and fill in your actual values.
# NEVER commit the .env file to version control - it contains passwords!
# ============================================================================
# SOURCE EMAIL ACCOUNT (migrating FROM) - Host Europe Example
# ============================================================================
# SOURCE_IMAP_SERVER: IMAP server hostname
# Host Europe: wpxxxxxxxx.mail.server-he.de | Gmail: imap.gmail.com | Outlook: outlook.office365.com
SOURCE_IMAP_SERVER=wp123456.mail.server-he.de
# SOURCE_IMAP_PORT: IMAP port number
# 993 (SSL recommended) | 143 (TLS/STARTTLS)
SOURCE_IMAP_PORT=993
# SOURCE_EMAIL: Your source email address
# Example: user@yourdomain.de
SOURCE_EMAIL=user@example-domain.de
# SOURCE_USERNAME: Login username (if different from email)
# Some providers use separate username for login (e.g. hosteurope123, mail_user)
# Leave empty if login uses email address
# Host Europe: often uses email account name or specific username
SOURCE_USERNAME=
# SOURCE_PASSWORD: Email account password
# Use your Host Europe email password (NOT app password needed here)
SOURCE_PASSWORD=your_hosteurope_password
# SOURCE_IMAP_USE_SSL: Use SSL encryption
# True (port 993) | False (port 143 with TLS)
SOURCE_IMAP_USE_SSL=True
# ============================================================================
# DESTINATION EMAIL ACCOUNT (migrating TO) - Securehost.de Example
# ============================================================================
# DEST_IMAP_SERVER: Destination IMAP server
# Securehost.de: mail.securehost.de | Common: mail.yourdomain.de | imap.provider.de
DEST_IMAP_SERVER=mail.securehost.de
# DEST_IMAP_PORT: Destination IMAP port
# 993 (SSL) | 143 (TLS/STARTTLS)
DEST_IMAP_PORT=993
# DEST_EMAIL: Your destination email address
# Example: user@securehost.de
DEST_EMAIL=user@securehost.de
# DEST_USERNAME: Login username for destination (if different from email)
# Some hosting providers use separate username (e.g. user123, cpanel_user)
# Leave empty if login uses email address
# Securehost.de: typically uses email or specific username
DEST_USERNAME=
# DEST_PASSWORD: Destination email password
# Your securehost.de email password
DEST_PASSWORD=your_securehost_password
# DEST_IMAP_USE_SSL: Use SSL for destination
# True (recommended) | False
DEST_IMAP_USE_SSL=True
# ============================================================================
# IMPORT FOLDER CONFIGURATION
# ============================================================================
# IMPORT_FOLDER_NAME: Where to organize imported emails
#
# Set to folder name: Creates organized subfolders
# "Imported" → Imported/INBOX, Imported/Sent, Imported/Drafts
# "Migration" → Migration/INBOX, Migration/Sent, etc.
#
# Leave empty: All emails go to main INBOX
# "" → All emails regardless of source folder → INBOX
#
# Examples: Imported | Migration_2024 | HostEurope_Backup | (empty)
IMPORT_FOLDER_NAME=Imported
# ============================================================================
# FOLDER FILTERING
# ============================================================================
# INCLUDE_FOLDERS: Only migrate these folders (comma-separated)
# Empty = migrate all folders
# Host Europe common folders: INBOX,Sent,Drafts,Trash
INCLUDE_FOLDERS=
# EXCLUDE_FOLDERS: Skip these folders (comma-separated)
# Recommended: skip trash and spam folders
EXCLUDE_FOLDERS=Trash,Spam,Junk
# ============================================================================
# MIGRATION SETTINGS
# ============================================================================
# BATCH_SIZE: Emails processed at once
# 10 (conservative) | 50 (balanced) | 100 (aggressive)
BATCH_SIZE=50
# PRESERVE_FLAGS: Keep read/unread status
# True (recommended) | False
PRESERVE_FLAGS=True
# PRESERVE_DATES: Keep original email dates
# True (recommended) | False
PRESERVE_DATES=True
# ============================================================================
# TECHNICAL SETTINGS
# ============================================================================
# IMAP_TIMEOUT: Connection timeout in seconds
# 60 (default) | 120 (slow connections) | 30 (fast connections)
IMAP_TIMEOUT=60
# LOG_LEVEL: Logging detail level
# INFO (recommended) | DEBUG (troubleshooting) | ERROR (minimal)
LOG_LEVEL=INFO
# TEMP_DOWNLOAD_DIR: Temporary files directory
# ./temp_emails (default) | /tmp/emails | C:\Temp\emails
TEMP_DOWNLOAD_DIR=./temp_emails
# ============================================================================
# AUTHENTICATION EXAMPLES
# ============================================================================
# Email-based login (most common):
# SOURCE_EMAIL=user@domain.de
# SOURCE_USERNAME=
# → Script tries: user@domain.de
# Username-based login:
# SOURCE_EMAIL=user@domain.de
# SOURCE_USERNAME=mail_user123
# → Script tries: mail_user123, fallback to user@domain.de
# Host Europe specific:
# SOURCE_USERNAME=email_account_name (from Host Europe KIS)
# SOURCE_USERNAME= (if using Easy-Mail-Login)
# ============================================================================
# PROVIDER-SPECIFIC EXAMPLES
# ============================================================================
# Host Europe to Securehost.de Migration:
# SOURCE_IMAP_SERVER=wp123456.mail.server-he.de
# SOURCE_EMAIL=user@olddomain.de
# SOURCE_USERNAME=mail_account_he
# DEST_IMAP_SERVER=mail.securehost.de
# DEST_EMAIL=user@securehost.de
# DEST_USERNAME=
# Host Europe Settings:
# Server format: wpxxxxxxxx.mail.server-he.de (get from KIS)
# Port: 993 (SSL) or 143 (TLS)
# Username: Check KIS for account name or use email if Easy-Mail-Login enabled
# Securehost.de Settings:
# Server: mail.securehost.de (typical format)
# Port: 993 (SSL recommended)
# Authentication: Usually email-based, check with provider
# Other German Providers:
# Strato: imap.strato.de:993 (email login)
# 1und1/IONOS: imap.1und1.de:993 (username: username@domain)
# All-Inkl: mail.all-inkl.com:993 (username varies)
# Hetzner: mail.your-server.de:993 (email login)
# Gmail (if needed):
# imap.gmail.com:993 (requires app password, email login)
# ============================================================================
# MIGRATION EXAMPLES
# ============================================================================
# Example 1: Host Europe to Securehost.de with organization
# IMPORT_FOLDER_NAME=HostEurope_Migration
# Result: Clean separation in destination
# Example 2: Consolidate everything to main inbox
# IMPORT_FOLDER_NAME=
# Result: All emails in main INBOX
# Example 3: Test migration with one folder
# INCLUDE_FOLDERS=INBOX
# BATCH_SIZE=10
# LOG_LEVEL=DEBUG