A comprehensive email server security scanner that checks domains for mail configuration issues and vulnerabilities. Similar to MXToolbox but as a command-line tool with detailed security analysis.
- SPF (Sender Policy Framework) - Validates SPF records and identifies configuration issues
- DMARC (Domain-based Message Authentication) - Analyzes DMARC policies and alignment settings
- DKIM (DomainKeys Identified Mail) - Discovers and validates DKIM selectors
- BIMI (Brand Indicators for Message Identification) - Checks for BIMI configuration
- MX Record Analysis - Validates mail exchanger records and priorities
- SMTP Connectivity Tests - Tests mail server availability and response times
- TLS/SSL Verification - Validates encryption protocols and certificate validity
- Open Relay Detection - Checks if servers are configured as open relays
- Authentication Method Analysis - Identifies supported SMTP authentication methods
- Blacklist Checking - Checks IPs against 40+ major email blacklists (Spamhaus, Barracuda, etc.)
- PTR Record Validation - Verifies reverse DNS configuration
- FCrDNS Verification - Validates Forward-Confirmed reverse DNS
- MTA-STS & TLSRPT - Checks for advanced security features
- Security Scoring - Provides an overall security score (0-100)
- Color-coded Console Output - Easy-to-read terminal reports
- JSON Export - Machine-readable output for automation
- Detailed Recommendations - Actionable steps to improve security
git clone https://github.com/karmahacker/mailinspect.git
cd mailinspect
pip install -r requirements.txt
python mailinspect.py yourdomain.compip install -e .
mailinspect yourdomain.compython mailinspect.py yourdomain.compython mailinspect.py yourdomain.com -vpython mailinspect.py yourdomain.com -o report.txtpython mailinspect.py yourdomain.com --json > report.jsonpython mailinspect.py yourdomain.com -v --json -o detailed_report.json╔══════════════════════════════════════════════════════════════╗
║ MailInspect v1.0 ║
║ Comprehensive Email Server Security Scanner ║
╚══════════════════════════════════════════════════════════════╝
[*] Starting comprehensive scan for example.com...
[*] Checking DNS records...
[*] Analyzing SPF configuration...
[*] Analyzing DMARC configuration...
[*] Searching for DKIM selectors...
[*] Testing 2 mail server(s)...
[*] Checking blacklist status...
[*] Checking additional security features...
[✓] Scan complete!
================================================================================
MAIL SERVER SECURITY REPORT
Domain: yourdomain.com
Scan Date: 2024-12-09 15:30:45
================================================================================
Overall Security Score: 75/100
EXECUTIVE SUMMARY
----------------------------------------
• SPF record is properly configured
• DMARC policy provides moderate protection (quarantine)
• DKIM signing is configured
• IP addresses are clean
DNS RECORDS
----------------------------------------
MX Records:
Priority Host
-------- ----
10 mail.yourdomain.com
20 mail2.yourdomain.com
SPF CONFIGURATION
----------------------------------------
Record: v=spf1 include:_spf.mailprovider.com ~all
Warnings:
⚠ ~all (softfail) is less secure than -all (hardfail)
Recommendations:
→ Add '-all' at the end to reject unauthorized senders
...
-
DNS Records
- MX record validation
- SPF record lookup and parsing
- DMARC record analysis
- DKIM selector discovery
- BIMI, MTA-STS, TLSRPT checks
-
SPF Validation
- Syntax validation
- Mechanism analysis
- DNS lookup count check
- Security policy evaluation
-
DMARC Analysis
- Policy enforcement level
- Alignment settings
- Reporting configuration
- Subdomain policies
-
Mail Server Tests
- SMTP connectivity
- STARTTLS support
- TLS version and cipher suites
- Certificate validation
- Open relay testing
- Authentication methods
-
Blacklist Checks
- 40+ major blacklists
- Reputation scoring
- Whitelist detection
- Python 3.7+
- Internet connectivity
- DNS resolution capability
This tool performs read-only operations and does not:
- Send any emails
- Modify any DNS records
- Store any sensitive data
- Perform authentication attempts
All tests are non-intrusive and similar to standard email server interactions.
If you encounter DNS resolution errors, ensure your system's DNS resolver is properly configured.
Some mail servers may be slow to respond. Use the -v flag for verbose output to see which tests are taking time.
No special permissions are required. The tool uses standard DNS queries and SMTP connections on default ports.
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
MIT License - See LICENSE file for details
This tool is for educational and security assessment purposes only. Always obtain proper authorization before scanning domains you do not own.
- Inspired by MXToolbox and similar online tools
- Built with Python and various security libraries
- Community contributions and feedback
