(also sorry if this is the wrong section, move if needed)
This document explores the possibility of eepsite-to-eepsite mails and a mail server for that purpose.
TL;DR:
- A server local-listens on POP/SMTP ports and connects via SAM.
- Both the sender and recipient have the mail server's dests in a "/.well-known/i2pmail.key" file (base64 plain) in their sites.
- The sender ('s server) uses the recipient's file to locate their server.
- The recipient uses the sender's file to verify the source of the message.
Requirements/Assumptions:
- (Someone's) Server = This (in theory) mail server/plugin
- Router = The I2P router covering the mail server (hosting the tunnels)
- The sender is Alice at alice@cryptogal.i2p
- The receiver is Bob at bob@thebuilder.i2p
- Both routers have their SAM ports open with the servers having a session with a persistent key.
- Both parties (in their respective sites) have this key saved as Base64 at "/.well-known/i2pmail.key". [^1]
- Both servers listen on POP [^2] and SMTP ports for localhost [^3] running at where a party would interact with.
- Both parties have no malicious addressbook entries.
- Alice sends a mail for Bob for bob@thebuilder.i2p.
- Alice's server "GET [thebuilder.i2p]/.well-known/i2pmail.key"s via SAM. [^1]
- Alice's server connects to the given destination (being Bob's mail server) and does a regular SMTP mail send operation. [^4]
- Bob's server (seeing "MAIL FROM" as alice@cryptogal.i2p),
- GETs "cryptogal.i2p/.well-known/i2pmail.key" [^1] and compares it to who SAM says this is.
- Compares the receiver to be itself (aka "thebuilder.i2p").
- (if configured) SpamAss/rspamd/whatever's in mail-filter category
- Bob's server tells "Mail accepted" to Alice's server and saves it for whenever Bob connects to the POP port for new mails.
- Filtering the mail headers should be done at sender's server.
- Integration with Postman's mail.i2p is just the server asking for mails every N hours. The configuration is up to the user.
- Clearnet mails (if configured like above) can be relayed to mail.i2p (or another "i2p<->clear" mail server, if anyone has/makes one up)
- (I think) Reach of this solution can be extended if it can be built into the router either as a plugin or alongside SusiMail, if SM can support that.
- When an eepsite is down and if it's maildest was...
- ...cached, then follow "use this stale until the eepsite comes back up".
- ...not cached, or there is no maildest at all, then it might be possible to use hostname-here@mail.i2p. But this would expose the problem of: "no account is registered with that eepsite's name, an attacker does so".
- If the mail couldn't be sent (possibly due to above) then the server would retry continuously while warning the user somehow (in the case of built-into-router, a warning message in the console).
- This document relies on addressbook-based hostnames for both recipient-lookups and sender-lookups. It's possible (and somewhat recommended) to use "b32.i2p" addresses on the SMTP messages [^5] but this document went too complex trying to transform it from it's hostname-based nature.
[^2]: This can be POP+IMAP or IMAP or anything, it's up to the implementation.
[^3]: This can be "0.0.0.0/any" or anything else but in my eyes this would be a security risk. Authentication and encryption is possible (of course) but this document is not about it. Not that you should access your anonymous mail over anything clearnet anyway.
[^4]: This is to let future implementations just use the standard SMTP protocol. This also lets the send/recv functionality to be a plugin for an existing SMTP solution (if any). Example: "if from/to regexp '.*i2p$' use plugin"
[^5]: Like "MAIL FROM/RCPT TO" being alice@abcdef.b32.i2p / bob@xyz123.b32.i2p