Skip to content

About

Postfix + PostGreSQL + Dovecot + SOGo WebUI Administrative Tool

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

PoDoSoGoAdmin

Created by Hawke Robinson hawke at dev2dev dot net

This is under the AGPL3.0 License for the public.

A modern web and CLI administration tool for managing SOGo email users with Postfix and Dovecot with a PostGreSQl Database and virtuall domains, users, and alises, with full integration.

✅ Status: FULLY OPERATIONAL (as of 2025-08-13)

User creation and management features are complete and tested in production.

  • ✅ Users can login to SOGo webmail
  • ✅ Send and receive emails with external servers (Gmail tested)
  • ✅ Complete bidirectional mail flow verified

⚠️ CRITICAL SECURITY NOTICE

Network Security Requirements

THIS APPLICATION IS NOT DESIGNED FOR PUBLIC INTERNET EXPOSURE

This platform MUST be deployed in one of these configurations:

  1. SSH Tunnel Access (Recommended) - Run on administrator's local machine, connect via SSH tunnel to mail server
  2. Same Server Installation - Run directly on the mail server, accessible only via private IP
  3. Internal Network Only - Deploy on internal network server, never expose to public internet

Security Warnings

  • ❌ DO NOT expose this application to the public internet
  • ❌ DO NOT run on a publicly accessible web server
  • ❌ DO NOT use without proper SSH key authentication
  • ⚠️ Application has not been hardened against external attacks
  • ⚠️ Designed for trusted administrator access only
  • ⚠️ All connections to mail services should be via SSH tunnel or localhost

Recommended Deployment

# Start SSH tunnel to mail server (from administrator's machine)
./scripts/ssh_tunnel.sh

# Run application locally (only accessible from localhost)
./scripts/start.sh

# Access via browser at http://localhost:8000

🔒 CRITICAL SAFETY FEATURES

1. SANDBOX MODE BY DEFAULT

ALL OPERATIONS RUN IN SANDBOX MODE BY DEFAULT!

  • ✅ No production changes without explicit --execute-real flag
  • ✅ Safe testing environment for all operations
  • ✅ Review what would happen before applying to production
  • ✅ Staging database tables for risk-free testing
  • 📖 See SANDBOX_SAFETY.md for complete details

2. MANDATORY BACKUP SYSTEM

ALL PRODUCTION CHANGES REQUIRE VERIFIED BACKUPS!

  • ✅ Automatic backups before ANY mail5 changes
  • ✅ Backup verification (checksum + integrity)
  • ✅ Clear restoration instructions provided
  • ✅ Operations abort if backups fail
  • 📖 See BACKUP_SAFETY.md for complete details

Quick Example

# SAFE - Runs in sandbox, shows what would happen
posogoadmin user create test@example.com

# PRODUCTION - Only with explicit flag and confirmation
posogoadmin --execute-real user create test@example.com

Overview

PoDoSoGoAdmin provides a clean, secure interface for managing email users in a SOGo + Postfix + Dovecot environment. Built with Python and FastAPI, it offers both REST API and command-line interfaces for comprehensive mail administration.

Features

Completed (Production Ready)

  • ✅ User creation with secure password hashing (SHA512-crypt)
  • ✅ User deletion with cleanup
  • ✅ User listing and search
  • ✅ Password reset functionality
  • ✅ User info editing (name, email)
  • ✅ Domain management (create, list, delete)
  • ✅ Alias management (create, update, delete, distribution lists)
  • ✅ REST API with JWT authentication
  • ✅ CLI for scripting and automation
  • ✅ Sandbox mode for safe testing
  • ✅ Automatic backup system
  • ✅ AWS EC2 snapshot integration
  • ✅ Service reload integration (Postfix/Dovecot/SSH-Tunnels/PostFix/Nginx/SOGo)
  • ✅ Multi-Server Monitoring (24/7 background monitoring and alerting, integration possible with Nagios, Grafana, Prometheus and other tools)
  • ✅ Enhanced Performance Metrics (CPU, memory, disk, network, database)
  • ✅ Alert Management System (thresholds, notifications, auto-resolution)
  • ✅ Email Traffic Analytics (flow visualization, hourly/daily metrics)
  • ✅ Historical Data Collection (90-day retention, SQLite storage)
  • ✅ Real-time Service Health (PostgreSQL, Postfix, Dovecot, SOGo)
  • ✅ Dual Server Support (mail.domain1.com + mail.domain2.net)

Phase 2 (Planned)

  • Web UI dashboard
  • Bulk user import/export (CSV)
  • Quota management
  • Vacation/out-of-office settings
  • Access control (admin roles)
  • Audit logging

