Email Deliverability & DNS Analysis Tool
MXLab is a comprehensive, self-hosted alternative to mail-tester.com for analyzing email configuration and deliverability.
- Generate temporary test email addresses
- Receive and analyze emails via built-in SMTP server
- Check SPF, DKIM, DMARC authentication
- Verify email headers and content
- Score-based deliverability rating (0-10)
- MX Lookup: Find mail servers with resolved IP addresses
- SPF Lookup: Recursive SPF record analysis with include resolution
- DKIM Lookup: Check multiple common selectors automatically
- DMARC Lookup: Parse and display DMARC policies
- SMTP Connectivity: Full connection logs with HELO/EHLO testing
- Autodiscover: Check Exchange/Outlook autodiscover with SSL certificate validation
- Blacklist Check: Monitor IP reputation across major blacklists
- DNS Records: A, AAAA, NS, TXT, CNAME, SOA lookups
- Real-time streaming results (Server-Sent Events)
- Progressive loading UI
- Persistent reports with shareable URLs
- Optional Telegram notifications
- Docker deployment ready
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DOCKER COMPOSE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββ β
β β MXLab Container β β MongoDB Container β β
β β β β β β
β β βββββββββββββββββββββββββββββββββββ β β βββββββββββββββββββββ β β
β β β Flask Web Server β β β β reports DB β β β
β β β (port 5000) β β β β β β β
β β β β β β β - email_test β β β
β β β / β Web UI β β β β - domain_lookup β β β
β β β /report/<id> β Report Page ββββββββββββΊβ β β β
β β β /api/* β REST API β β β βββββββββββββββββββββ β β
β β βββββββββββββββββββββββββββββββββββ β β β β
β β β β mongodb:27017 β β
β β βββββββββββββββββββββββββββββββββββ β βββββββββββββββββββββββββββ β
β β β aiosmtpd SMTP Server β β β
β β β (port 25) β β βββββββββββββββββββββββββββ β
β β β β β β Telegram API β β
β β β Receives test emails β β β (optional) β β
β β β Triggers analysis βββββββββΊβ β β
β β β Stores results β β β Notifications on: β β
β β βββββββββββββββββββββββββββββββββββ β β - Email received β β
β β β β - Domain report done β β
β βββββββββββββββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β :8080 β :25
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Web Browser β β External Mail Servers β
β β β β
β - Generate β β Sender MTA βββΊ SMTP βββΊ MXLab βββΊ Analysis βββΊ Report β
β test email β β β
β - View reports β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β - DNS lookups β
βββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DATA FLOW β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β MXtest (Email Analysis): β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ βββββββββ β
β β Generate βββββΊβ Send βββββΊβ Receive βββββΊβ Analyze βββββΊβ Store β β
β β Address β β Email β β SMTP β β Email β β Reportβ β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ βββββββββ β
β β β β
β βΌ βΌ β
β βββββββββββ ββββββββββ β
β βTelegram β βMongoDB β β
β β Notify β β β β
β βββββββββββ ββββββββββ β
β β
β MXlab Lookup (DNS Analysis): β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β Enter βββββΊβ Query βββββΊβ Stream βββββΊβ Store β β
β β Domain β β DNS β β Results β β Report β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β β β
β βΌ βΌ β
β βββββββββββββββββββ βββββββββββββββ β
β β MX, SPF, DKIM, β β /report/<id>β β
β β DMARC, SMTP, β β Permanent β β
β β Blacklist, etc. β β URL β β
β βββββββββββββββββββ βββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Clone the repository:
git clone https://github.com/igrbtn/mxlab_pub.git
cd mxlab_pub- Create environment file:
cp .env.example .env- Edit
.envand set your domain:
DOMAIN=mxlab.yourdomain.com- Build and run:
docker-compose up -d- Access the web interface at
http://localhost:8080
- Install Python 3.8+ and dependencies:
pip install -r requirements.txt- Set environment variables:
export DOMAIN=mxlab.yourdomain.com
export SMTP_PORT=25
export WEB_PORT=5000- Run the application:
python app.py| Variable | Default | Description |
|---|---|---|
DOMAIN |
localhost |
Your server's domain name |
SMTP_PORT |
25 |
SMTP server port |
WEB_PORT |
5000 |
Web interface port |
MONGO_URI |
mongodb://mongodb:27017/ |
MongoDB connection string |
TELEGRAM_BOT_TOKEN |
(empty) | Optional: Telegram bot token for notifications |
TELEGRAM_CHAT_ID |
(empty) | Optional: Telegram chat ID for notifications |
For full functionality, configure these DNS records for your domain:
# A record for web access
mxlab.yourdomain.com A YOUR_SERVER_IP
# MX record to receive test emails
mxlab.yourdomain.com MX 10 mxlab.yourdomain.com
Ensure these ports are open:
- 25 (SMTP) - For receiving test emails
- 8080 (or your configured port) - Web interface
- Open the MXLab web interface
- Click "Generate Test Email Address"
- Send an email from your mail server to the generated address
- View the analysis results including:
- Overall score (0-10)
- SPF verification
- DKIM signature check
- DMARC compliance
- Header analysis
- Content review
- Switch to the "MXlab Lookup" tab
- Enter a domain name
- Click "Full Domain Report"
- View progressive results as each check completes
For production, consider:
- Reverse Proxy: Use nginx/traefik with SSL termination
- Port 25: Many cloud providers block port 25; you may need a VPS
- PTR Record: Set up reverse DNS for your server IP
- Firewall: Restrict access as needed
Example nginx configuration:
server {
listen 443 ssl;
server_name mxlab.yourdomain.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache_bypass $http_upgrade;
}
}To receive notifications when emails are tested or domain reports are generated:
- Create a Telegram bot via @BotFather
- Get your chat ID (send a message to @userinfobot)
- Add to your
.env:
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id| Endpoint | Method | Description |
|---|---|---|
/api/generate |
POST | Generate test email address |
/api/check/<test_id> |
GET | Check if email received |
/api/results/<test_id> |
GET | Get full analysis results (JSON) |
/report/<test_id> |
GET | View report page (HTML) |
/api/tools/<tool>?query=<domain> |
GET | Run individual DNS tool |
/api/tools/report?query=<domain> |
GET | Full domain report (JSON) |
/api/tools/report/stream?query=<domain> |
GET | Streaming domain report (SSE) |
mx, dns, txt, spf, dkim, dmarc, ptr, blacklist, ns, soa, cname, aaaa
- Backend: Python, Flask, aiosmtpd
- Database: MongoDB (persistent reports)
- DNS: dnspython
- DKIM: dkimpy
- Frontend: Vanilla JavaScript, CSS
- Deployment: Docker Compose
MIT License - See LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
For issues and feature requests, please use the GitHub issue tracker.