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
This commit is contained in:
Elmar Sönser 2025-09-24 14:16:49 +02:00
commit 1d7fe31845
3 changed files with 211 additions and 53 deletions

View file

@ -20,6 +20,12 @@ SOURCE_IMAP_PORT=993
# 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
@ -29,24 +35,30 @@ SOURCE_PASSWORD=your_hosteurope_password
SOURCE_IMAP_USE_SSL=True
# ============================================================================
# DESTINATION EMAIL ACCOUNT (migrating TO) - German Hosting Example
# DESTINATION EMAIL ACCOUNT (migrating TO) - Securehost.de Example
# ============================================================================
# DEST_IMAP_SERVER: Destination IMAP server
# Common formats: mail.yourdomain.de | imap.provider.de
DEST_IMAP_SERVER=mail.yourdomain.de
# 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@newdomain.de
DEST_EMAIL=user@newdomain.de
# 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 hosting provider email password
DEST_PASSWORD=your_destination_password
# Your securehost.de email password
DEST_PASSWORD=your_securehost_password
# DEST_IMAP_USE_SSL: Use SSL for destination
# True (recommended) | False
@ -113,30 +125,60 @@ LOG_LEVEL=INFO
# ./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 Settings:
# SOURCE_IMAP_SERVER=wpxxxxxxxx.mail.server-he.de
# SOURCE_IMAP_PORT=993
# SOURCE_IMAP_USE_SSL=True
# Note: Replace 'wpxxxxxxxx' with your actual server name from Host Europe KIS
# 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=
# Common German Hosting Providers:
# Strato: imap.strato.de:993
# 1und1/IONOS: imap.1und1.de:993
# All-Inkl: mail.all-inkl.com:993
# Hetzner: mail.your-server.de:993
# 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):
# Gmail: imap.gmail.com:993 (requires app password)
# imap.gmail.com:993 (requires app password, email login)
# ============================================================================
# MIGRATION EXAMPLES
# ============================================================================
# Example 1: Host Europe to new hosting with organization
# Example 1: Host Europe to Securehost.de with organization
# IMPORT_FOLDER_NAME=HostEurope_Migration
# Result: Clean separation in destination