For more philosophy, please see:
If this were a commercial product, this section would be titled Marketing Requirements / Business Rules.
UDP stub notifications are allowed to be unreliable. In the worst case, if they get lost, the onus is on the receiver to poll.
The retrieval server always encrypts the message index before dumping it. The message index is encrypted to the PGP public key of the receiver. This makes it okay for anyone to request a message index, because only the actual receiver will be able to decrypt it. Anyone can request a message index. This may one day be superseded by SSL client side certificates.
The receiver's addressbook is the final authority on what mail the receiver reads. If a sender is whitelisted in the addressbook, mail will be read. If a sender is not in the addressbook, there is no guarantee the receiver will choose to poll it.
Every stub sender received by the stub listener MUST be conveyed to the receiver during a stublist notification download. This satisfies free-speech considerations: the receiver ISP who runs the stub listener SHOULD NOT perform spam filtering on the stublist. This does not mean that every actual stub goes to the receiver; the stublist MAY BE uniq'ed by sender, so that multiple stubs from one sender are reduced to a single stub in the stublist.
In the reference implementation, primary identifiers are 32-bit PGP key IDs. All participants, both senders and receivers, must have a PGP key ID if they want to receive mail. That said, the system makes it really easy for people to automatically create PGP keys.
Mapping from an email address to a sender-store URL is outside the scope of this architecture. There are a number of out-of-band ways to perform this mapping. They include:
Developer-only subversion access to the source repository is at svn://blizzard.pobox.com/stubmail
Public subversion access to source repository WILL BE at http://code.stubmail.com/svn/
We recommend that you install the latest version of GPG. Create a keypair for yourself.
XXX: Later, when you know what you're doing, you can add a uid whose comment field is set to your sender-side URL. Receivers will automatically poll you for mail by appending their PGP key ID to this URL.
The reference implementation requires a number of Perl modules. Fortunately, they are all in core.
The reference implementation requires a web server with CGI capability. We recommend Apache.
If you're casting about for a server to install all this on, we recommend Debian Linux.
Install the CGIs:
Install the daemons:
Create one of these configuration directories:
Populate your chosen configuration directory with:
Create the fileroot:
Create an addressbook:
These milestones describe individual components.
research prototype: in development, still being banged into shape; responsible developer is trying to get it internally consistent and working against his own codebase.
design: checked in; active developers are experimenting with it, arguing about design direction and implications for overall architecture, and getting the code to interoperate against other components.
development: other components depend on this code; it is accepted as part of the product architecture, and bugs are being found and patched.
testing: test suite has been written for component.
documentation: technical specification for the component describes it in enough detail to be independently reimplementable.
alpha release: component is used by primary developers, is documented, passes tests. Early adopters and friends of the project are invited to install and use it.
beta release: component is part of the stable release for the general public.
| Component | 20060409 | 20060415 |
|---|---|---|
| Overall | research prototype | design |
| perl library | needs to be refactored out of existing code | |
| smtp2stub proxy | design | |
| post_manager | development | |
| scribble to disk | ||
| stub sender | development | |
| stub listener | development | |
| stublist & message retriever | development | |
| stublist server | development | |
| native message dumper | development | |
| atom message view | design | |
| Thunderbird Integration | design | |
| cryptography in general | in discussion | research prototype |
During design phase, we code directly into the relevant component; when that code hits development, we move it to the library.
Input: RFC2822 message over RFC2821 submission on port 25 or 587. Message may be plaintext or PGP encrypted.
Actions: submits message to the post_manager.
Actions: If the receiver is not stub-capable, send message using SMTP, with the message index URL in the headers.
Actions: If the receiver is stub-capable, does not send message using SMTP.
Input: well-formed HTTP submission
Returns:
Actions: always writes message to disk. returns in disk_write.
Actions: if receiver accepts stubs, sends stub notification. returns receiver_accepts_stubs.
Crypto: if receiver has no key, and message is not marked public, spontaneously generates PGP keypair, encrypts the message, and emails the receiver the private and public keypair.
Implementation note: In the reference implementation, when writing an outbound message file, the post manager touches all parent directories up to the /S/ directory. This makes it easier for the retrieval server to support the since parameter.
This discovery protocol is in design phase.
Problem: Given a receiver email address, is that receiver stub-capable?
Possible Answers:
Considerations: One end-user at a domain may have a stub-capable mail reader, but another end-user may not.
Discovery Protocol:
Proposal: meng proposes 20060420 that the bits of the class field should be interpreted as follows:
The Stublist Dumper operates at the receiver end. The Retriever Client asks it for stubs received since the last time that Retriever polled for a stublist.
In the reference implementation, it is a CGI.
The Retriever Client operates at the receiver end. It connects to one or more receiver-side Stublist Servers and polls for stubs. Informed by the addressbook, by the stubs received, and by the time elapsed since last it ran, it connects to zero or more sender-side Retrieval Servers and polls for sent messages.
The reference implementation offers two Retriever Clients.
http2mbox queries stublist servers, queries Retrieval Servers using the Simple Format Protocol, sucks down new mail, and outputs an RFC2822 mbox to STDOUT. It is suitable for Unix-style mail retrieval. It reads and writes to ~/.stubmail-addressbook.
We also offer a set of patches to Thunderbird. Our patched Thunderbird queries Retrieval Servers using the ATOM/XML protocol and displays messages directly in the Thunderbird GUI. Instead of using ~/.stubmail-addressbook, this approach subscribes to multiple senders directly using Thunderbird's native RSS code.
The Retrieval Server operates at the sender end.
The Retrieval Server represents the sender's outbox via the HTTP Message Retrieval API. It offers sent messages to the retriving receiver.
In the reference implementation, it is a CGI.
We generally follow the spirit of REST, adapted to our needs.
In general, messages from a sender S to a receiver R are available under the tree /mailroot/S/R/.
Note that /S/R/ trees are encrypted. This means that all fetches against /S/R/ and its subtrees are encrypted against the receiver R's public key.
Public messages are available under the special tree /mailroot/S/public/. The string "public" is literal. The /public/ tree is unencrypted.
The reference implementation stores messages on disk under /mailroot/S/R/YYYY/MM/DD.
In the reference implementation, S and R are long-form PGP public key IDs.
20060420-16:37:17 mengwong@newyears:~% gpg --keyid-format=short --list-keys mengwong pub 1024D/5A83DCB4 1998-06-16 uid Meng Weng Wongsub 2048g/192B0C49 1998-06-16 20060420-16:37:20 mengwong@newyears:~% gpg --keyid-format=long --list-keys mengwong pub 1024D/66E62E505A83DCB4 1998-06-16 uid Meng Weng Wong sub 2048g/2C0CBC52192B0C49 1998-06-16 20060420-16:37:28 mengwong@newyears:~% gpg --with-colons --list-keys mengwongtru::1:1144625328:1260045786:3:1:5 pub:u:1024:17:66E62E505A83DCB4:1998-06-16:::u:Meng Weng Wong ::scaESCA: sub:u:2048:16:2C0CBC52192B0C49:1998-06-16::::::e:
The /S/R/ convention is not a hard requirement; a Stubmail sender server may construct any URL it wishes, as long as that URL represents a unique sender/receiver pair. So a Stubmail sender server may construct a URL containing an opaque string meaningful only to itself.
| A GET against... | returns a... | with content-type... | the data is encrypted to... | ||||
|---|---|---|---|---|---|---|---|
| /mailroot/S/R/ | PGP-encrypted message index | application/pgp-encrypted | S and R | ||||
| /mailroot/S/ | PGP-encrypted message index | application/pgp-encrypted | S | ||||
| /mailroot/S/public/ | plaintext message index | text/plain | plaintext | ||||
| /mailroot/S/meta/ | metadata index | text/plain | plaintext |