Skip to content

royalfork/ensmail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🅴🅽🆂mail 📨

ENSMail is an email forwarding service for the Ethereum Name System.

1. Send mail to <ANY_ENS_DOMAIN>@ensmail.org

ens-send

2. ENSMail.org forwards the mail to the ENSIP-5 Text/Email Record for <ANY_ENS_DOMAIN>.eth

ens-resolution

Try it out!

Technical Details

The ENSMail system consists of 2 components: the Maddy email server and a custom built ENS email resolution service (ENS service).

  • Maddy exposes a public SMTP endpoint (over STARTTLS, with DMARC, DKIM, and SPF mail verification).
  • Maddy forwards incoming mail to the ENS service over LMTP.
  • The ENS service looks up the mail's RCPT addresses in ENS (it queries text/email records).
  • ENS service rewrites the mails RCPT addresses with the email addresses found in ENS, and forwards the mail over LMTP to Maddy
  • Maddy receives the re-written mail and forwards it to the remote SMTP server (over STARTTLS, with DANE and MTA-STS server verification).

This diagram documents the SMTP/LMTP message flow for a successful mail forwarding session initiated by sender@example.com. ensmail-smtp-flow Note: Unlike conventional SMTP servers which maintain an outgoing mail-queue and retry logic for failed deliveries, ENSMail uses connection-stage rejection. If an incoming message can't be immediately forwarded to its ultimate destination, the message will be rejected.

Development

Development requires go1.17 or later. Run make test to run unit tests, and make build to build.

Integration tests are run with make test-full, but require the following binaries in $PATH:

  1. mkcert, to generate local TLS certificates.
  2. maddy.cover, a debug-enabled maddy executable required by the maddy testing suite.

Deployment

  1. Generate production TLS certificates (with Let's Encrypt, or otherwise), and set TLS_CERT_FILE=<path to cert> and TLS_KEY_FILE=<path to key> in configs/maddy.env.
  2. Set HTTP_WEB3_PROVIDER=<http endpoint> in configs/web3.env.
  3. Run sudo make install (this enables the ensmail service)
  4. Start with sudo systemctl start ensmail

Note: Additional system administration steps are required to run a production email system. Please read the maddy installation guide for further information.

About

Email for the Ethereum Name Service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published