Phase 3 (Future)

  • Calendar/Contact folder management
  • User migration tools
  • Advanced backup/restore functionality
  • LDAP integration option

Technology Stack

  • Language: Python 3.10+
  • Web Framework: FastAPI
  • CLI Framework: Typer
  • Database: PostgreSQL (via asyncpg/SQLAlchemy)
  • Authentication: OAuth2 with JWT tokens
  • Password Hashing: passlib with SHA512-crypt (SOGo compatible)
  • Web UI: Jinja2 templates with HTMX (no JavaScript frameworks)
  • Testing: pytest with coverage

Architecture

PoDoSoGoAdmin
├── API Layer (FastAPI)
│   ├── REST endpoints for user management
│   ├── OpenAPI/Swagger documentation
│   └── JWT authentication
├── Web UI (FastAPI + Jinja2)
│   ├── Admin dashboard
│   ├── User management forms
│   └── HTMX for dynamic updates
├── CLI (Typer)
│   ├── User CRUD operations
│   ├── Bulk operations
│   └── System maintenance
└── Core (Business Logic)
    ├── Database models (SQLAlchemy)
    ├── SOGo integration
    ├── Password hashing
    └── Email validation

Database Integration

PoDoSoGoAdmin works with the existing SOGo database schema:

Primary Tables

  • sogo_users - Main user authentication table
  • sogo_user_profile - User preferences
  • Per-user calendar/contact tables (created by SOGo)

Compatibility

  • Maintains compatibility with SOGo's authentication system
  • Uses same password hashing algorithm (SHA512-crypt with 70000 rounds)
  • Preserves existing table structures

Installation

Prerequisites

  • Python 3.10 or higher
  • PostgreSQL 12+
  • Running SOGo instance
  • SSH access to mail server (for service reloads)
  • So far only tested on Debian 12 and variants like Q4OS

Quick Start

