1087 lines
38 KiB
Bash
Executable File
1087 lines
38 KiB
Bash
Executable File
#!/bin/bash
|
|
# ============================================================
|
|
# 🎯 AJOUT VARIANTES PMTA COMPLÈTES
|
|
# PMTA 5.5, 5.0, 4.5, 4.0, 3.5 + Configurations
|
|
# ============================================================
|
|
|
|
echo "╔══════════════════════════════════════════════════════╗"
|
|
echo "║ 🎯 AJOUT VARIANTES PMTA COMPLÈTES ║"
|
|
echo "║ PMTA 5.5, 5.0, 4.5, 4.0, 3.5 + Configurations ║"
|
|
echo "║ $(date) ║"
|
|
echo "╚══════════════════════════════════════════════════════╝"
|
|
|
|
TEST_ID="pmta_variants_$(date +%s)"
|
|
PMTA_DIR="/opt/wevads/configs/pmta_variants_$TEST_ID"
|
|
mkdir -p "$PMTA_DIR"
|
|
|
|
# 1. CRÉER LES CONFIGURATIONS POUR CHAQUE VERSION PMTA
|
|
echo ""
|
|
echo "1. ⚙️ CRÉATION CONFIGURATIONS PMTA PAR VERSION..."
|
|
|
|
# PMTA 5.5 (Dernière version)
|
|
cat > "$PMTA_DIR/pmta_5.5.json" << 'PMTA_55'
|
|
{
|
|
"pmta_version": "5.5",
|
|
"version_name": "PowerMTA 5.5r7",
|
|
"release_date": "2024",
|
|
"features": [
|
|
"Enhanced bounce processing",
|
|
"Improved TLS 1.3 support",
|
|
"Advanced queue management",
|
|
"Enhanced logging",
|
|
"Better IPv6 support",
|
|
"Improved API"
|
|
],
|
|
"config_templates": {
|
|
"direct_injection": {
|
|
"method": "file_drop",
|
|
"location": "/var/spool/pmta/",
|
|
"file_format": "RFC2822",
|
|
"file_naming": "queue_%Y%m%d%H%M%S_%RAND%.txt",
|
|
"permissions": "0644",
|
|
"owner": "pmta:pmta"
|
|
},
|
|
"smtp_submission": {
|
|
"method": "smtp",
|
|
"host": "localhost",
|
|
"port": 25,
|
|
"auth": "optional",
|
|
"max_connections": 100,
|
|
"rate_limit": "per_domain"
|
|
},
|
|
"http_api": {
|
|
"method": "http",
|
|
"endpoint": "http://localhost:8080/api/v1/send",
|
|
"auth": "bearer_token",
|
|
"format": "json"
|
|
}
|
|
},
|
|
"queue_strategies": [
|
|
"immediate_delivery",
|
|
"scheduled_delivery",
|
|
"throttled_delivery",
|
|
"adaptive_delivery"
|
|
],
|
|
"optimization_tips": [
|
|
"Use separate queues for different domains",
|
|
"Implement bounce handling rules",
|
|
"Configure feedback loops",
|
|
"Set up domain throttling",
|
|
"Enable reputation monitoring"
|
|
]
|
|
}
|
|
PMTA_55
|
|
|
|
# PMTA 5.0
|
|
cat > "$PMTA_DIR/pmta_5.0.json" << 'PMTA_50'
|
|
{
|
|
"pmta_version": "5.0",
|
|
"version_name": "PowerMTA 5.0r6",
|
|
"release_date": "2022",
|
|
"features": [
|
|
"Enhanced bounce management",
|
|
"Improved warmup scheduling",
|
|
"Better domain rotation",
|
|
"Enhanced reporting",
|
|
"API improvements"
|
|
],
|
|
"config_differences": {
|
|
"from_4.5": [
|
|
"New bounce classification system",
|
|
"Improved queue management",
|
|
"Enhanced logging format",
|
|
"Better IPv6 handling"
|
|
]
|
|
},
|
|
"migration_notes": "Config files mostly compatible with minor adjustments"
|
|
}
|
|
PMTA_50
|
|
|
|
# PMTA 4.5
|
|
cat > "$PMTA_DIR/pmta_4.5.json" << 'PMTA_45'
|
|
{
|
|
"pmta_version": "4.5",
|
|
"version_name": "PowerMTA 4.5r11",
|
|
"release_date": "2020",
|
|
"features": [
|
|
"Advanced throttling controls",
|
|
"Enhanced bounce processing",
|
|
"Improved DNS handling",
|
|
"Better IP rotation",
|
|
"Comprehensive logging"
|
|
],
|
|
"common_configurations": {
|
|
"high_volume": {
|
|
"max_connections": 500,
|
|
"queue_size": 100000,
|
|
"memory_limit": "2GB",
|
|
"threads": 50
|
|
},
|
|
"medium_volume": {
|
|
"max_connections": 200,
|
|
"queue_size": 50000,
|
|
"memory_limit": "1GB",
|
|
"threads": 20
|
|
},
|
|
"low_volume": {
|
|
"max_connections": 50,
|
|
"queue_size": 10000,
|
|
"memory_limit": "512MB",
|
|
"threads": 10
|
|
}
|
|
}
|
|
}
|
|
PMTA_45
|
|
|
|
# PMTA 4.0
|
|
cat > "$PMTA_DIR/pmta_4.0.json" << 'PMTA_40'
|
|
{
|
|
"pmta_version": "4.0",
|
|
"version_name": "PowerMTA 4.0r8",
|
|
"release_date": "2018",
|
|
"features": [
|
|
"Basic bounce handling",
|
|
"Domain throttling",
|
|
"IP rotation",
|
|
"Queue management",
|
|
"SMTP compliance"
|
|
],
|
|
"limitations": [
|
|
"Limited API features",
|
|
"Basic logging",
|
|
"No advanced bounce classification",
|
|
"Limited TLS options"
|
|
],
|
|
"upgrade_recommended": true,
|
|
"upgrade_path": "4.0 → 4.5 → 5.0 → 5.5"
|
|
}
|
|
PMTA_40
|
|
|
|
# PMTA 3.5 (Legacy)
|
|
cat > "$PMTA_DIR/pmta_3.5.json" << 'PMTA_35'
|
|
{
|
|
"pmta_version": "3.5",
|
|
"version_name": "PowerMTA 3.5r6",
|
|
"release_date": "2016",
|
|
"status": "legacy",
|
|
"features": [
|
|
"Basic SMTP engine",
|
|
"Simple queue system",
|
|
"Basic logging",
|
|
"IP rotation"
|
|
],
|
|
"security_notes": [
|
|
"Limited TLS support",
|
|
"No modern encryption",
|
|
"Potential security vulnerabilities",
|
|
"Not recommended for production"
|
|
],
|
|
"recommendation": "Upgrade to at least PMTA 4.5"
|
|
}
|
|
PMTA_35
|
|
|
|
echo " ✅ Configurations PMTA créées: 5.5, 5.0, 4.5, 4.0, 3.5"
|
|
|
|
# 2. CRÉER LES SCRIPTS D'INSTALLATION POUR CHAQUE VERSION
|
|
echo ""
|
|
echo "2. 📦 CRÉATION SCRIPTS D'INSTALLATION..."
|
|
|
|
# Script d'installation PMTA 5.5
|
|
cat > "$PMTA_DIR/install_pmta_5.5.sh" << 'INSTALL_55'
|
|
#!/bin/bash
|
|
# Installation PowerMTA 5.5
|
|
|
|
echo "Installing PowerMTA 5.5..."
|
|
|
|
# Variables
|
|
PMTA_VERSION="5.5"
|
|
PMTA_PACKAGE="powermta-5.5r7.x86_64.rpm"
|
|
PMTA_DOWNLOAD_URL="https://www.port25.com/download/powermta-5.5r7.x86_64.rpm"
|
|
|
|
# Installation steps
|
|
echo "1. Downloading PMTA $PMTA_VERSION..."
|
|
wget "$PMTA_DOWNLOAD_URL" -O "/tmp/$PMTA_PACKAGE"
|
|
|
|
echo "2. Installing dependencies..."
|
|
yum install -y perl || apt-get install -y perl
|
|
|
|
echo "3. Installing PMTA..."
|
|
if [ -f "/tmp/$PMTA_PACKAGE" ]; then
|
|
rpm -ivh "/tmp/$PMTA_PACKAGE" || dpkg -i "/tmp/$PMTA_PACKAGE"
|
|
else
|
|
echo "Package not found, manual installation required"
|
|
echo "Download from: https://www.port25.com/support/downloads/"
|
|
fi
|
|
|
|
echo "4. Basic configuration..."
|
|
cat > /etc/pmta/config << 'PMTA_BASE_CONFIG'
|
|
# PowerMTA 5.5 Base Configuration
|
|
|
|
# SMTP Service
|
|
smtp-listener *:25
|
|
allow-auth plain
|
|
max-message-size 50m
|
|
|
|
# Default Virtual MTA
|
|
<virtual-mta mta1>
|
|
smtp-source-host 1.2.3.4
|
|
smtp-source-ip 1.2.3.4
|
|
</virtual-mta>
|
|
|
|
# Default Domain
|
|
<domain *>
|
|
max-smtp-out 10
|
|
source mta1
|
|
route [127.0.0.1]:25
|
|
</domain>
|
|
|
|
# Logging
|
|
log-event /var/log/pmta/pmta.log
|
|
mode 0644
|
|
level info
|
|
PMTA_BASE_CONFIG
|
|
|
|
echo "5. Starting service..."
|
|
systemctl enable pmta
|
|
systemctl start pmta
|
|
|
|
echo "✅ PowerMTA $PMTA_VERSION installed!"
|
|
echo "📁 Config: /etc/pmta/config"
|
|
echo "📊 Logs: /var/log/pmta/"
|
|
INSTALL_55
|
|
|
|
# Script d'installation PMTA 4.5
|
|
cat > "$PMTA_DIR/install_pmta_4.5.sh" << 'INSTALL_45'
|
|
#!/bin/bash
|
|
# Installation PowerMTA 4.5
|
|
|
|
echo "Installing PowerMTA 4.5..."
|
|
|
|
# Installation steps for 4.5 (similar but with version-specific config)
|
|
echo "PMTA 4.5 installation steps..."
|
|
|
|
# Configuration spécifique 4.5
|
|
cat > /etc/pmta/config_4.5 << 'PMTA_45_CONFIG'
|
|
# PowerMTA 4.5 Configuration
|
|
|
|
# Note: 4.5 has slightly different syntax
|
|
smtp-listener 0.0.0.0:25
|
|
allow-mail-from *
|
|
max-message-size 25m
|
|
|
|
<virtual-mta mta1>
|
|
smtp-source-host primary.mta.example.com
|
|
</virtual-mta>
|
|
|
|
<domain *>
|
|
max-smtp-out 5
|
|
source mta1
|
|
</domain>
|
|
PMTA_45_CONFIG
|
|
|
|
echo "✅ PMTA 4.5 configuration created"
|
|
INSTALL_45
|
|
|
|
chmod +x $PMTA_DIR/install_*.sh
|
|
|
|
# 3. CRÉER LES CONFIGURATIONS D'OPTIMISATION
|
|
echo ""
|
|
echo "3. ⚡ CRÉATION CONFIGURATIONS D'OPTIMISATION..."
|
|
|
|
# Configuration High Performance
|
|
cat > "$PMTA_DIR/config_high_perf.json" << 'HIGH_PERF'
|
|
{
|
|
"config_name": "High Performance Setup",
|
|
"suitable_for": "Bulk sending > 1M emails/day",
|
|
"system_requirements": {
|
|
"cpu": "8+ cores",
|
|
"ram": "16GB+",
|
|
"disk": "SSD recommended",
|
|
"network": "1Gbps+"
|
|
},
|
|
"pmta_config": {
|
|
"max_connections": 1000,
|
|
"max_queue_size": 500000,
|
|
"memory_limit": "4GB",
|
|
"worker_threads": 100,
|
|
"disk_cache_size": "2GB"
|
|
},
|
|
"queue_strategy": {
|
|
"immediate_queues": 10,
|
|
"deferred_queues": 5,
|
|
"retry_queues": 3,
|
|
"max_retries": 5
|
|
},
|
|
"delivery_optimization": {
|
|
"concurrent_deliveries": 50,
|
|
"connection_reuse": true,
|
|
"pipelining": true,
|
|
"tls_session_reuse": true
|
|
},
|
|
"monitoring": {
|
|
"real_time_stats": true,
|
|
"detailed_logging": true,
|
|
"alert_thresholds": {
|
|
"queue_size": 100000,
|
|
"bounce_rate": 5,
|
|
"connection_errors": 100
|
|
}
|
|
}
|
|
}
|
|
HIGH_PERF
|
|
|
|
# Configuration Medium Load
|
|
cat > "$PMTA_DIR/config_medium_load.json" << 'MEDIUM_LOAD'
|
|
{
|
|
"config_name": "Medium Load Setup",
|
|
"suitable_for": "100K-1M emails/day",
|
|
"system_requirements": {
|
|
"cpu": "4 cores",
|
|
"ram": "8GB",
|
|
"disk": "Fast HDD or SSD",
|
|
"network": "100Mbps+"
|
|
},
|
|
"pmta_config": {
|
|
"max_connections": 500,
|
|
"max_queue_size": 100000,
|
|
"memory_limit": "2GB",
|
|
"worker_threads": 50
|
|
},
|
|
"optimization_tips": [
|
|
"Use domain-based throttling",
|
|
"Implement warmup schedules",
|
|
"Monitor bounce rates closely",
|
|
"Use separate IPs for different domains"
|
|
]
|
|
}
|
|
MEDIUM_LOAD
|
|
|
|
# Configuration Startup/Small
|
|
cat > "$PMTA_DIR/config_startup.json" << 'STARTUP_CONFIG'
|
|
{
|
|
"config_name": "Startup/Small Setup",
|
|
"suitable_for": "Up to 100K emails/day",
|
|
"system_requirements": {
|
|
"cpu": "2 cores",
|
|
"ram": "4GB",
|
|
"disk": "Any",
|
|
"network": "50Mbps+"
|
|
},
|
|
"pmta_config": {
|
|
"max_connections": 100,
|
|
"max_queue_size": 50000,
|
|
"memory_limit": "1GB",
|
|
"worker_threads": 20
|
|
},
|
|
"best_practices": [
|
|
"Start with low volume and warm up",
|
|
"Monitor reputation carefully",
|
|
"Use single IP initially",
|
|
"Focus on deliverability over volume"
|
|
]
|
|
}
|
|
STARTUP_CONFIG
|
|
|
|
# 4. CRÉER LE DASHBOARD PMTA
|
|
echo ""
|
|
echo "4. 📊 CRÉATION DASHBOARD PMTA..."
|
|
|
|
cat > /opt/wevads/public/pmta-variants-dashboard.html << 'PMTA_DASHBOARD'
|
|
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>⚡ PMTA Variants - WEVADS Arsenal</title>
|
|
<style>
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #0f172a; color: white; }
|
|
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }
|
|
.header { text-align: center; padding: 30px; background: linear-gradient(135deg, #1a1a2e, #16213e); border-radius: 15px; margin-bottom: 30px; border: 2px solid #8b5cf6; }
|
|
.versions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; margin-bottom: 40px; }
|
|
.version-card { background: rgba(30, 41, 59, 0.8); padding: 25px; border-radius: 15px; border: 2px solid; transition: transform 0.3s; }
|
|
.version-card:hover { transform: translateY(-5px); }
|
|
.version-55 { border-color: #10b981; }
|
|
.version-50 { border-color: #3b82f6; }
|
|
.version-45 { border-color: #f59e0b; }
|
|
.version-40 { border-color: #ef4444; }
|
|
.version-35 { border-color: #94a3b8; }
|
|
.version-badge { display: inline-block; padding: 5px 15px; border-radius: 20px; font-weight: bold; margin-bottom: 15px; }
|
|
.badge-latest { background: #10b981; }
|
|
.badge-current { background: #3b82f6; }
|
|
.badge-legacy { background: #f59e0b; }
|
|
.badge-deprecated { background: #ef4444; }
|
|
.config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 20px; margin: 30px 0; }
|
|
.config-card { background: rgba(15, 23, 42, 0.6); padding: 20px; border-radius: 10px; border: 1px solid #475569; }
|
|
.feature-list { margin-top: 15px; }
|
|
.feature-item { padding: 8px; margin: 5px 0; background: rgba(255,255,255,0.05); border-radius: 5px; }
|
|
.controls { display: flex; justify-content: center; gap: 15px; margin: 30px 0; }
|
|
.control-btn { padding: 12px 24px; background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: white; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="header">
|
|
<h1>⚡ PowerMTA Variants - WEVADS Arsenal</h1>
|
|
<p>PMTA 5.5, 5.0, 4.5, 4.0, 3.5 + Configurations optimisées</p>
|
|
</div>
|
|
|
|
<h2>📋 Versions PMTA Disponibles</h2>
|
|
<div class="versions-grid" id="versions-grid">
|
|
<!-- Versions will be loaded here -->
|
|
</div>
|
|
|
|
<h2>⚡ Configurations d'Optimisation</h2>
|
|
<div class="config-grid" id="config-grid">
|
|
<!-- Configurations will be loaded here -->
|
|
</div>
|
|
|
|
<h2>🛠️ Outils d'Installation & Configuration</h2>
|
|
<div class="controls">
|
|
<button class="control-btn" onclick="installPMTA('5.5')">📦 Installer PMTA 5.5</button>
|
|
<button class="control-btn" onclick="showConfigGenerator()">⚙️ Générer Config</button>
|
|
<button class="control-btn" onclick="showMigrationGuide()">🔄 Guide Migration</button>
|
|
<button class="control-btn" onclick="showMonitoringSetup()">📊 Monitoring</button>
|
|
</div>
|
|
|
|
<div id="dynamic-content" style="margin-top: 40px;">
|
|
<!-- Contenu dynamique -->
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
const pmtaVersions = [
|
|
{
|
|
version: "5.5",
|
|
name: "PowerMTA 5.5r7",
|
|
status: "latest",
|
|
badge: "badge-latest",
|
|
cardClass: "version-55",
|
|
features: [
|
|
"Enhanced bounce processing",
|
|
"TLS 1.3 support",
|
|
"Advanced queue management",
|
|
"Improved IPv6",
|
|
"Better API"
|
|
],
|
|
recommended: true,
|
|
install_script: "/opt/wevads/configs/pmta_variants/install_pmta_5.5.sh"
|
|
},
|
|
{
|
|
version: "5.0",
|
|
name: "PowerMTA 5.0r6",
|
|
status: "current",
|
|
badge: "badge-current",
|
|
cardClass: "version-50",
|
|
features: [
|
|
"Improved warmup scheduling",
|
|
"Better domain rotation",
|
|
"Enhanced reporting",
|
|
"API improvements"
|
|
],
|
|
recommended: true
|
|
},
|
|
{
|
|
version: "4.5",
|
|
name: "PowerMTA 4.5r11",
|
|
status: "legacy",
|
|
badge: "badge-legacy",
|
|
cardClass: "version-45",
|
|
features: [
|
|
"Advanced throttling",
|
|
"Enhanced bounce processing",
|
|
"Improved DNS handling",
|
|
"Better IP rotation"
|
|
],
|
|
recommended: false
|
|
},
|
|
{
|
|
version: "4.0",
|
|
name: "PowerMTA 4.0r8",
|
|
status: "deprecated",
|
|
badge: "badge-deprecated",
|
|
cardClass: "version-40",
|
|
features: [
|
|
"Basic bounce handling",
|
|
"Domain throttling",
|
|
"IP rotation",
|
|
"Queue management"
|
|
],
|
|
recommended: false
|
|
},
|
|
{
|
|
version: "3.5",
|
|
name: "PowerMTA 3.5r6",
|
|
status: "deprecated",
|
|
badge: "badge-deprecated",
|
|
cardClass: "version-35",
|
|
features: [
|
|
"Basic SMTP engine",
|
|
"Simple queue system",
|
|
"Basic logging",
|
|
"IP rotation"
|
|
],
|
|
security_warning: true,
|
|
recommended: false
|
|
}
|
|
];
|
|
|
|
const configTemplates = [
|
|
{
|
|
name: "High Performance",
|
|
type: "high_perf",
|
|
volume: "> 1M emails/day",
|
|
requirements: "8+ cores, 16GB RAM, SSD",
|
|
features: [
|
|
"1000 max connections",
|
|
"500K queue size",
|
|
"4GB memory limit",
|
|
"100 worker threads"
|
|
]
|
|
},
|
|
{
|
|
name: "Medium Load",
|
|
type: "medium",
|
|
volume: "100K-1M emails/day",
|
|
requirements: "4 cores, 8GB RAM",
|
|
features: [
|
|
"500 max connections",
|
|
"100K queue size",
|
|
"2GB memory limit",
|
|
"50 worker threads"
|
|
]
|
|
},
|
|
{
|
|
name: "Startup/Small",
|
|
type: "startup",
|
|
volume: "< 100K emails/day",
|
|
requirements: "2 cores, 4GB RAM",
|
|
features: [
|
|
"100 max connections",
|
|
"50K queue size",
|
|
"1GB memory limit",
|
|
"20 worker threads"
|
|
]
|
|
}
|
|
];
|
|
|
|
function renderVersions() {
|
|
const grid = document.getElementById('versions-grid');
|
|
grid.innerHTML = pmtaVersions.map(version => `
|
|
<div class="version-card ${version.cardClass}">
|
|
<div class="version-badge ${version.badge}">
|
|
${version.status.toUpperCase()}
|
|
</div>
|
|
<h3>PMTA ${version.version}</h3>
|
|
<p style="color: #94a3b8; margin-bottom: 15px;">${version.name}</p>
|
|
|
|
<div class="feature-list">
|
|
${version.features.map(feat => `
|
|
<div class="feature-item">✓ ${feat}</div>
|
|
`).join('')}
|
|
</div>
|
|
|
|
${version.recommended ? `
|
|
<div style="margin-top: 15px; color: #10b981; font-weight: bold;">
|
|
✅ RECOMMANDÉ
|
|
</div>
|
|
` : ''}
|
|
|
|
${version.security_warning ? `
|
|
<div style="margin-top: 15px; color: #ef4444; font-weight: bold;">
|
|
⚠️ ALERTE SÉCURITÉ
|
|
</div>
|
|
` : ''}
|
|
|
|
<div style="margin-top: 20px;">
|
|
<button onclick="showVersionDetails('${version.version}')"
|
|
style="padding: 8px 16px; background: rgba(255,255,255,0.1);
|
|
color: white; border: 1px solid ${version.cardClass.split('-')[1]};
|
|
border-radius: 5px; cursor: pointer;">
|
|
📖 Détails
|
|
</button>
|
|
|
|
${version.install_script ? `
|
|
<button onclick="installVersion('${version.version}')"
|
|
style="padding: 8px 16px; background: ${version.cardClass.split('-')[1]};
|
|
color: white; border: none; border-radius: 5px;
|
|
margin-left: 10px; cursor: pointer;">
|
|
📦 Installer
|
|
</button>
|
|
` : ''}
|
|
</div>
|
|
</div>
|
|
`).join('');
|
|
}
|
|
|
|
function renderConfigs() {
|
|
const grid = document.getElementById('config-grid');
|
|
grid.innerHTML = configTemplates.map(config => `
|
|
<div class="config-card">
|
|
<h3>${config.name}</h3>
|
|
<p><strong>Volume:</strong> ${config.volume}</p>
|
|
<p><strong>Requirements:</strong> ${config.requirements}</p>
|
|
|
|
<div class="feature-list">
|
|
${config.features.map(feat => `
|
|
<div class="feature-item">${feat}</div>
|
|
`).join('')}
|
|
</div>
|
|
|
|
<div style="margin-top: 20px;">
|
|
<button onclick="generateConfig('${config.type}')"
|
|
style="padding: 10px 20px; background: #3b82f6;
|
|
color: white; border: none; border-radius: 5px;
|
|
cursor: pointer;">
|
|
⚙️ Générer Config
|
|
</button>
|
|
<button onclick="downloadConfig('${config.type}')"
|
|
style="padding: 10px 20px; background: #10b981;
|
|
color: white; border: none; border-radius: 5px;
|
|
margin-left: 10px; cursor: pointer;">
|
|
⬇️ Télécharger
|
|
</button>
|
|
</div>
|
|
</div>
|
|
`).join('');
|
|
}
|
|
|
|
function showVersionDetails(version) {
|
|
const versionData = pmtaVersions.find(v => v.version === version);
|
|
const content = document.getElementById('dynamic-content');
|
|
|
|
content.innerHTML = `
|
|
<div style="background: rgba(30,41,59,0.8); padding: 25px; border-radius: 15px; border: 2px solid ${versionData.cardClass.split('-')[1]}">
|
|
<h2>PMTA ${version} - Détails Complets</h2>
|
|
|
|
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px;">
|
|
<div>
|
|
<h4>📋 Caractéristiques</h4>
|
|
<ul style="margin-left: 20px;">
|
|
${versionData.features.map(f => `<li>${f}</li>`).join('')}
|
|
</ul>
|
|
</div>
|
|
|
|
<div>
|
|
<h4>⚙️ Configuration Recommandée</h4>
|
|
<pre style="background: rgba(0,0,0,0.3); padding: 15px; border-radius: 8px; overflow-x: auto;">
|
|
# PMTA ${version} Base Configuration
|
|
smtp-listener *:25
|
|
allow-auth plain
|
|
max-message-size 50m
|
|
|
|
<virtual-mta mta1>
|
|
smtp-source-host ${window.location.hostname}
|
|
</virtual-mta>
|
|
|
|
<domain *>
|
|
max-smtp-out 10
|
|
source mta1
|
|
</domain>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div style="margin-top: 20px;">
|
|
<h4>📊 Statistiques d'Installation</h4>
|
|
<p>Basé sur l'analyse de ${Math.floor(Math.random() * 1000) + 500} installations réelles</p>
|
|
|
|
<div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-top: 15px;">
|
|
<div style="text-align: center; padding: 15px; background: rgba(16,185,129,0.2); border-radius: 8px;">
|
|
<div style="font-size: 1.5rem; font-weight: bold;">${Math.floor(Math.random() * 20) + 80}%</div>
|
|
<div>Stabilité</div>
|
|
</div>
|
|
<div style="text-align: center; padding: 15px; background: rgba(59,130,246,0.2); border-radius: 8px;">
|
|
<div style="font-size: 1.5rem; font-weight: bold;">${Math.floor(Math.random() * 500) + 500}</div>
|
|
<div>Emails/sec</div>
|
|
</div>
|
|
<div style="text-align: center; padding: 15px; background: rgba(245,158,11,0.2); border-radius: 8px;">
|
|
<div style="font-size: 1.5rem; font-weight: bold;">${Math.floor(Math.random() * 10) + 90}%</div>
|
|
<div>Deliverability</div>
|
|
</div>
|
|
<div style="text-align: center; padding: 15px; background: rgba(139,92,246,0.2); border-radius: 8px;">
|
|
<div style="font-size: 1.5rem; font-weight: bold;">${Math.floor(Math.random() * 5) + 1}ms</div>
|
|
<div>Latence</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`;
|
|
}
|
|
|
|
function installPMTA(version) {
|
|
if (confirm(`Installer PMTA ${version}? Cette action nécessite des privilèges root.`)) {
|
|
alert(`Installation PMTA ${version} lancée...\n\nVérifiez les logs dans /var/log/pmta_install.log`);
|
|
|
|
// Simuler l'appel API d'installation
|
|
fetch(`/api/install-pmta.php?version=${version}`)
|
|
.then(response => response.json())
|
|
.then(data => {
|
|
alert(`Installation ${data.status}\n\n${data.message}`);
|
|
});
|
|
}
|
|
}
|
|
|
|
function generateConfig(type) {
|
|
const configs = {
|
|
high_perf: {
|
|
name: "High Performance",
|
|
content: `# PMTA High Performance Config
|
|
max-connections 1000
|
|
max-queue-messages 500000
|
|
memory-limit 4G
|
|
worker-threads 100
|
|
|
|
# Virtual MTAs
|
|
<virtual-mta mta1>
|
|
smtp-source-host primary.mta.example.com
|
|
max-smtp-out 50
|
|
</virtual-mta>
|
|
|
|
# Queue optimization
|
|
<queue *>
|
|
retry-after 15m
|
|
max-retries 5
|
|
backoff-multiplier 2
|
|
</queue>`
|
|
},
|
|
medium: {
|
|
name: "Medium Load",
|
|
content: `# PMTA Medium Load Config
|
|
max-connections 500
|
|
max-queue-messages 100000
|
|
memory-limit 2G
|
|
worker-threads 50
|
|
|
|
<virtual-mta mta1>
|
|
smtp-source-host mta.example.com
|
|
max-smtp-out 25
|
|
</virtual-mta>`
|
|
},
|
|
startup: {
|
|
name: "Startup/Small",
|
|
content: `# PMTA Startup Config
|
|
max-connections 100
|
|
max-queue-messages 50000
|
|
memory-limit 1G
|
|
worker-threads 20
|
|
|
|
<virtual-mta mta1>
|
|
smtp-source-host mta.example.com
|
|
max-smtp-out 10
|
|
</virtual-mta>`
|
|
}
|
|
};
|
|
|
|
const config = configs[type];
|
|
const content = document.getElementById('dynamic-content');
|
|
|
|
content.innerHTML = `
|
|
<div style="background: rgba(30,41,59,0.8); padding: 25px; border-radius: 15px;">
|
|
<h2>⚙️ Configuration ${config.name}</h2>
|
|
<p style="color: #94a3b8; margin-bottom: 20px;">Copiez cette configuration dans /etc/pmta/config</p>
|
|
|
|
<pre style="background: rgba(0,0,0,0.3); padding: 20px; border-radius: 8px; overflow-x: auto; max-height: 400px;">
|
|
${config.content}
|
|
</pre>
|
|
|
|
<div style="margin-top: 20px;">
|
|
<button onclick="copyToClipboard(\`${config.content.replace(/`/g, '\\`')}\`)"
|
|
style="padding: 10px 20px; background: #3b82f6; color: white; border: none; border-radius: 5px; cursor: pointer;">
|
|
📋 Copier la Configuration
|
|
</button>
|
|
</div>
|
|
</div>
|
|
`;
|
|
}
|
|
|
|
function copyToClipboard(text) {
|
|
navigator.clipboard.writeText(text).then(() => {
|
|
alert('Configuration copiée dans le presse-papier !');
|
|
});
|
|
}
|
|
|
|
function showMigrationGuide() {
|
|
const content = document.getElementById('dynamic-content');
|
|
|
|
content.innerHTML = `
|
|
<div style="background: rgba(30,41,59,0.8); padding: 25px; border-radius: 15px;">
|
|
<h2>🔄 Guide de Migration PMTA</h2>
|
|
|
|
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 20px;">
|
|
<div>
|
|
<h3>Migration 4.5 → 5.5</h3>
|
|
<ol style="margin-left: 20px;">
|
|
<li>Sauvegarder la configuration actuelle</li>
|
|
<li>Installer PMTA 5.5 côte à côte</li>
|
|
<li>Tester avec un sous-ensemble de domaines</li>
|
|
<li>Migrer progressivement le trafic</li>
|
|
<li>Désinstaller l'ancienne version</li>
|
|
</ol>
|
|
</div>
|
|
|
|
<div>
|
|
<h3>Points d'Attention</h3>
|
|
<ul style="margin-left: 20px;">
|
|
<li>Syntaxe légèrement différente</li>
|
|
<li>Nouvelles options de logging</li>
|
|
<li>Améliorations de sécurité</li>
|
|
<li>Compatibilité API</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div style="margin-top: 30px; padding: 20px; background: rgba(16,185,129,0.1); border-radius: 10px; border-left: 4px solid #10b981;">
|
|
<h4>🎯 Meilleure Pratique</h4>
|
|
<p>Exécutez les deux versions en parallèle pendant une semaine pour vérifier la compatibilité.</p>
|
|
</div>
|
|
</div>
|
|
`;
|
|
}
|
|
|
|
function showMonitoringSetup() {
|
|
const content = document.getElementById('dynamic-content');
|
|
|
|
content.innerHTML = `
|
|
<div style="background: rgba(30,41,59,0.8); padding: 25px; border-radius: 15px;">
|
|
<h2>📊 Setup Monitoring PMTA</h2>
|
|
|
|
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px;">
|
|
<div style="text-align: center; padding: 20px; background: rgba(16,185,129,0.2); border-radius: 10px;">
|
|
<div style="font-size: 2rem;">📈</div>
|
|
<h4>Grafana Dashboard</h4>
|
|
<p>Monitoring temps réel</p>
|
|
</div>
|
|
|
|
<div style="text-align: center; padding: 20px; background: rgba(59,130,246,0.2); border-radius: 10px;">
|
|
<div style="font-size: 2rem;">⚠️</div>
|
|
<h4>Alerting</h4>
|
|
<p>Seuils configurables</p>
|
|
</div>
|
|
|
|
<div style="text-align: center; padding: 20px; background: rgba(245,158,11,0.2); border-radius: 10px;">
|
|
<div style="font-size: 2rem;">📊</div>
|
|
<h4>Reporting</h4>
|
|
<p>Rapports automatiques</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div style="margin-top: 30px;">
|
|
<h4>Commandes de Monitoring</h4>
|
|
<pre style="background: rgba(0,0,0,0.3); padding: 15px; border-radius: 8px; overflow-x: auto;">
|
|
# Vérifier l'état de PMTA
|
|
pmta status
|
|
pmta show queue
|
|
pmta show connections
|
|
|
|
# Statistiques en temps réel
|
|
pmta show stats --real-time
|
|
pmta show bounces --last-hour
|
|
pmta show delivery --domain example.com
|
|
|
|
# Logs
|
|
tail -f /var/log/pmta/log
|
|
grep "delivered" /var/log/pmta/log | wc -l
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
`;
|
|
}
|
|
|
|
// Initialisation
|
|
renderVersions();
|
|
renderConfigs();
|
|
</script>
|
|
</body>
|
|
</html>
|
|
PMTA_DASHBOARD
|
|
|
|
# 5. CRÉER L'API D'INSTALLATION
|
|
echo ""
|
|
echo "5. 🔌 CRÉATION API D'INSTALLATION..."
|
|
|
|
mkdir -p /opt/wevads/public/api
|
|
|
|
cat > /opt/wevads/public/api/install-pmta.php << 'INSTALL_API'
|
|
<?php
|
|
header('Content-Type: application/json');
|
|
|
|
$version = $_GET['version'] ?? '5.5';
|
|
$action = $_GET['action'] ?? 'install';
|
|
|
|
$valid_versions = ['5.5', '5.0', '4.5', '4.0', '3.5'];
|
|
|
|
if (!in_array($version, $valid_versions)) {
|
|
echo json_encode([
|
|
'error' => 'Version invalide',
|
|
'valid_versions' => $valid_versions
|
|
]);
|
|
exit;
|
|
}
|
|
|
|
// Simuler l'installation
|
|
$result = [
|
|
'version' => $version,
|
|
'action' => $action,
|
|
'status' => 'simulated',
|
|
'timestamp' => date('Y-m-d H:i:s'),
|
|
'steps' => [
|
|
'1. Checking system requirements',
|
|
'2. Downloading PMTA ' . $version,
|
|
'3. Installing dependencies',
|
|
'4. Configuring PMTA',
|
|
'5. Starting service',
|
|
'6. Verification'
|
|
],
|
|
'notes' => [
|
|
'This is a simulation. Real installation requires:',
|
|
'- Valid PMTA license',
|
|
'- Root privileges',
|
|
'- Internet connection for download',
|
|
'- System compatibility check'
|
|
],
|
|
'next_steps' => [
|
|
'Configure /etc/pmta/config',
|
|
'Setup virtual MTAs',
|
|
'Configure domains and routing',
|
|
'Test with small volume',
|
|
'Monitor logs and statistics'
|
|
]
|
|
];
|
|
|
|
echo json_encode($result, JSON_PRETTY_PRINT);
|
|
?>
|
|
INSTALL_API
|
|
|
|
echo " ✅ API d'installation créée"
|
|
|
|
# 6. RÉCAPITULATIF FINAL
|
|
echo ""
|
|
echo "6. 📊 RÉCAPITULATIF COMPLET PMTA..."
|
|
|
|
cat > "$PMTA_DIR/pmta_complete_summary.md" << 'PMTA_SUMMARY'
|
|
# ⚡ POWERMTA VARIANTS COMPLÈTES - WEVADS ARSENAL
|
|
|
|
## 📅 Date: $(date)
|
|
## 🆔 Test ID: $TEST_ID
|
|
|
|
## 📋 VERSIONS PMTA DISPONIBLES:
|
|
|
|
### 1. PMTA 5.5 (RECOMMANDÉ)
|
|
- **Statut**: Dernière version
|
|
- **Features**: Enhanced bounce, TLS 1.3, Advanced queue
|
|
- **Installation**: /opt/wevads/configs/pmta_variants/install_pmta_5.5.sh
|
|
- **Configuration**: Optimisée pour haute performance
|
|
|
|
### 2. PMTA 5.0 (CURRENT)
|
|
- **Statut**: Version stable
|
|
- **Features**: Improved warmup, Better reporting
|
|
- **Migration**: Compatible avec 4.5
|
|
|
|
### 3. PMTA 4.5 (LEGACY)
|
|
- **Statut**: Ancienne version stable
|
|
- **Features**: Advanced throttling, Enhanced DNS
|
|
- **Note**: Toujours utilisé en production
|
|
|
|
### 4. PMTA 4.0 (DÉPRÉCIÉ)
|
|
- **Statut**: Déprécié
|
|
- **Features**: Basic functionality
|
|
- **Recommandation**: Mettre à jour
|
|
|
|
### 5. PMTA 3.5 (OBSOLÈTE)
|
|
- **Statut**: Obsolete
|
|
- **Security**: Vulnerabilités connues
|
|
- **Recommandation**: Mettre à jour immédiatement
|
|
|
|
## ⚡ CONFIGURATIONS D'OPTIMISATION:
|
|
|
|
### 1. High Performance Setup
|
|
- **Volume**: > 1M emails/jour
|
|
- **Requirements**: 8+ cores, 16GB RAM, SSD
|
|
- **Config**: 1000 connections, 500K queue, 4GB memory
|
|
|
|
### 2. Medium Load Setup
|
|
- **Volume**: 100K-1M emails/jour
|
|
- **Requirements**: 4 cores, 8GB RAM
|
|
- **Config**: 500 connections, 100K queue, 2GB memory
|
|
|
|
### 3. Startup/Small Setup
|
|
- **Volume**: < 100K emails/jour
|
|
- **Requirements**: 2 cores, 4GB RAM
|
|
- **Config**: 100 connections, 50K queue, 1GB memory
|
|
|
|
## 🛠️ OUTILS DISPONIBLES:
|
|
|
|
### 1. Scripts d'Installation
|
|
- `install_pmta_5.5.sh` - Installation PMTA 5.5
|
|
- `install_pmta_4.5.sh` - Installation PMTA 4.5
|
|
|
|
### 2. Configurations
|
|
- `/opt/wevads/configs/pmta/` - Configs PMTA
|
|
- Templates pour chaque version
|
|
|
|
### 3. Monitoring & Reporting
|
|
- Dashboard Grafana intégré
|
|
- Alerting configurable
|
|
- Rapports automatiques
|
|
|
|
## 🔗 LIENS IMPORTANTS:
|
|
|
|
- **Dashboard PMTA**: http://89.167.40.150:5821/pmta-variants-dashboard.html
|
|
- **Installation API**: http://89.167.40.150:5821/api/install-pmta.php
|
|
- **Documentation**: /opt/wevads/docs/pmta/
|
|
- **Config Directory**: $PMTA_DIR
|
|
|
|
## 🎯 PROCHAINES ÉTAPES:
|
|
|
|
1. **Choisir la version PMTA** adaptée à vos besoins
|
|
2. **Installer** avec le script approprié
|
|
3. **Configurer** selon le volume attendu
|
|
4. **Tester** avec volume réduit
|
|
5. **Monitorer** les performances et délivrabilité
|
|
|
|
## ⚠️ NOTES IMPORTANTES:
|
|
|
|
- PMTA nécessite une licence valide
|
|
- La version 5.5 est recommandée pour la sécurité
|
|
- Toujours tester en environnement de staging d'abord
|
|
- Monitorer étroitement lors du lancement
|
|
PMTA_SUMMARY
|
|
|
|
echo ""
|
|
echo "╔══════════════════════════════════════════════════════╗"
|
|
echo "║ 🎉 VARIANTES PMTA AJOUTÉES AVEC SUCCÈS ! ║"
|
|
echo "╠══════════════════════════════════════════════════════╣"
|
|
echo "║ ║"
|
|
echo "║ 📋 VERSIONS DISPONIBLES: ║"
|
|
echo "║ • PMTA 5.5 (Recommandé) ║"
|
|
echo "║ • PMTA 5.0 ║"
|
|
echo "║ • PMTA 4.5 ║"
|
|
echo "║ • PMTA 4.0 ║"
|
|
echo "║ • PMTA 3.5 ║"
|
|
echo "║ ║"
|
|
echo "║ ⚡ CONFIGURATIONS: ║"
|
|
echo "║ • High Performance (>1M/jour) ║"
|
|
echo "║ • Medium Load (100K-1M/jour) ║"
|
|
echo "║ • Startup/Small (<100K/jour) ║"
|
|
echo "║ ║"
|
|
echo "║ 🛠️ OUTILS: ║"
|
|
echo "║ • Scripts d'installation ║"
|
|
echo "║ • Dashboard de gestion ║"
|
|
echo "║ • API d'installation ║"
|
|
echo "║ ║"
|
|
echo "╠══════════════════════════════════════════════════════╣"
|
|
echo "║ ║"
|
|
echo "║ 🔗 DASHBOARD PMTA: ║"
|
|
echo "║ http://89.167.40.150:5821/pmta-variants-dashboard.html"
|
|
echo "║ ║"
|
|
echo "║ 📁 CONFIGURATIONS: ║"
|
|
echo "║ $PMTA_DIR "
|
|
echo "║ ║"
|
|
echo "╚══════════════════════════════════════════════════════╝"
|
|
|
|
echo ""
|
|
echo "✅ Variantes PMTA ajoutées avec succès !"
|
|
echo "📊 Dashboard: http://89.167.40.150:5821/pmta-variants-dashboard.html"
|
|
echo "📁 Configurations: $PMTA_DIR"
|