1
0
Fork
You've already forked offlinemail
0
Email relaying via Secure ScuttleButt
  • Nim 100%
Find a file
Emery Hemingway cef3d1c442
merge clients to mailrelay, servers to mailedge
A networking-facing utilty and a user-facing utitily is more intuitive
than four special purpose utilities.
2017年03月05日 21:57:16 -06:00
src merge clients to mailrelay, servers to mailedge 2017年03月05日 21:57:16 -06:00
.gitignore merge clients to mailrelay, servers to mailedge 2017年03月05日 21:57:16 -06:00
COPYING smtpscuttle and scuttlesmtp utilites 2017年03月05日 21:57:12 -06:00
offlinemail.nimble merge clients to mailrelay, servers to mailedge 2017年03月05日 21:57:16 -06:00
README.md merge clients to mailrelay, servers to mailedge 2017年03月05日 21:57:16 -06:00

Offlinemail

On certain types of smaller nodes in the Internet it is often impractical to maintain a message transport system (MTS). For example, a workstation may not have sufficient resources (cycles, disk space) in order to permit a SMTP server [RFC821] and associated local mail delivery system to be kept resident and continuously running. Similarly, it may be expensive (or impossible) to keep a personal computer interconnected to an IP-style network for long amounts of time (the node is lacking the resource known as "connectivity").

RFC1939: Post Office Protocol - Version 3, May 1996

https://tools.ietf.org/html/rfc1939

This repository contains two utilities for relaying email via Secure Scuttlebutt. mailrelay publishes emails from IMAP to local a SSB feed and relays emails from a remote SSB feed to SMTP. mailedge serves emails from remote feed via POP3 and publishes emails to a local feed via SMTP.

The mailrelay tool is intended to be run periodically in an enviroment with persistent connectivity. The mailedge utility is for a user facing environment on the edge of a network, to be run concurrently with a standard email client.

Secure Scuttlebutt replicates feeds via opportunistic gossip and thus emails may be relayed in a sneakernet-like fashion where the SSB social network spans the relay to the edge.

For more information on Secure Scutttlebutt see https://scuttlebot.io/

SSB Message format

Emails are stored and replicated as binary blobs encrypted with SSB's multibox encryption. This allows messages to be viewable by multiple recipients.

Feed message

{
 "type": "rfc822",
 "mentions": [ { "link": "&..." }, ... ],
 "size": 1024
}

Type

Discriminates emails from other messages.

Mentions

List of references to blobs to be decrypted and concatenated.

Size

Size of plaintext email.

Message Disposition Notification

When a message has been forwarded from an SSB feed to an SMTP pipeline a notification will be published on the feed of the forwarding agent. This notification gives no assurance that the message will reach the intended recipient, but only indicates that a forwarding server was contacted and a transaction was completed successfully. This notification is published as a private post.

{
 "type": "rfc3798",
 "recps": [ @..., @... ],
 "mentions": [ %... ]
}

Type

Discriminates notifications from other messages.

Recps

SSB entities which may unbox this notification.

Mentions

List of message ids for emails that have been relayed.

Compability

Tested against the following:

IMAP servers

  • Dovecot

POP clients

  • Claws-mail
  • Thunderbird

TODO

  • Backup feed data in IMAP.
  • Full node rather than a client at the IMAP side.
  • DKIM verification.
  • Better SMTP relay notifications.

Install

Requires the Nim compiler and the included Nimble package manager.

git clone https://github.com/ehmry/offlinemail.git
cd offlinemail
nimble build