MTA-STS Hosting
MailShield can host your MTA-STS policy, simplifying the deployment of strict transport security for email.
What is MTA-STS?
MTA-STS (Mail Transfer Agent Strict Transport Security) is a security standard that:
- Enforces TLS encryption for email delivery
- Prevents downgrade attacks
- Protects against man-in-the-middle attacks
- Requires certificates to be valid
Why Use MailShield Hosting?
Without MailShield
To deploy MTA-STS, you need:
- A DNS TXT record at
_mta-sts.yourdomain.com - A web server at
mta-sts.yourdomain.com - Valid HTTPS certificate
- Policy file at
/.well-known/mta-sts.txt - Ongoing maintenance and monitoring
With MailShield
MailShield handles:
- ✅ Policy file hosting
- ✅ HTTPS certificate management
- ✅ High availability
- ✅ Policy validation
- ✅ Monitoring and alerts
You only need:
- DNS records pointing to MailShield
Setting Up MTA-STS Hosting
Step 1: Configure Your Policy
- Navigate to Domain → MTA-STS
- Click Configure MTA-STS
- Set your policy options:
| Option | Description |
|---|---|
| Mode | testing or enforce |
| MX Hosts | Your mail servers |
| Max Age | Cache duration (seconds) |
Step 2: Add DNS Records
Add these DNS records:
TXT Record:
_mta-sts.yourdomain.com. TXT "v=STSv1; id=your-policy-id"CNAME Record:
mta-sts.yourdomain.com. CNAME mta-sts.mailshield.app.TIP
The policy ID should change whenever you update your policy. MailShield generates this automatically.
Step 3: Verify Configuration
- Click Verify in MailShield
- MailShield checks:
- DNS records are correct
- Policy is accessible
- Policy ID matches
- Status shows as "Active" when complete
Policy Options
Mode
| Mode | Behavior |
|---|---|
| testing | Senders should report failures but still deliver |
| enforce | Senders must use TLS or reject delivery |
Recommended approach:
- Start with
testingmode - Monitor TLS-RPT reports for failures
- Fix any issues discovered
- Switch to
enforcemode
MX Hosts
List the mail servers that should receive email:
mx: mail.yourdomain.com
mx: mail2.yourdomain.com
mx: *.mail.yourdomain.comImportant:
- Include all MX hosts
- Wildcards are supported (
*.example.com) - Hosts must match your MX records
Max Age
How long senders should cache the policy:
| Duration | Seconds | Use Case |
|---|---|---|
| 1 day | 86400 | Testing, frequent changes |
| 1 week | 604800 | Standard operation |
| 1 month | 2592000 | Stable configuration |
Recommendation: Start with 1 day during testing, increase after stabilization.
Policy File Format
MailShield generates and hosts a policy file like:
version: STSv1
mode: enforce
mx: mail.yourdomain.com
mx: mail2.yourdomain.com
max_age: 604800This file is served at:
https://mta-sts.yourdomain.com/.well-known/mta-sts.txtMonitoring
MailShield monitors your MTA-STS configuration:
Validation Checks
- DNS record exists and is correct
- Policy file is accessible
- Policy ID matches DNS record
- MX hosts match your actual MX records
- Certificate is valid
Alerts
Get notified when:
- Policy becomes inaccessible
- DNS record changes
- Policy ID mismatch detected
- Certificate issues arise
Updating Your Policy
When you need to change your MTA-STS policy:
- Update settings in MailShield
- MailShield generates a new policy ID
- Update your DNS TXT record with the new ID
- Wait for DNS propagation
- Senders will fetch the new policy
WARNING
Always update the DNS policy ID when changing the policy. Senders cache based on this ID.
TLS-RPT Integration
For complete visibility, also configure TLS-RPT:
_smtp._tls.yourdomain.com. TXT "v=TLSRPTv1; rua=mailto:YOUR-ID@reports.mailshield.app"This enables:
- Reports on TLS connection attempts
- Failure notifications
- Statistics on MTA-STS effectiveness
Troubleshooting
Policy Not Accessible
- Verify CNAME record is correct
- Check DNS propagation
- Ensure no conflicting A/AAAA records
Policy ID Mismatch
- Update DNS TXT record with current ID
- Wait for propagation (up to 48 hours)
- Re-verify in MailShield
MX Hosts Mismatch
- Update MX hosts in MailShield to match DNS
- Or update DNS MX records to match policy
- Use wildcards if needed
Certificate Errors
MailShield manages certificates automatically. If you see certificate errors:
- Verify CNAME is correct
- Wait for certificate provisioning
- Contact support if issues persist
Best Practices
- Start in testing mode to identify issues
- Configure TLS-RPT for visibility
- Monitor reports before enforcing
- Keep MX hosts updated when changing mail servers
- Use reasonable max_age - not too short, not too long