mirror of
https://github.com/Lewsion/mta-sts.git
synced 2025-12-22 01:25:47 +00:00
3.1 KiB
3.1 KiB
MTA-STS Policy Template - Project Context
Project Overview
This is a template repository for hosting MTA-STS (Mail Transfer Agent Strict Transport Security) policy files on GitHub Pages. The project allows users to create and host their MTA-STS policy file (.well-known/mta-sts.txt) to secure email delivery by enforcing SMTP-over-TLS connections.
MTA-STS is a security standard that enables domain owners to declare their email server's support for encrypted SMTP connections. When properly configured, it mitigates man-in-the-middle attacks by instructing sending email servers to only connect via encrypted channels.
Repository Structure
.well-known/- Contains the MTA-STS policy file served at the well-known locationmta-sts.txt- The actual MTA-STS policy file that defines how email should be delivered
index.html- Redirects visitors to the MTA-STS policy file_config.yml- Jekyll configuration to include the.well-knowndirectory in buildsCNAME- Defines the custom domain for GitHub Pages- Various configuration and documentation files for GitHub Pages hosting
Key Files and Configuration
MTA-STS Policy File (.well-known/mta-sts.txt)
The current policy file contains:
version: STSv1
mode: enforce
mx: mx1.forwardemail.net
mx: mx2.forwardemail.net
max_age: 604800
This policy enforces encrypted connections to the specified MX servers for one week (604800 seconds).
Domain Configuration
- The
CNAMEfile points tomta-sts.lewsion.com, indicating the domain for which this MTA-STS policy is configured. - GitHub Pages serves this repository at that domain via DNS CNAME record.
Jekyll Configuration
_config.ymlincludes the.well-knowndirectory in the GitHub Pages build, which is necessary for the MTA-STS policy file to be served at the correct path.
Setup and Usage Instructions
- Fork or create a repository from this template
- Modify
.well-known/mta-sts.txtwith your own MX server details - Set up a CNAME DNS record pointing
mta-sts.yourdomain.comtoyourusername.github.io - Configure GitHub Pages with your custom domain
- Add a TXT DNS record
_mta-sts.yourdomain.comwith your policy ID to enable MTA-STS for your domain - Optionally configure TLS reporting with a
_smtp._tls.yourdomain.comTXT record
Development Conventions
- This is a static site that gets served via GitHub Pages
- The
.well-known/mta-sts.txtfile should follow RFC 8461 specification - Policy IDs in DNS TXT records need to be updated when the MTA-STS policy file changes
- The repository uses Jekyll for GitHub Pages hosting
Security Considerations
- The MTA-STS policy enforces TLS encryption for email delivery
- Proper domain validation is required to prevent unauthorized modification of MTA-STS policies
- The
max_agedirective controls how long the policy remains in effect before requiring re-verification
Testing and Validation
- Visit
https://mta-sts.yourdomain.comto verify the policy file is accessible - Use tools like MXToolBox MTA-STS Lookup or Hardenize to validate your implementation
- Monitor TLS reports if you implement the optional TLS reporting configuration