This article provides a technical reference for testing, validating, and troubleshooting SMTP relay configurations. It is intended for IT professionals, system administrators, and support engineers responsible for mail servers, application mail delivery, monitoring systems, and security enforcement.
The guide covers:
SMTP relay fundamentals
Diagnostic methodology
Command-line testing techniques
Common failure scenarios
Security risks & hardening
Best practices
SMTP relay is the process by which an SMTP server accepts email from a client/system and forwards it to another mail server for final delivery.
Relaying may occur:
Between internal systems and external domains
Between mail gateways
From applications to mail servers
Via authenticated or IP-based trust
Typical mail flow:
Application / Client β SMTP Relay Server β Destination Mail Server β Recipient
Key components:
SMTP Client (MUA / App / Device)
SMTP Relay / Smart Host
DNS / MX Resolution
Destination MTA
SMTP servers regulate relay using:
| Mechanism | Description |
|---|---|
| IP Whitelisting | Allows trusted source IPs |
| SMTP Authentication | Username/password validation |
| TLS Enforcement | Secure session requirement |
| Policy Restrictions | Domain/user-based rules |
SMTP relay may enforce:
Rate limits
Recipient restrictions
Sender restrictions
TLS requirements
Spam filtering
Greylisting
SMTP relay is commonly used in:
Enterprise mail gateways
Application servers
Printers / scanners
Cloud mail services
Monitoring / alert systems
Backup mail routing
When validating SMTP relay, test:
β TCP connectivity
β SMTP handshake
β Authentication
β TLS negotiation
β MAIL FROM / RCPT TO acceptance
β Relay permissions
β Message submission
Expected:
TcpTestSucceeded : True
Failure indicates:
Firewall block
ISP port filtering
Incorrect hostname/port
Expected response:
Test commands:
Validate:
Certificate chain
TLS negotiation
Cipher suites
Swaks = Preferred diagnostic tool
Example:
Validates:
β Authentication
β TLS
β Relay permissions
β SMTP conversation
Check:
SMTP host
Port
Encryption method
Authentication method
Credentials
Sender address format
Server reachable
Correct port
TLS policy satisfied
Auth accepted
MAIL FROM accepted
RCPT TO accepted
DATA accepted
No relay denial
Example:
Root Causes:
IP not trusted
Missing authentication
Incorrect relay policy
Fix:
β Enable SMTP auth
β Add IP to whitelist
β Review relay restrictions
Root Causes:
Incorrect credentials
Disabled SMTP auth
Wrong auth mechanism
Fix:
β Verify username/password
β Check auth method (LOGIN / PLAIN / CRAM-MD5)
β Enable SMTP AUTH
Root Causes:
Firewall block
ISP port filtering
Wrong port
Fix:
β Test via PowerShell / nc
β Verify outbound rules
β Try port 587 instead of 25
Fix:
β Enable TLS in client/app
β Use STARTTLS port (587)
Root Causes:
Expired certificate
Hostname mismatch
Missing intermediate CA
Fix:
β Renew certificate
β Correct FQDN
β Install CA chain
Check mail server logs:
Review:
Connection attempts
Auth failures
TLS negotiation errors
Policy rejections
An improperly configured relay server may allow:
Spam abuse
Blacklisting
Reputation damage
Test for open relay:
Without TLS:
Credentials transmitted in plaintext
Vulnerable to interception
Mitigation:
β Enforce TLS
β Disable insecure auth methods
Mitigation:
β Rate limiting
β Fail2ban / IDS
β Strong password policy
β Always require SMTP Authentication OR IP Trust
β Enforce TLS encryption
β Disable legacy auth where possible
β Implement rate limits
β Monitor SMTP logs
β Validate reverse DNS (PTR records)
β Avoid port 25 dependency for outbound mail
β Use port 587 (submission)
β Regularly test relay functionality
β Maintain certificate validity
SMTP relay failures typically arise from:
Network restrictions
Authentication issues
TLS misconfiguration
Relay policy enforcement
A structured diagnostic approach using:
Connectivity testing
SMTP handshake validation
TLS verification
Swaks testing
provides reliable root cause identification.