All code is provided as is under the terms of the GNU General Public License,
Version 3 (see LICENSE.txt); see also NOTICE.txt
Licences and terms of use of incorporated subprojects may differ.
This code is intended only as a demonstrator any should not be used in
production.

Compiling:

  This project uses maven as its build system.
  * Download, compile and install jTorProxy [1] into your local maven repository
  * compile and install this project (mvn install)
  * cd dmail
  * mvn compile assembly:single

Setup:
Prior to deploying a decentralised e-mail service, cryptographic material needs
to be created.

To do so, invoke
  java -cp dmail-jar-with-dependencies.jar at.tugraz.iaik.asit.dmail.Setup -u
  <username> -p <password> -o <cryptographic-material-file-to-be-written>

Once done, start each instance once for one minute and note the hidden service
IDs:
  java -jar dmail-jar-with-dependencies.jar -i <local-imap-port> -s
  <local-smtp-port> -d <hidden-service-working-dir> -p <hidden-service-port> -c
  <cryptographic-material-file> -r <mailbox-root-dir>

Finally, start each instance specifying the other nodes' hidden service
identifiers as well:
  java -jar dmail-jar-with-dependencies.jar -i <local-imap-port> -s
  <local-smtp-port> -d <hidden-service-working-dir> -p <hidden-service-port> -c
  <cryptographic-material-file> -r <mailbox-root-dir> -h <local-hostname> -n
  <id1:port1> -n <id2:port2> ... -n <idN:portN>

As e-mail heavily depends on the domain name system, one node must act as a
gateway to the outside world. All other nodes must be invoked using the -g
switch.
Nodes started without -g will only operate as gateways and cannot be used as
local instances. Gateway nodes also do not feature persistent storage.

It takes about a minute for each node to be fully ready. Afterwards any e-mail
client can be used to connect to an instance running locally.
Messages are distributed among all nodes, outgoing mail is routed through the
gateway, as is incoming mail.

[1] https://github.com/ManfredKarrer/jtorproxy