# Clone repository
git clone [https://github.com/dev2devportal/podosogadmin/podosogoadmin.git](https://github.com/dev2devportal/podosogadmin/posogoadmin.git)
cd posogoadmin

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Configure database connection
cp config/config.example.yaml config/config.yaml
# Edit config/config.yaml with your settings

# Run database migrations
python src/manage.py migrate

# Start web server
python src/main.py

# Or use CLI
python src/cli.py --help

Configuration

Configuration is stored in config/config.yaml:

database:
  host: localhost
  port: 5432
  name: sogo
  user: sogo
  password: your_password

mail_server:
  host: xxx.xxx.xxx.xxx
  ssh_user: admin
  ssh_key: ~/.ssh/yoursshkey

sogo:
  password_rounds: 70000
  default_domain: domain1.com

api:
  secret_key: your-secret-key-here
  token_expire_minutes: 60

Usage

Web Interface

Navigate to http://localhost:8000 after starting the server.

CLI Examples

# Create a new user
posogoadmin user create --email john@example.com --name "John Doe"

# List all users
posogoadmin user list

# Reset password
posogoadmin user reset-password --email john@example.com

# Delete user
posogoadmin user delete --email john@example.com

# Bulk import
posogoadmin user import --csv users.csv

Development

Setup Development Environment

# Install development dependencies
pip install -r requirements-dev.txt

# Run tests
pytest

# Run with coverage
pytest --cov=src

# Format code
black src/ tests/

# Type checking
mypy src/

Project Structure

posogoadmin/
├── src/
│   ├── api/          # FastAPI routes
│   ├── cli/          # Typer CLI commands
│   ├── core/         # Business logic
│   ├── db/           # Database models and queries
│   ├── templates/    # Jinja2 templates
│   ├── static/       # CSS, images
│   ├── config.py     # Configuration management
│   └── main.py       # Application entry point
├── tests/            # Test suite
├── docs/             # Documentation
├── scripts/          # Utility scripts
├── config/           # Configuration files
└── requirements.txt  # Python dependencies

Security Considerations

  • Passwords are hashed using SHA512-crypt with 70000 rounds (SOGo compatible)
  • API uses JWT tokens for authentication
  • All database connections use prepared statements
  • SSH connections use key-based authentication
  • Configuration files should be protected (chmod 600)

License

GPL-3.0 (Compatible with SOGo's GPL-2+ license)

Contributing

Contributions are welcome! Please submit pull requests with tests and documentation.

Support

For issues and questions:

Acknowledgments

  • SOGo project for the excellent groupware platform
  • PostfixAdmin for inspiration on mail user management
  • FastAPI for the modern Python web framework

FUTURE NEW README FOR OPEN SOURCE VERSION (COMING SOON!)

PoDoSoGoAdmin - Multi-Server Mail Management Platform

Open Source Mail Server Administration Suite

Version: 2025.09.25 License: AGPL-3.0 Author: Hawke Robinson Website: https://www.hawkenterprising.com


Table of Contents

  1. Executive Summary
  2. Core Features
  3. Supported Technologies
  4. System Architecture
  5. Key Benefits
  6. Installation Guide
  7. Configuration
  8. API Documentation
  9. Security Features
  10. Performance Optimization
  11. Monitoring & Alerting
  12. Migration Tools
  13. Contributing
  14. Support

Executive Summary

PoDoSoGoAdmin represents a comprehensive, mail server administration WebUI platform designed for managing complex, multi-server email infrastructures. Built with enterprise scalability in mind, this tool integrates with Postfix, Dovecot, PostGreSQL, and SOGo to provide a unified management interface for mail server administrators handling multiple companies, servers, domains, thousands of users per server, and distributed server deployments.

The platform addresses the critical gap in open-source mail administration tools by providing a unified interface web solution while maintaining complete transparency and user control through its AGPL-3.0 licensing.

Primary Purpose

This tool was developed to solve real-world challenges faced by organizations managing multiple mail servers across different data centers, cloud providers, and geographic regions. It eliminates the need for manual SSH sessions, direct database manipulation, and scattered scripts by providing a centralized, web-based administration platform with API support.


Core Features

Multi-Server Management

  • Unlimited Server Support: Dynamically add, configure, and manage unlimited mail servers from a single interface
  • Secure SSH Tunnel Management: Automatic SSH tunnel creation and management for secure mail server and database connections
  • Server Health Monitoring: Real-time health checks and status monitoring for all configured servers (can also integrate with Nagios, Grafana, Prometheus and other related open source tools).
  • Failover Support: Built-in support for primary/secondary server configurations
  • Load Balancing: Distribute users and domains across multiple servers for optimal performance - TODO
  • Geographic Distribution: Manage servers across different regions with timezone-aware operations

Domain Administration

  • Multi-Domain Support: Manage unlimited domains per server with hierarchical organization
  • Domain Templates: Create and apply standardized domain configurations - TODO
  • DNS Integration: Automatic DNS record generation for SPF, DKIM, and DMARC - TODO
  • Domain Aliases: Support for domain aliases and catch-all configurations
  • Relay Domain Management: Configure relay domains for partner organizations
  • Domain-Level Quotas: Set and monitor storage quotas at the domain level
  • Transport Maps: Advanced routing configurations for specific domains

User Management

  • Bulk User Operations: Create, modify, and delete users in bulk with CSV import/export - IN PROGRESS
  • Password Policies: Enforce complex password requirements with customizable rules
  • Two-Factor Authentication: Support for TOTP-based 2FA for enhanced security
  • User Quotas: Individual mailbox quotas with automatic notification thresholds
  • Vacation/Out-of-Office: Centralized management of user vacation messages
  • Forward Management: Configure mail forwarding with multiple destination support
  • User Migration Tools: Migration of users between servers
  • Multi-Directory Integration: LDAP/AD/Janssen/Gluu synchronization for enterprise environments - IN PROGRESS

Alias Management

  • Virtual Aliases: Create and manage email aliases across domains
  • Distribution Lists: Full-featured mailing list management - IN PROGRESS
  • Alias Templates: Standardized alias patterns for organizational consistency
  • Wildcard Aliases: Support for pattern-based alias routing
  • Temporary Aliases: Time-limited aliases for temporary campaigns
  • Alias Analytics: Track alias usage and destination statistics - IN PROGRESS

CalDAV/CardDAV Integration

  • SOGo Calendar Management: Full integration with SOGo's CalDAV implementation - IN PROGRESS
  • Shared Calendars: Create and manage shared calendars for teams - IN PROGRESS
  • Resource Booking: Meeting room and resource scheduling system - IN PROGRESS
  • Contact Management: Centralized address book administration - IN PROGRESS
  • Calendar Permissions: Granular access control for calendar sharing - IN PROGRESS
  • Event Notifications: Automated event reminder configuration
  • Backup & Restore: Calendar and contact data backup utilities

Email Traffic Analytics

  • Real-Time Statistics: Live monitoring of mail flow with graphical displays - IN PROGRESS
  • Historical Analysis: Long-term trend analysis with customizable date ranges - IN PROGRESS
  • Top Senders/Recipients: Identify high-volume email sources and destinations - IN PROGRESS
  • Spam/Virus Statistics: Track security threats and filter effectiveness - IN PROGRESS
  • Queue Monitoring: Real-time mail queue analysis and management
  • Delivery Reports: Comprehensive delivery success/failure tracking - IN PROGRESS
  • Bandwidth Utilization: Monitor and optimize network usage - IN PROGRESS
  • Geographic Traffic Maps: Visualize global email traffic patterns - TODO

Advanced Monitoring

  • Multi-Server Dashboard: Unified view of all server metrics
  • Service Health Checks: Automatic monitoring of Postfix, Dovecot, PostGreSQL, SSH, Nginx, & SOGo services - IN PROGRESS
  • Performance Metrics: CPU, memory, disk, and network utilization tracking - IN PROGRESS
  • Database Performance: PostgreSQL query performance and optimization hints - IN PROGRESS
  • SSL Certificate Monitoring: Track certificate expiration and renewal status - TODO
  • Blacklist Monitoring: Automatic RBL/DNSBL status checking - TODO
  • Mail Loop Detection: Identify and alert on potential mail loops - TODO
  • Compliance Monitoring: Track regulatory compliance metrics - TODO

Alert System

  • Customizable Alerts: Define custom alert conditions and thresholds - IN PROGRESS
  • Multi-Channel Notifications: Email, SMS, Slack, and webhook support - TODO
  • Escalation Policies: Tiered alert escalation for critical issues - TODO
  • Alert Suppression: Intelligent suppression to prevent alert fatigue - TODO
  • Scheduled Maintenance: Automatic alert suspension during maintenance windows - IN PROGRESS
  • Alert History: Complete audit trail of all alerts and responses - IN PROGRESS
  • Predictive Alerts: Machine learning-based anomaly detection - TODO
  • Alert Templates: Pre-configured alerts for common scenarios - TODO

Security Features

  • Role-Based Access Control (RBAC): Granular permission management - IN PROGRESS
  • Audit Logging: Complete audit trail of all administrative actions - IN PROGRESS
  • IP Whitelisting: Restrict access to specific IP ranges - IN PROGRESS
  • Session Management: Secure session handling with timeout controls - IN PROGRESS
  • Encrypted Storage: AES-256 encryption for sensitive configuration data
  • API Token Management: Secure API authentication with revocable tokens
  • Security Scanning: Automated security vulnerability scanning - TODO
  • Compliance Reports: Generate compliance reports for audits - TODO

Backup & Recovery

  • Automated Backups: Scheduled backup of all configuration and user data - IN PROGRESS
  • Point-in-Time Recovery: Restore to any previous backup point - IN PROGRESS
  • Incremental Backups: Efficient storage with incremental backup strategies - IN PROGRESS
  • Off-Site Replication: Automatic replication to remote backup locations - TODO
  • Disaster Recovery Plans: Pre-configured recovery procedures - TODO
  • Backup Verification: Automatic backup integrity verification - IN PROGRESS
  • Selective Restore: Restore individual users, domains, or configurations - IN PROGRESS
  • Backup Encryption: End-to-end encryption for backup data

Migration Tools

  • Platform Migration: Migrate from other mail platforms (cPanel, Plesk, etc.) - TODO
  • Server Consolidation: Merge multiple servers into consolidated infrastructure - TODO
  • Zero-Downtime Migration: Live migration with minimal service interruption - TODO
  • Data Transformation: Automatic data format conversion during migration - TODO
  • Migration Validation: Pre and post-migration validation tools - TODO
  • Rollback Capability: Safe rollback options if migration issues occur - IN PROGRESS
  • Progress Tracking: Real-time migration progress monitoring - IN PROGRESS
  • Migration Reports: Detailed reports of migration success/failures - IN PROGRESS

Supported Technologies

Mail Server Components

  • MTA (Mail Transfer Agent)

    • Postfix 3.x+ with full configuration management
    • Support for multiple Postfix instances
    • Virtual domain and mailbox support
    • Transport map configuration
    • Relay host management
    • SMTP authentication (SASL)
    • TLS/SSL encryption support
  • MDA (Mail Delivery Agent)

    • Dovecot 2.x+ with IMAP/POP3 support
    • Maildir++ quota management
    • Sieve filtering support
    • Full-text search integration
    • Master/replica replication
    • Director proxy support
  • Groupware

    • SOGo 5.x+ complete integration
    • ActiveSync support
    • CalDAV/CardDAV protocols
    • Web interface customization
    • Multi-domain support
    • LDAP/SQL authentication backends

Database Systems

  • PostgreSQL 12+: Primary database for mail server data
  • MySQL/MariaDB 10+: Alternative database support
  • SQLite: Local configuration storage
  • Redis: Session and cache management
  • InfluxDB: Time-series metrics storage

Authentication Backends

  • Janssen IAM & SSO: Enterprise Centalized Identity & Access Management, & Single Sign On - IN PROGRESS
  • LDAP/Active Directory: Enterprise directory integration - IN PROGRESS
  • SQL: Database-based authentication - IN PROGRESS
  • PAM: System authentication integration - IN PROGRESS
  • OAuth 2.0: Modern authentication support - IN PROGRESS
  • RADIUS: Remote authentication support - TODO
  • Kerberos: Single sign-on capabilities - TODO

Operating Systems

  • Linux Distributions
    • Debian 11/12/13

Cloud Platforms

  • AWS: Full EC2, RDS, S3 integration
  • Google Cloud Platform: Compute Engine, Cloud SQL support - TODO
  • Microsoft Azure: VM, Database, Storage integration
  • Xen Orchestra: VM - TODO
  • On-Premises: Bare metal and VMware/KVM support

Container Technologies

  • Docker: Containerized deployment options - TODO
  • Kubernetes: Orchestration support with Helm charts - TODO
  • Docker Compose: Multi-container application deployment - TODO
  • Podman: Rootless container support - TODO

System Architecture

Component Overview

┌─────────────────────────────────────────────────────────────┐
│                     Web Interface (FastAPI)                  │
├─────────────────────────────────────────────────────────────┤
│                      RESTful API Layer                       │
├─────────────────────────────────────────────────────────────┤
│                    Business Logic Layer                      │
├──────────────┬──────────────┬──────────────┬───────────────┤
│  SSH Manager │ DB Connector │ Mail Service │ Monitor Agent │
├──────────────┴──────────────┴──────────────┴───────────────┤
│                     Data Access Layer                        │
├─────────────────────────────────────────────────────────────┤
│   PostgreSQL │    SQLite    │    Redis     │   InfluxDB    │
└─────────────────────────────────────────────────────────────┘

Scalability Design - IN PROGRESS

  • Horizontal Scaling: Add multiple application servers behind load balancer
  • Database Pooling: Efficient connection management for high concurrency
  • Caching Layer: Redis-based caching for improved performance
  • Async Operations: Non-blocking I/O for better resource utilization
  • Message Queuing: RabbitMQ/Redis for background task processing
  • CDN Integration: Static asset delivery through CDN networks

High Availability - IN PROGRESS

  • Active-Active Configuration: Multiple active instances for redundancy
  • Database Replication: Master-slave replication for data protection
  • Health Check Endpoints: Automated health monitoring
  • Automatic Failover: Seamless failover to backup systems
  • Session Persistence: Shared session storage across instances
  • Geographic Redundancy: Multi-region deployment capabilities

Key Benefits

For System Administrators

  1. Centralized Management: Single interface for all mail servers
  2. Reduced Complexity: Eliminate need for command-line operations
  3. Time Savings: Automate repetitive tasks with templates and bulk operations
  4. Error Prevention: Validation and safety checks prevent configuration errors
  5. Compliance Support: Built-in compliance reporting and audit trails
  6. Knowledge Transfer: Documented processes reduce dependency on individuals

For Organizations

  1. Cost Reduction: Eliminate licensing fees for commercial solutions
  2. Improved Security: Centralized security management and monitoring - TODO
  3. Scalability: Grow from single server to multi-server infrastructure
  4. Vendor Independence: No vendor lock-in with open-source solution
  5. Customization: Modify and extend to meet specific requirements
  6. Community Support: Active community for support and contributions - TODO

For End Users

  1. Better Service: Improved mail server performance and reliability - IN PROGRESS
  2. Self-Service Options: Password resets and vacation message management - IN PROGRESS
  3. Enhanced Security: Two-factor authentication and security features - TODO
  4. Mobile Support: Full mobile device configuration support - TODO
  5. Calendar Integration: Calendar and contact synchronization - IN PROGRESS

Installation Guide

Prerequisites

# System Requirements
- Python 3.9 or higher
- PostgreSQL 12+ (for mail server database)
- Redis (optional, for caching)
- 2GB RAM minimum (4GB recommended)
- 10GB disk space for application and logs

Quick Installation

# Clone repository
git clone https://github.com/dev2devportal/podosogoadmin.git
cd podosogoadmin

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Initialize database
python scripts/init_db.py

# Configure environment
cp .env.example .env
# Edit .env with your settings

# Run application
python scripts/start.sh

Docker Installation

# Using Docker Compose
docker-compose up -d

# Using Docker directly
docker build -t podosogoadmin .
docker run -d -p 8000:8000 --env-file .env podosogoadmin

Production Deployment

# Install with systemd service
sudo cp podosogoadmin.service /etc/systemd/system/
sudo systemctl enable podosogoadmin
sudo systemctl start podosogoadmin

# Configure nginx reverse proxy
sudo cp nginx/podosogoadmin.conf /etc/nginx/sites-available/
sudo ln -s /etc/nginx/sites-available/podosogoadmin.conf /etc/nginx/sites-enabled/
sudo systemctl reload nginx

Configuration

Initial Setup

  1. Database Configuration

    database:
      host: localhost
      port: 5432
      name: maildb
      user: mailadmin
      password: secure_password
  2. Server Registration

    servers:
      - name: mail-primary
        host: mail1.example.com
        ssh_user: admin
        ssh_key: ~/.ssh/mail-admin.pem
        local_port: 5433
  3. Security Settings

    security:
      session_timeout: 3600
      max_login_attempts: 5
      password_min_length: 12
      require_2fa: true

Advanced Configuration

  • JANSSEN IAM & SSO Integration: - IN PROGRESS
  • LDAP Integration: Configure enterprise directory services - IN PROGRESS
  • Custom Themes: Brand the interface with organizational colors/logos
  • Plugin System: Extend functionality with custom plugins - TODO
  • API Rate Limiting: Configure API throttling for security - TODO
  • Backup Schedules: Automated backup configuration - IN PROGRESS
  • Alert Rules: Custom alert conditions and notifications - IN PROGRESS

API Documentation

RESTful Endpoints

The platform provides comprehensive REST API coverage for all operations:

Authentication

  • POST /api/auth/login - Authenticate and receive JWT token
  • POST /api/auth/logout - Invalidate current session
  • POST /api/auth/refresh - Refresh authentication token
  • GET /api/auth/profile - Get current user profile

Server Management

  • GET /api/servers - List all configured servers
  • POST /api/servers - Add new mail server
  • GET /api/servers/{id} - Get server details
  • PUT /api/servers/{id} - Update server configuration
  • DELETE /api/servers/{id} - Remove server
  • POST /api/servers/{id}/tunnel/start - Start SSH tunnel
  • POST /api/servers/{id}/tunnel/stop - Stop SSH tunnel
  • GET /api/servers/{id}/tunnel/status - Check tunnel status

Domain Operations

  • GET /api/domains - List all domains
  • POST /api/domains - Create new domain
  • GET /api/domains/{domain} - Get domain details
  • PUT /api/domains/{domain} - Update domain settings
  • DELETE /api/domains/{domain} - Delete domain
  • GET /api/domains/{domain}/users - List domain users
  • POST /api/domains/{domain}/aliases - Create domain alias

User Management

  • GET /api/users - List all users
  • POST /api/users - Create new user
  • GET /api/users/{email} - Get user details
  • PUT /api/users/{email} - Update user settings
  • DELETE /api/users/{email} - Delete user
  • POST /api/users/{email}/password - Reset password
  • POST /api/users/{email}/quota - Update quota
  • GET /api/users/{email}/aliases - Get user aliases

Alias Management

  • GET /api/aliases - List all aliases
  • POST /api/aliases - Create new alias
  • GET /api/aliases/{alias} - Get alias details
  • PUT /api/aliases/{alias} - Update alias
  • DELETE /api/aliases/{alias} - Delete alias

Monitoring & Metrics

  • GET /api/monitoring/status - System status overview
  • GET /api/monitoring/metrics - Performance metrics
  • GET /api/monitoring/queues - Mail queue statistics
  • GET /api/monitoring/traffic - Traffic analytics
  • GET /api/monitoring/errors - Error logs
  • GET /api/monitoring/security - Security events

Reporting

  • GET /api/reports/usage - Usage statistics
  • GET /api/reports/compliance - Compliance reports
  • GET /api/reports/audit - Audit trail
  • POST /api/reports/custom - Generate custom report

WebSocket Support

Real-time updates via WebSocket connections:

// Connect to WebSocket
const ws = new WebSocket('wss://mail-admin.example.com/ws');

// Subscribe to events
ws.send(JSON.stringify({
  action: 'subscribe',
  events: ['queue_status', 'server_health', 'new_mail']
}));

// Receive real-time updates
ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log('Update received:', data);
};

GraphQL Interface

Alternative GraphQL endpoint for flexible queries:

query GetServerStatus {
  servers {
    id
    name
    status
    domains {
      name
      userCount
      aliasCount
    }
    metrics {
      cpu
      memory
      diskUsage
      mailQueue
    }
  }
}

Security Features

Authentication & Authorization

  • Multi-Factor Authentication: TOTP, SMS, and hardware token support
  • Single Sign-On (SSO): SAML 2.0 and OAuth 2.0 integration
  • Role-Based Access Control: Granular permission management
  • API Key Management: Secure API access with revocable keys
  • Session Management: Secure session handling with timeout controls
  • Password Policies: Enforced complexity and rotation requirements

Data Protection

  • Encryption at Rest: AES-256 encryption for sensitive data
  • Encryption in Transit: TLS 1.3 for all communications
  • Database Encryption: Transparent data encryption support
  • Backup Encryption: Encrypted backup storage
  • Key Management: Secure key storage and rotation
  • Data Masking: PII masking in logs and exports

Compliance & Auditing

  • GDPR Compliance: Data protection and privacy controls - TODO
  • HIPAA Support: Healthcare compliance features - TODO
  • Audit Logging: Complete audit trail of all actions - TODO
  • Compliance Reports: Automated compliance reporting - TODO
  • Data Retention: Configurable retention policies - TODO
  • Right to Erasure: User data deletion capabilities - TODO

Network Security

  • Firewall Integration: Automatic firewall rule management
  • DDoS Protection: Rate limiting and traffic filtering - TODO
  • IP Whitelisting: Restrict access by IP address
  • Geo-Blocking: Block access from specific countries - TODO
  • VPN Support: Secure remote administration
  • Intrusion Detection: IDS/IPS integration - TODO

Performance Optimization

Caching Strategies

  • Query Caching: Database query result caching
  • Object Caching: Frequently accessed object caching
  • Page Caching: Static page caching for performance
  • CDN Integration: Content delivery network support - TODO
  • Browser Caching: Client-side caching optimization - TODO
  • Redis Integration: High-performance cache backend

Database Optimization

  • Query Optimization: Automatic query analysis and optimization - TODO
  • Index Management: Intelligent index creation and maintenance - TODO
  • Connection Pooling: Efficient database connection management - TODO
  • Read Replicas: Load distribution across replicas - TODO
  • Partitioning: Table partitioning for large datasets - TODO
  • Vacuum Scheduling: Automatic database maintenance - TODO

Resource Management

  • Memory Management: Efficient memory utilization - IN PROGRESS
  • CPU Optimization: Multi-threading and async operations - IN PROGRESS
  • Disk I/O: Optimized disk access patterns - IN PROGRESS
  • Network Optimization: Connection pooling and compression - IN PROGRESS
  • Queue Management: Efficient mail queue processing - IN PROGRESS
  • Background Jobs: Asynchronous task processing - IN PROGRESS

Monitoring & Alerting

Real-Time Monitoring

  • Service Health: Postfix, Dovecot, SSH Tunnel, PostGreSQL, SOGo service monitoring - IN PROGRESS
  • System Metrics: CPU, memory, disk, network utilization - IN PROGRESS
  • Mail Flow: Real-time mail traffic monitoring - IN PROGRESS
  • Queue Status: Mail queue depth and processing rate - IN PROGRESS
  • Error Tracking: Real-time error detection and logging - IN PROGRESS
  • Performance Metrics: Response time and throughput monitoring - IN PROGRESS

Historical Analysis

  • Trend Analysis: Long-term performance trends - IN PROGRESS
  • Capacity Planning: Resource utilization forecasting - IN PROGRESS
  • Traffic Patterns: Email traffic pattern analysis - IN PROGRESS
  • User Behavior: User activity analytics - IN PROGRESS
  • Security Analytics: Threat detection and analysis - IN PROGRESS
  • Compliance Tracking: Regulatory compliance monitoring - TODO

Alerting System

  • Custom Alerts: Define custom alert conditions - IN PROGRESS
  • Alert Channels: Email, SMS, Slack, PagerDuty integration - TODO
  • Escalation: Tiered alert escalation policies - IN PROGRESS
  • Suppression: Intelligent alert suppression - IN PROGRESS
  • Scheduling: Maintenance window configuration - IN PROGRESS
  • Acknowledgment: Alert acknowledgment and assignment - IN PROGRESS

Reporting

  • Automated Reports: Scheduled report generation _ TODO
  • Custom Reports: Build custom reports with SQL - TODO
  • Executive Dashboards: High-level overview dashboards - TODO
  • Compliance Reports: Regulatory compliance reports - TODO
  • SLA Tracking: Service level agreement monitoring - IN PROGRESS
  • Export Options: PDF, CSV, JSON export formats - IN PROGRESS

Migration Tools

Supported Platforms

  • cPanel/WHM: Full migration from cPanel mail - TODO
  • Plesk: Plesk mail server migration - TODO
  • ISPConfig: ISPConfig mail migration - TODO
  • Zimbra: Zimbra collaboration suite migration - TODO
  • Microsoft Exchange: Exchange to open-source migration - IN PROGRESS
  • Google Workspace: Google mail migration - TODO
  • Generic IMAP: Any IMAP server migration - IN PROGRESS

Migration Features

  • Pre-Migration Analysis: Compatibility checking - TODO
  • Data Mapping: Automatic data structure mapping - TODO
  • Incremental Sync: Continuous synchronization - IN PROGRESS
  • Zero Downtime: Live migration capabilities - TODO
  • Validation Tools: Pre and post-migration validation - IN PROGRESS
  • Rollback Support: Safe rollback if issues occur - IN PROGRESS
  • Progress Tracking: Real-time migration monitoring - IN PROGRESS

Migration Process

  1. Discovery Phase: Analyze source environment - TODO
  2. Planning Phase: Create migration plan - TODO
  3. Test Migration: Perform test migration - TODO
  4. Validation: Verify test migration results _ TODO
  5. Production Migration: Execute live migration - TODO
  6. Cutover: Switch to new system - TODO
  7. Post-Migration: Verify and optimize - TODO

Contributing

Development Setup

# Fork and clone repository
git clone https://github.com/dev2devportal/podosogoadmin.git
cd podosogoadmin

# Create development branch
git checkout -b feature/your-feature

# Install development dependencies
pip install -r requirements-dev.txt

# Run tests
pytest tests/

# Run linting
flake8 src/
black src/

# Submit pull request
git push origin feature/your-feature

Contribution Guidelines

  1. Code Style: TBD
  2. Documentation: Update documentation for new features
  3. Testing: Write tests for new functionality
  4. Commit Messages: Use descriptive commit messages
  5. Pull Requests: Provide clear description of changes
  6. Code Review: Respond to review feedback promptly

Support

Documentation

  • User Guide: Comprehensive user documentation - IN PROGRESS
  • Admin Guide: System administration documentation - IN PROGRESS
  • API Reference: Complete API documentation - IN PROGRESS
  • Video Tutorials: Step-by-step video guides - TODO
  • Knowledge Base: Searchable solution database - IN PROGRESS
  • FAQ: Frequently asked questions - IN PROGRESS

Community Support

  • GitHub Issues: Bug reports and feature requests - TODO
  • Discussion Forum: Community discussion board - TODO
  • Matrix Server: Real-time community chat - TODO
  • Mailing List: Email-based discussions - TODO

Commercial Support

  • Professional Services: Implementation and consulting - N/A
  • Training: On-site and remote training programs - N/A
  • Priority Support: Guaranteed response times - N/A
  • Custom Development: Feature development services - N/A
  • Managed Services: Full management and monitoring - N/A
  • SLA Options: Service level agreements available - N/A
  • I AM NOT LOOKING TO COMMERCIALIZE THIS!

License

This software is released under the GNU Affero General Public License v3.0 (AGPL-3.0).

Key License Terms

  • Freedom to Use: Use for any purpose
  • Freedom to Study: Access and study source code
  • Freedom to Modify: Modify to suit your needs
  • Freedom to Share: Distribute copies
  • Network Copyleft: Network use requires source disclosure
  • Patent Protection: Patent grant and protection

Commercial Licensing

Alternative commercial licensing NOT AVAILABLE

Contact: hawkenterprising at gmail dot com


Acknowledgments

This project represents decades of experience managing enterprise mail infrastructure and incorporates best practices from the open-source community. Special recognition goes to the maintainers of Postfix, Dovecot, PostGreSQL, SSH, Nginx, and SOGo for creating the robust foundation upon which this tool builds.

Contributors

  • Hawke Robinson - Project Creator and Lead Developer
  • [Your contributions welcome here]

Technologies Used

  • FastAPI: Modern Python web framework
  • PostgreSQL: Robust relational database
  • Redis: High-performance caching
  • Bootstrap: Responsive UI framework
  • Chart.js: Data visualization
  • Paramiko: SSH connection management
  • SQLAlchemy: Database ORM
  • Pydantic: Data validation

Contact Information

Project Website: https://git.dev2dev.net - PRIVATE Documentation: https://git.dev2dev.net - PRIVATE GitHub: https://github.com/dev2devportal/podosogoadmin - COMING SOON Email: support@dev2dev.net Security: security@dev2dev.net

Author: Hawke Robinson Website: https://www.hawkenterprising.com


PoDoSoGoAdmin - Empowering mail administrators with powerful open-source tools

2025 Hawke Robinson.

About

Postfix + PostGreSQL + Dovecot + SOGo WebUI Administrative Tool

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors