Mailpit¶
Mailpit est un outil de test email léger et rapide pour les développeurs. Il capture tous les emails sortants et fournit une interface web moderne.
Quick Start¶
cd mail-servers/mailpit
# Avec profil dev
docker compose --profile dev up -d
# Sans profil
docker compose up -d
Accès¶
- Web UI: http://localhost:8025
- SMTP: localhost:1025
Features¶
- Interface web moderne avec dark mode
- Prévisualisation mobile/tablet
- Test de compatibilité HTML email
- Mises à jour temps réel (WebSockets)
- Support pièces jointes
- Recherche et filtrage
- API REST pour automation
- Stockage persistant SQLite
Configuration¶
| Variable | Default | Description |
|---|---|---|
MAILPIT_UI_PORT |
8025 |
Port Web UI |
MAILPIT_SMTP_PORT |
1025 |
Port SMTP |
TZ |
UTC |
Timezone |
MP_MAX_MESSAGES |
5000 |
Messages max stockés |
Configuration Applications¶
Variables génériques¶
Laravel¶
MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
Symfony¶
Node.js (Nodemailer)¶
Django¶
Spring Boot¶
Intégration Docker Compose¶
Ajouter Mailpit à un projet existant :
services:
# Vos services...
mailpit:
image: axllent/mailpit:latest
profiles: [dev]
ports:
- "8025:8025"
- "1025:1025"
environment:
- TZ=Europe/Paris
- MP_SMTP_AUTH_ACCEPT_ANY=1
- MP_SMTP_AUTH_ALLOW_INSECURE=1
Démarrer avec :
API REST¶
# Lister les messages
curl http://localhost:8025/api/v1/messages
# Obtenir un message
curl http://localhost:8025/api/v1/message/{id}
# Supprimer tous les messages
curl -X DELETE http://localhost:8025/api/v1/messages
Alternatives¶
- Mailcatcher - Ruby-based
- MailHog - Go-based (archivé)
- Inbucket - Plateforme email jetable