553 lines
28 KiB
SQL
553 lines
28 KiB
SQL
-- ======================================================
|
|
-- SCRIPT ALIMENTATION KB HAMID - WEVADS
|
|
-- Basé sur toutes les conversations Claude AI
|
|
-- ======================================================
|
|
|
|
-- ======================================================
|
|
-- PARTIE 1: chatbot_knowledge (Q&A rapides)
|
|
-- ======================================================
|
|
|
|
-- PowerMTA
|
|
INSERT INTO admin.chatbot_knowledge (category, question, answer, priority) VALUES
|
|
('PowerMTA', 'Comment installer PowerMTA sur un serveur?', 'Installation PowerMTA: 1) Télécharger le .deb depuis /opt/wevads/assets/pmta/, 2) dpkg -i powermta-X.X.deb, 3) Copier la licence dans /etc/pmta/license, 4) Configurer /etc/pmta/config, 5) service pmta start. Le script dans WEVADS > Servers Management > Install MTA fait tout automatiquement.', 10),
|
|
('PowerMTA', 'Où sont les fichiers de configuration PMTA?', 'Fichiers PMTA: /etc/pmta/config (principal), /etc/pmta/parameters/ (paramètres détaillés), /etc/pmta/vmtas/ (Virtual MTAs), /etc/pmta/dkim/ (clés DKIM), /etc/pmta/license (licence). Commandes: pmta reload (recharger), pmta show status (stats).', 9),
|
|
('PowerMTA', 'Comment créer un VMTA dans PMTA?', 'Un VMTA (Virtual MTA) se crée dans /etc/pmta/vmtas/: <virtual-mta vmta-name> smtp-source-host IP.IP.IP.IP hostname domain-key dkim,selector,/etc/pmta/dkim/domain.pem </virtual-mta>. Chaque VMTA = 1 IP source. Utilisez WEVADS > PMTA Management pour gérer visuellement.', 9),
|
|
('PowerMTA', 'Erreur PMTA hostname not found?', 'Erreur hostname PMTA: Éditez /etc/pmta/config et ajoutez: host-name mail.votredomaine.com. Assurez-vous que le hostname résout correctement (nslookup). Puis: service pmta restart.', 10),
|
|
('PowerMTA', 'Comment voir les queues PMTA en temps réel?', 'Commandes queues PMTA: pmta show queues (toutes les queues), pmta show topdomain (top domaines), pmta show status (stats globales), tail -f /var/log/pmta/acct.log (logs temps réel). Interface web PMTA sur port 8080 si activé.', 8),
|
|
('PowerMTA', 'PMTA ne démarre pas que faire?', 'Debug PMTA: 1) pmta check (vérifier syntaxe config), 2) cat /var/log/pmta/error.log, 3) Vérifier licence: cat /etc/pmta/license, 4) Port 25 libre: netstat -tlnp | grep 25, 5) Permissions: chown -R pmta:pmta /etc/pmta/. Si erreur licence, contacter Port25.', 10),
|
|
('PowerMTA', 'Comment configurer DKIM dans PMTA?', 'DKIM PMTA: 1) Générer clé: openssl genrsa -out /etc/pmta/dkim/domain.pem 2048, 2) Dans config: domain-key dkim,selector,/etc/pmta/dkim/domain.pem, 3) Extraire clé publique pour DNS: openssl rsa -in domain.pem -pubout. Ajouter TXT record: selector._domainkey.domain.com', 9),
|
|
('PowerMTA', 'Comment limiter la vitesse envoi PMTA?', 'Rate limiting PMTA dans /etc/pmta/config: max-smtp-out 10 (connexions simultanées), max-msg-rate 100/h (messages/heure par domaine). Pour Gmail: <domain gmail.com> max-msg-rate 50/h </domain>. Augmentez progressivement pendant le warmup.', 9),
|
|
('PowerMTA', 'Comment voir statistiques PMTA?', 'Stats PMTA: pmta show status (global), pmta show topdomain (par domaine), pmta show virtual-mta (par VMTA). Dashboard web si http-mgmt-port configuré. Logs: /var/log/pmta/acct.log (accounting), bounce.log (bounces).', 8),
|
|
('PowerMTA', 'Comment configurer backup MX PMTA?', 'Backup MX: Dans config PMTA, section <domain>: backoff-retry-after 5m, max-retries 10, backoff-max 1h. Le PMTA réessaie automatiquement les emails en queue deferred.', 7)
|
|
ON CONFLICT DO NOTHING;
|
|
|
|
-- Office 365
|
|
INSERT INTO admin.chatbot_knowledge (category, question, answer, priority) VALUES
|
|
('Office365', 'Comment créer un connecteur Office 365?', 'Connecteur O365: 1) Exchange Admin Center > Mail Flow > Connectors, 2) New: From Your org To Partner, 3) Smart host: votre IP PowerMTA, 4) TLS: Opportunistic, 5) Valider avec email test. Important: autoriser IP dans SPF du tenant. Limite: 10,000 emails/jour.', 10),
|
|
('Office365', 'Comment automatiser création comptes Office 365?', 'Workflow O365 WEVADS (8 étapes): 1) Récupération compte, 2) Test licence, 3) Créer credentials Azure AD, 4) Créer domaines FreeDNS, 5) Ajouter domaines O365, 6) Vérifier domaines DNS, 7) Config anti-spam, 8) Créer connecteur. Page: /office-workflow.php', 10),
|
|
('Office365', 'Erreur authentification SMTP Office 365?', 'Fix auth O365: 1) Désactiver Security Defaults dans Azure AD, 2) Activer SMTP AUTH: Set-CASMailbox -Identity user@domain.com -SmtpClientAuthenticationDisabled $false, 3) Si MFA activé, utiliser App Password. Host: smtp.office365.com:587 TLS.', 10),
|
|
('Office365', 'Quelles sont les limites Office 365?', 'Limites O365: 10,000 recipients/jour, 30 messages/minute, 500 recipients/message. Pour plus de volume: plusieurs comptes ou Exchange Online Plan 2. Warmup recommandé: commencer à 100/jour, augmenter 20% par semaine.', 8),
|
|
('Office365', 'Comment configurer DKIM Office 365?', 'DKIM O365: 1) PowerShell: New-DkimSigningConfig -DomainName domain.com -Enabled $true, 2) Récupérer les CNAME: Get-DkimSigningConfig, 3) Ajouter 2 CNAME dans DNS: selector1._domainkey et selector2._domainkey pointant vers onmicrosoft.com.', 9),
|
|
('Office365', 'Comment désactiver anti-spam Office 365?', 'Désactiver anti-spam O365 pour sending: Exchange Admin > Protection > Spam filter > désactiver. PowerShell: Set-HostedContentFilterPolicy -Identity Default -BulkThreshold 9. Attention: seulement pour comptes sending, pas réception.', 8),
|
|
('Office365', 'Comment ajouter domaine Office 365?', 'Ajouter domaine O365: 1) Admin Center > Settings > Domains > Add, 2) Entrer domaine, 3) Ajouter TXT record MS=msXXXXXX dans DNS, 4) Attendre propagation, 5) Vérifier. Le workflow WEVADS automatise tout cela.', 9),
|
|
('Office365', 'Comment créer credentials Azure AD?', 'Azure AD App: 1) Azure Portal > App registrations > New, 2) Nom: WEVADS, 3) API permissions: Mail.Send, User.Read, 4) Certificates > New client secret, 5) Copier App ID, Tenant ID, Secret. Utilisé pour Graph API.', 9)
|
|
ON CONFLICT DO NOTHING;
|
|
|
|
-- Tracking
|
|
INSERT INTO admin.chatbot_knowledge (category, question, answer, priority) VALUES
|
|
('Tracking', 'Comment fonctionne le tracking WEVADS?', 'Tracking WEVADS: Serveur dédié OVH 151.80.235.110. Pixels 1x1 pour opens ([open]), liens réécris pour clicks ([url]), désabonnements ([unsub]). Stats temps réel dans Dashboard > Statistics. Tables: actions.opens, actions.clicks, actions.unsubscribes.', 10),
|
|
('Tracking', 'Comment configurer domaine tracking?', 'Domaine tracking: 1) Créer A record pointant vers 151.80.235.110, 2) Dans WEVADS > Affiliates/Offers > Static Domain, entrer le domaine, 3) SSL auto avec Lets Encrypt. Format URLs: /op/ID (open), /cl/ID (click), /un/ID (unsub).', 9),
|
|
('Tracking', 'Opens pas trackés pourquoi?', 'Debug opens: 1) Vérifier pixel dans HTML: <img src="http://tracking.domain/[open]">, 2) Domaine tracking accessible?, 3) SSL valide?, 4) Content-Type: text/html dans headers. Test: curl -I http://votre-tracking/op/test123', 9),
|
|
('Tracking', 'Comment voir stats tracking?', 'Stats tracking: Dashboard > Statistics affiche opens, clicks, bounces temps réel. Filtres: campagne, date, domaine. Export CSV disponible. Tables PostgreSQL: actions.opens, actions.clicks, actions.leads, actions.unsubscribes.', 8),
|
|
('Tracking', 'Format URLs tracking?', 'Formats tracking WEVADS: Court: /op/53_md/1/166/7/0/0 (open), /cl/53_md/1/166/7/0/0 (click). Long: ?act=op&pid=X&uid=Y&vid=Z&ofid=W. Placeholders email: [open], [url], [unsub], [optout]. Redirection vers offre après tracking.', 8),
|
|
('Tracking', 'Comment configurer pixel open?', 'Pixel open: <img src="http://tracking.domain/[open]" width="1" height="1" border="0" style="display:none;">. Le [open] est remplacé par URL encodée contenant process_id, user_id, vmta_id, offer_id. Doit être en HTTP (pas HTTPS) pour certains clients.', 8),
|
|
('Tracking', 'Comment tracker les clicks?', 'Click tracking: <a href="http://tracking.domain/[url]">Lien</a>. Le serveur tracking log le clic puis redirige vers URL finale. Table actions.clicks stocke: ip, user_agent, timestamp, url_clicked.', 8)
|
|
ON CONFLICT DO NOTHING;
|
|
|
|
-- DNS/Deliverability
|
|
INSERT INTO admin.chatbot_knowledge (category, question, answer, priority) VALUES
|
|
('DNS', 'Comment configurer SPF correctement?', 'SPF Record: TXT @ "v=spf1 ip4:VOTRE_IP include:spf.protection.outlook.com ~all". Le SPF autorise les IPs à envoyer pour votre domaine. -all (strict) vs ~all (softfail). Vérifier: dig domain.com TXT | grep spf', 10),
|
|
('DNS', 'Comment configurer DMARC?', 'DMARC Record: TXT _dmarc "v=DMARC1; p=none; rua=mailto:dmarc@domain.com". Progression: p=none (monitor) -> p=quarantine -> p=reject. DMARC nécessite SPF et DKIM configurés. Rapports envoyés à adresse rua.', 9),
|
|
('DNS', 'Emails vont en spam que faire?', 'Anti-spam checklist: 1) SPF/DKIM/DMARC OK (tester mail-tester.com), 2) IP pas blacklistée (mxtoolbox.com/blacklists), 3) Contenu non-spammy (éviter URGENT, $$, majuscules), 4) Ratio texte/images équilibré, 5) Lien unsubscribe visible.', 10),
|
|
('DNS', 'Comment vérifier si IP blacklistée?', 'Check blacklist: mxtoolbox.com/blacklists, multirbl.valli.org. Si blacklisté: demander delisting sur le site de la blacklist. Nouveau warmup nécessaire après delisting.', 9),
|
|
('DNS', 'Comment configurer PTR reverse DNS?', 'PTR Record: Contactez votre hébergeur pour configurer le reverse DNS. Le PTR doit correspondre au hostname PMTA. Vérifier: dig -x IP.IP.IP.IP. Important pour Gmail et Microsoft.', 8),
|
|
('DNS', 'Comment configurer MX record?', 'MX Record: Type MX, Host @, Value mail.domain.com, Priority 10. Pour O365: domain-com.mail.protection.outlook.com. Vérifier: dig domain.com MX', 8),
|
|
('DNS', 'Comment vérifier propagation DNS?', 'Vérifier DNS: dig domain.com TXT (SPF), dig selector._domainkey.domain.com TXT (DKIM), dig _dmarc.domain.com TXT (DMARC). Outils: dnschecker.org, mxtoolbox.com. Propagation: 5min à 48h.', 7)
|
|
ON CONFLICT DO NOTHING;
|
|
|
|
-- Warmup
|
|
INSERT INTO admin.chatbot_knowledge (category, question, answer, priority) VALUES
|
|
('Warmup', 'Comment faire warmup IP?', 'Warmup IP: Semaine 1: 50 emails/jour, Semaine 2: 100/jour, Semaine 3: 200/jour, Semaine 4: 500/jour. Augmenter 20-30% par semaine. Mixer destinataires (Gmail, Yahoo, Outlook). Contenu varié. Surveiller bounces < 2%. Durée: 4-8 semaines.', 10),
|
|
('Warmup', 'Comment faire warmup Office 365?', 'Warmup O365: Jour 1-3: 50 emails/jour, Jour 4-7: 100/jour, Jour 8-14: 200/jour, puis +100/semaine jusqu a 10k/jour max. Contenu légitime, pas de spam. Activer engagement (réponses, clics) pour améliorer réputation.', 10),
|
|
('Warmup', 'Combien de temps dure warmup?', 'Durée warmup: 4-8 semaines selon volume cible. IP neuve = 4 semaines minimum. Tenant O365 = 2-4 semaines. Si bounce rate > 5% ou complaints > 0.1%, ralentir immédiatement.', 8),
|
|
('Warmup', 'Quel volume par jour pendant warmup?', 'Volume warmup progressif: J1-3: 50/jour, J4-7: 100/jour, J8-14: 200/jour, J15-21: 500/jour, J22-28: 1000/jour, J29+: 2000+/jour. Adapter selon bounces et complaints. Ne jamais augmenter de plus de 50% par semaine.', 9),
|
|
('Warmup', 'Quels providers cibler pendant warmup?', 'Mix warmup: Gmail 40%, Outlook/Hotmail 30%, Yahoo 20%, Autres 10%. Commencer par les plus engagés (ont déjà ouvert/cliqué). Éviter les cold lists au début. Privilégier opt-in double.', 8)
|
|
ON CONFLICT DO NOTHING;
|
|
|
|
-- WEVADS Interface
|
|
INSERT INTO admin.chatbot_knowledge (category, question, answer, priority) VALUES
|
|
('WEVADS', 'Comment lancer campagne email?', 'Lancer campagne: Production > Send Page: 1) Sélectionner serveurs/VMTAs, 2) Configurer offre (Affiliate Network, Creative), 3) Ajouter headers et body HTML, 4) Importer liste recipients, 5) Test avec Seeds dabord!, 6) Cliquer Send.', 10),
|
|
('WEVADS', 'Quels placeholders disponibles?', 'Placeholders WEVADS: [email] (destinataire), [domain] (domaine), [email_b64] (email encodé), [ip] (IP serveur), [server] (nom serveur), [an_5] (random 5 chars), [mail_date] (date), [open] (pixel), [url] (lien), [unsub] (désabonnement).', 9),
|
|
('WEVADS', 'Comment configurer headers email?', 'Headers email: MIME-Version: 1.0, Message-ID (avec placeholders), From: Name <email>, Subject (40-60 chars, éviter spam words), Reply-To, List-Unsubscribe (OBLIGATOIRE depuis 2024). Rotation possible avec Headers Rotation > 1.', 9),
|
|
('WEVADS', 'Où sont les logs WEVADS?', 'Logs WEVADS: /opt/wevads/storage/logs/ (app), /var/log/apache2/ (web), /var/log/pmta/ (PMTA). Backend Java: backend_errors.log. Commande: tail -f /opt/wevads/storage/logs/backend_errors.log', 8),
|
|
('WEVADS', 'Comment faire AB testing?', 'AB testing: Utilisez Headers Rotation et Subject Rotation. Créez plusieurs headers/sujets, définissez rotation > 1. Les stats permettront de comparer les performances par variante.', 8),
|
|
('WEVADS', 'Comment importer liste emails?', 'Import liste: Production > Lists > Import. Format CSV: email,firstname,lastname. Ou TXT: un email par ligne. Validation automatique format. Max 100k par import. Dédupe automatique.', 8),
|
|
('WEVADS', 'Comment configurer Amazon S3?', 'S3 WEVADS: Settings > S3 Configuration. Entrer Access Key, Secret Key, Bucket, Region (eu-north-1). Test upload. Utilisé pour images et pages HTML tracking. Évite filtres anti-spam.', 8)
|
|
ON CONFLICT DO NOTHING;
|
|
|
|
-- Infrastructure
|
|
INSERT INTO admin.chatbot_knowledge (category, question, answer, priority) VALUES
|
|
('Infrastructure', 'Quelle est architecture WEVADS?', 'Architecture WEVADS: Serveur principal 157.180.25.208 (PostgreSQL + PHP + Java), Tracking OVH 151.80.235.110, Serveurs PMTA (IPs dédiées), Amazon S3 (images/HTML). 3 apps: WEVADS (:5821), FMGAPP (:5822), BCGAPP (:5823). DB: adx_system, adx_clients.', 10),
|
|
('Infrastructure', 'Comment ajouter serveur PMTA?', 'Ajouter serveur PMTA: Servers Management > Add Server: IP, SSH credentials, provider. Puis Install MTA > sélectionner serveur > Proceed. Script installe PMTA, configure VMTA, DKIM automatiquement. Durée: 5-10 minutes.', 9),
|
|
('Infrastructure', 'Comment connecter PostgreSQL?', 'Connexion PostgreSQL: PGPASSWORD=admin123 psql -U admin -d adx_system. Bases: adx_system (config, users), adx_clients (campagnes, stats). Schémas: admin, production, actions, affiliate.', 8),
|
|
('Infrastructure', 'Comment créer serveurs Huawei Cloud?', 'Huawei Cloud: API dans FMGAPP ou standalone /opt/huawei-api/. Config: username IAM, password, domain_name, project_id, region (eu-west-101 Paris). Créer VPC, subnet, security group dabord.', 9),
|
|
('Infrastructure', 'Comment configurer Amazon S3?', 'S3 WEVADS: Bucket eu-north-1, utilisé pour héberger images et pages HTML tracking. Config dans Settings > S3 Configuration. URLs format: https://bucket.s3.region.amazonaws.com/file.', 8),
|
|
('Infrastructure', 'Quels ports utilisent les apps?', 'Ports WEVADS: 5821 (WEVADS principal), 5822 (FMGAPP), 5823 (BCGAPP), 5432 (PostgreSQL), 25 (SMTP PMTA), 8080 (PMTA web si activé). Firewall: ouvrir 5821-5823 pour accès web.', 7),
|
|
('Infrastructure', 'Comment backup la base PostgreSQL?', 'Backup PostgreSQL: pg_dump -U admin adx_system > backup_$(date +%Y%m%d).sql. Restore: psql -U admin adx_system < backup.sql. Automatiser avec cron: 0 2 * * * pg_dump... > /backups/', 8)
|
|
ON CONFLICT DO NOTHING;
|
|
|
|
-- Bounces
|
|
INSERT INTO admin.chatbot_knowledge (category, question, answer, priority) VALUES
|
|
('Bounces', 'Quels types de bounces existent?', 'Types bounces: Hard Bounce (5xx) = adresse invalide, supprimer immédiatement. Soft Bounce (4xx) = temporaire (boîte pleine, serveur down), réessayer 3 fois. Block = IP/domaine bloqué. FBL = plainte spam, désinscrire immédiatement.', 10),
|
|
('Bounces', 'Comment gérer les bounces?', 'Gestion bounces: Hard bounces = supprimer de la liste. Soft bounces = 3 tentatives max. Complaints/FBL = blacklist immédiat. Surveiller taux: < 2% bounces, < 0.1% complaints. Nettoyer listes régulièrement.', 9),
|
|
('Bounces', 'Où voir les bounces PMTA?', 'Bounces PMTA: tail -f /var/log/pmta/bounce.log, pmta show queues (voir deferred), Dashboard WEVADS > MTA Drops Monitor. Table PostgreSQL: actions.bounces avec type, reason, email.', 8),
|
|
('Bounces', 'Erreur 550 User unknown?', 'Erreur 550: Adresse email inexistante = Hard Bounce. Action: supprimer immédiatement de la liste. Cause: typo, compte supprimé, domaine invalide. Nettoyer base régulièrement.', 9),
|
|
('Bounces', 'Erreur 421 Too many connections?', 'Erreur 421: Trop de connexions simultanées. Réduire max-smtp-out dans PMTA config. Gmail limite à 10 connexions/IP. Attendre et réessayer automatiquement (soft bounce).', 8)
|
|
ON CONFLICT DO NOTHING;
|
|
|
|
-- Cloudflare
|
|
INSERT INTO admin.chatbot_knowledge (category, question, answer, priority) VALUES
|
|
('Cloudflare', 'Comment configurer domaine Cloudflare?', 'Cloudflare WEVADS: 1) Ajouter zone, 2) Créer A record vers IP serveur, 3) Créer MX, TXT (SPF, DKIM, DMARC). API utilisée pour automatisation dans office-workflow.php. Proxy désactivé pour email (DNS only).', 9),
|
|
('Cloudflare', 'Comment utiliser API Cloudflare?', 'API Cloudflare: Dans WEVADS, configurer compte Cloudflare (email + API key). Utilisé pour créer DNS automatiquement lors du workflow O365. Endpoints: zones, dns_records.', 8)
|
|
ON CONFLICT DO NOTHING;
|
|
|
|
-- FreeDNS
|
|
INSERT INTO admin.chatbot_knowledge (category, question, answer, priority) VALUES
|
|
('FreeDNS', 'Comment créer domaines FreeDNS?', 'FreeDNS: Sous-domaines gratuits pour tests. Workflow O365 crée automatiquement 5 sous-domaines par compte. Format: prefix.domain.freedns.org. Selenium utilisé pour CAPTCHA. Alternative: domaines propres.', 8)
|
|
ON CONFLICT DO NOTHING;
|
|
|
|
SELECT 'chatbot_knowledge alimenté!' as status;
|
|
SELECT COUNT(*) as total_qa FROM admin.chatbot_knowledge;
|
|
|
|
-- ======================================================
|
|
-- PARTIE 2: knowledge_base (Articles détaillés)
|
|
-- ======================================================
|
|
|
|
INSERT INTO admin.knowledge_base (title, category, content, author) VALUES
|
|
('Guide Complet Installation PowerMTA', 'PowerMTA',
|
|
'# Installation PowerMTA End-to-End
|
|
|
|
## Prérequis
|
|
- Serveur Ubuntu 20.04/22.04 ou CentOS 7/8
|
|
- IP dédiée avec PTR configuré
|
|
- Domaine avec accès DNS
|
|
|
|
## Étape 1: Installation du package
|
|
```bash
|
|
# Ubuntu/Debian
|
|
dpkg -i /opt/wevads/assets/pmta/5_0r3/PowerMTA-5.0r3.deb
|
|
|
|
# CentOS/RHEL
|
|
rpm -ivh /opt/wevads/assets/pmta/5_0r3/PowerMTA-5.0r3.rpm
|
|
```
|
|
|
|
## Étape 2: Configuration licence
|
|
```bash
|
|
cp /opt/wevads/assets/pmta/5_0r3/configs/license /etc/pmta/license
|
|
chmod 600 /etc/pmta/license
|
|
```
|
|
|
|
## Étape 3: Configuration principale
|
|
Fichier /etc/pmta/config:
|
|
```
|
|
postmaster postmaster@votredomaine.com
|
|
smtp-listener 0/0:25
|
|
host-name mail.votredomaine.com
|
|
|
|
<source 0/0>
|
|
always-allow-relaying yes
|
|
process-x-virtual-mta yes
|
|
</source>
|
|
```
|
|
|
|
## Étape 4: Virtual MTA
|
|
```
|
|
<virtual-mta mta1>
|
|
smtp-source-host 1.2.3.4 mail.domain.com
|
|
<domain *>
|
|
max-smtp-out 10
|
|
max-msg-rate 100/h
|
|
</domain>
|
|
</virtual-mta>
|
|
```
|
|
|
|
## Étape 5: Démarrage
|
|
```bash
|
|
pmta check
|
|
service pmta start
|
|
pmta show status
|
|
```
|
|
|
|
## Commandes utiles
|
|
- pmta show status - Stats globales
|
|
- pmta show queues - Queues actives
|
|
- pmta reload - Recharger config
|
|
- pmta show topdomain - Top domaines', 'Admin'),
|
|
|
|
('Configuration Complète SPF DKIM DMARC', 'Deliverability',
|
|
'# Guide Authentification Email
|
|
|
|
## SPF (Sender Policy Framework)
|
|
|
|
### Record DNS
|
|
```
|
|
Type: TXT
|
|
Host: @
|
|
Value: v=spf1 ip4:VOTRE_IP include:spf.protection.outlook.com ~all
|
|
```
|
|
|
|
### Mécanismes
|
|
- ip4: - Autoriser une IPv4
|
|
- include: - Inclure un autre SPF
|
|
- ~all - Softfail (recommandé)
|
|
- -all - Hardfail (strict)
|
|
|
|
## DKIM (DomainKeys Identified Mail)
|
|
|
|
### Générer les clés
|
|
```bash
|
|
mkdir -p /etc/pmta/dkim
|
|
openssl genrsa -out /etc/pmta/dkim/domain.pem 2048
|
|
openssl rsa -in /etc/pmta/dkim/domain.pem -pubout
|
|
```
|
|
|
|
### Config PMTA
|
|
```
|
|
domain-key dkim, selector, /etc/pmta/dkim/domain.pem
|
|
```
|
|
|
|
### Record DNS
|
|
```
|
|
Type: TXT
|
|
Host: selector._domainkey
|
|
Value: v=DKIM1; k=rsa; p=VOTRE_CLE_PUBLIQUE
|
|
```
|
|
|
|
## DMARC (Domain-based Message Authentication)
|
|
|
|
### Record DNS
|
|
```
|
|
Type: TXT
|
|
Host: _dmarc
|
|
Value: v=DMARC1; p=none; rua=mailto:dmarc@domain.com
|
|
```
|
|
|
|
### Progression DMARC
|
|
1. p=none (2 semaines) - Monitor uniquement
|
|
2. p=quarantine (2 semaines) - Spam si échec
|
|
3. p=reject - Rejeter si échec
|
|
|
|
## Vérification
|
|
- mail-tester.com - Score complet
|
|
- mxtoolbox.com - DNS checks
|
|
- dig domain.com TXT - Vérifier records', 'Admin'),
|
|
|
|
('Workflow Automatisation Office 365', 'Office365',
|
|
'# Automatisation Comptes Office 365 WEVADS
|
|
|
|
## Vue d ensemble
|
|
Le workflow en 8 étapes automatise la création et configuration des comptes O365 pour envoi emails.
|
|
|
|
## Étape 1: Récupération Compte
|
|
- Connexion au tenant existant
|
|
- Vérification des credentials
|
|
- Reset mot de passe si nécessaire
|
|
- Création admin backdoor
|
|
|
|
## Étape 2: Test Licence
|
|
- Vérifier type de licence (Business Basic, E3, etc.)
|
|
- Confirmer SMTP AUTH activé
|
|
- Vérifier quota mailbox
|
|
|
|
## Étape 3: Credentials Azure AD
|
|
- Créer App Registration
|
|
- Générer Client Secret
|
|
- Récupérer Tenant ID et App ID
|
|
- Permissions: Mail.Send, User.Read
|
|
|
|
## Étape 4: Créer Domaines FreeDNS
|
|
- Génération automatique 5 sous-domaines
|
|
- Pattern: prefix.maindomain.freedns.org
|
|
- DNS propagation automatique
|
|
|
|
## Étape 5: Ajouter Domaines O365
|
|
- Import domaines dans tenant
|
|
- Récupération TXT de vérification
|
|
- Format: MS=msXXXXXXXX
|
|
|
|
## Étape 6: Vérifier Domaines
|
|
- Création TXT records automatique
|
|
- Attente propagation DNS (10-60 sec)
|
|
- Validation dans O365
|
|
|
|
## Étape 7: Config Anti-Spam
|
|
- Désactiver Spam Filter outbound
|
|
- Désactiver Safe Links
|
|
- Désactiver Safe Attachments
|
|
- PowerShell automatisé
|
|
|
|
## Étape 8: Créer Connecteur
|
|
- Type: Partner Connector
|
|
- Smart Host: IP PowerMTA
|
|
- TLS: Opportunistic
|
|
- IP whitelist
|
|
|
|
## Page WEVADS
|
|
URL: /office-workflow.php?account_id=XXX
|
|
|
|
## Limites
|
|
- 10,000 emails/jour par tenant
|
|
- 30 messages/minute
|
|
- Warmup recommandé 4 semaines', 'Admin'),
|
|
|
|
('Plan Warmup IP et Tenant Détaillé', 'Email Marketing',
|
|
'# Guide Complet Warmup
|
|
|
|
## Warmup IP PowerMTA
|
|
|
|
### Semaine 1-2: Phase initiale
|
|
| Jour | Volume | max-smtp-out | max-msg-rate |
|
|
|------|--------|--------------|--------------|
|
|
| 1-2 | 50 | 2 | 10/h |
|
|
| 3-4 | 100 | 3 | 20/h |
|
|
| 5-7 | 200 | 5 | 40/h |
|
|
|
|
### Semaine 3-4: Montée en charge
|
|
| Jour | Volume | max-smtp-out | max-msg-rate |
|
|
|-------|--------|--------------|--------------|
|
|
| 8-10 | 500 | 8 | 80/h |
|
|
| 11-14 | 1000 | 10 | 150/h |
|
|
|
|
### Semaine 5+: Volume production
|
|
| Jour | Volume | max-smtp-out | max-msg-rate |
|
|
|--------|--------|--------------|--------------|
|
|
| 15-21 | 2000 | 15 | 300/h |
|
|
| 22-28 | 5000 | 20 | 500/h |
|
|
| 29+ | 10000+ | 25 | 1000/h |
|
|
|
|
## Warmup Office 365
|
|
|
|
### Calendrier
|
|
- Jour 1-3: 50 emails/jour
|
|
- Jour 4-7: 100 emails/jour
|
|
- Jour 8-14: 200 emails/jour
|
|
- Semaine 3: 500 emails/jour
|
|
- Semaine 4: 1000 emails/jour
|
|
- Mois 2+: jusqu a 10000/jour
|
|
|
|
## Règles d or
|
|
1. Contenu varié et légitime
|
|
2. Mix de providers (Gmail 40%, Outlook 30%, Yahoo 20%, Autres 10%)
|
|
3. Engagement positif (réponses, clics)
|
|
4. Surveiller bounces < 2%
|
|
5. Surveiller complaints < 0.1%
|
|
6. Si problème, RALENTIR immédiatement
|
|
|
|
## Monitoring
|
|
- Dashboard WEVADS > Statistics
|
|
- mail-tester.com score > 8/10
|
|
- mxtoolbox.com blacklist check
|
|
- Google Postmaster Tools', 'Admin'),
|
|
|
|
('Architecture Tracking WEVADS Complète', 'Tracking',
|
|
'# Système de Tracking Email WEVADS
|
|
|
|
## Architecture
|
|
```
|
|
Email envoyé → User ouvre → Pixel chargé → Serveur Tracking → API WEVADS → PostgreSQL
|
|
```
|
|
|
|
## Composants
|
|
|
|
### Serveur Tracking (OVH)
|
|
- IP: 151.80.235.110
|
|
- Stack: Nginx + PHP-FPM
|
|
- Scripts: index.php (routing), click.php, open.php
|
|
- SSL: Let''s Encrypt automatique
|
|
|
|
### Formats URL
|
|
|
|
#### Opens (Pixel 1x1)
|
|
```
|
|
http://tracking.domain/op/PROCESS_ID/USER_ID/VMTA_ID/OFFER_ID/LIST_ID/CLIENT_ID
|
|
```
|
|
|
|
#### Clicks
|
|
```
|
|
http://tracking.domain/cl/PROCESS_ID/USER_ID/VMTA_ID/OFFER_ID/LIST_ID/CLIENT_ID
|
|
```
|
|
|
|
#### Unsubscribe
|
|
```
|
|
http://tracking.domain/un/PROCESS_ID/USER_ID/VMTA_ID/OFFER_ID/LIST_ID/CLIENT_ID
|
|
```
|
|
|
|
## Placeholders Email
|
|
```html
|
|
<!-- Pixel Open -->
|
|
<img src="http://tracking.domain/[open]" width="1" height="1">
|
|
|
|
<!-- Lien avec tracking -->
|
|
<a href="http://tracking.domain/[url]">Click Here</a>
|
|
|
|
<!-- Unsubscribe -->
|
|
<a href="http://tracking.domain/[unsub]">Unsubscribe</a>
|
|
```
|
|
|
|
## Tables PostgreSQL
|
|
|
|
### actions.opens
|
|
- id, process_id, user_id, vmta_id, offer_id
|
|
- ip_address, user_agent, opened_at
|
|
|
|
### actions.clicks
|
|
- id, process_id, user_id, vmta_id, offer_id
|
|
- ip_address, user_agent, clicked_at, url
|
|
|
|
### actions.unsubscribes
|
|
- id, email, process_id, unsubscribed_at
|
|
|
|
## Configuration Domaine Tracking
|
|
1. A record vers 151.80.235.110
|
|
2. SSL automatique (Let''s Encrypt)
|
|
3. WEVADS > Settings > Tracking Domain', 'Admin'),
|
|
|
|
('Gestion Infrastructure Serveurs WEVADS', 'Infrastructure',
|
|
'# Infrastructure WEVADS Complète
|
|
|
|
## Serveurs Principaux
|
|
|
|
### Serveur Application (157.180.25.208)
|
|
- OS: Ubuntu 22.04
|
|
- Services: Apache, PostgreSQL 13, Java 11
|
|
- Apps: WEVADS (:5821), FMGAPP (:5822), BCGAPP (:5823)
|
|
- DB: adx_system, adx_clients
|
|
|
|
### Serveur Tracking (151.80.235.110)
|
|
- Provider: OVH
|
|
- OS: Ubuntu 22.04
|
|
- Services: Nginx, PHP-FPM 8.1
|
|
- Role: Opens, Clicks, Unsubscribes
|
|
|
|
### Serveurs PMTA
|
|
- Providers: Huawei Cloud, Digital Ocean, Linode
|
|
- Role: Envoi emails
|
|
- Config: 1 IP par VMTA
|
|
|
|
## Base de Données PostgreSQL
|
|
|
|
### Connexion
|
|
```bash
|
|
PGPASSWORD=admin123 psql -U admin -d adx_system
|
|
```
|
|
|
|
### Schémas
|
|
- admin: Configuration, users, servers, vmtas
|
|
- production: Campaigns, processes, drops
|
|
- actions: Opens, clicks, bounces, leads
|
|
- affiliate: Offers, networks, creatives
|
|
|
|
### Tables importantes
|
|
- admin.servers - Serveurs MTA
|
|
- admin.vmtas - Virtual MTAs
|
|
- admin.offers - Offres affiliates
|
|
- actions.clicks - Tracking clicks
|
|
- production.processes - Campagnes en cours
|
|
|
|
## Providers Cloud
|
|
|
|
### Huawei Cloud
|
|
- Region: eu-west-101 (Paris)
|
|
- API: /opt/huawei-api/ ou FMGAPP
|
|
- Config: IAM credentials
|
|
|
|
### Amazon S3
|
|
- Region: eu-north-1
|
|
- Usage: Images, pages HTML tracking
|
|
- Bucket: wevads-assets
|
|
|
|
## Maintenance
|
|
|
|
### Backup PostgreSQL
|
|
```bash
|
|
pg_dump -U admin adx_system > backup_$(date +%Y%m%d).sql
|
|
```
|
|
|
|
### Logs importants
|
|
- Apache: /var/log/apache2/error.log
|
|
- PMTA: /var/log/pmta/error.log
|
|
- WEVADS: /opt/wevads/storage/logs/backend_errors.log', 'Admin'),
|
|
|
|
('Troubleshooting Deliverability Email', 'Deliverability',
|
|
'# Guide Dépannage Délivrabilité
|
|
|
|
## Problème: Emails en Spam
|
|
|
|
### Checklist
|
|
1. SPF configuré et valide
|
|
2. DKIM configuré et signé
|
|
3. DMARC configuré
|
|
4. PTR/rDNS correct
|
|
5. IP pas blacklistée
|
|
6. Contenu non-spammy
|
|
7. List-Unsubscribe présent
|
|
|
|
### Outils diagnostic
|
|
- mail-tester.com - Score complet
|
|
- mxtoolbox.com/blacklists - Blacklists
|
|
- dmarcian.com - DMARC analyzer
|
|
- Google Postmaster Tools
|
|
|
|
## Problème: Bounces élevés
|
|
|
|
### Hard Bounces (5xx)
|
|
- 550 User unknown - Supprimer email
|
|
- 551 User not local - Vérifier domaine
|
|
- 552 Mailbox full - Soft, réessayer
|
|
|
|
### Soft Bounces (4xx)
|
|
- 421 Too many connections - Réduire rate
|
|
- 450 Mailbox unavailable - Réessayer
|
|
- 451 Temporary failure - Réessayer
|
|
|
|
### Actions
|
|
```bash
|
|
# Voir bounces PMTA
|
|
tail -f /var/log/pmta/bounce.log
|
|
|
|
# Queues deferred
|
|
pmta show queues | grep deferred
|
|
```
|
|
|
|
## Problème: IP Blacklistée
|
|
|
|
### Vérification
|
|
```bash
|
|
# Check multiples blacklists
|
|
for bl in zen.spamhaus.org bl.spamcop.net; do
|
|
host $IP.$bl
|
|
done
|
|
```
|
|
|
|
### Delisting
|
|
1. Identifier la blacklist
|
|
2. Aller sur leur site
|
|
3. Soumettre demande delisting
|
|
4. Attendre 24-48h
|
|
5. Nouveau warmup
|
|
|
|
## Problème: Gmail Spam
|
|
|
|
### Causes fréquentes
|
|
- Nouveau domaine/IP
|
|
- Volume trop rapide
|
|
- Contenu suspect
|
|
- Engagement faible
|
|
|
|
### Solutions
|
|
- Warmup progressif
|
|
- Contenu personnalisé
|
|
- Engagement (clics, réponses)
|
|
- Google Postmaster Tools', 'Admin')
|
|
|
|
ON CONFLICT DO NOTHING;
|
|
|
|
SELECT 'knowledge_base alimenté!' as status;
|
|
SELECT COUNT(*) as total_articles FROM admin.knowledge_base;
|
|
|
|
-- Résumé final
|
|
SELECT 'ALIMENTATION TERMINÉE!' as message;
|
|
SELECT
|
|
(SELECT COUNT(*) FROM admin.chatbot_knowledge) as total_qa,
|
|
(SELECT COUNT(*) FROM admin.knowledge_base) as total_articles;
|