]> pere.pagekite.me Git - homepage.git/blob - blog/data/2014-11-10-freedombox-smtorp.txt
Ønsker meg radonmåler.
[homepage.git] / blog / data / 2014-11-10-freedombox-smtorp.txt
1 Title: A Debian package for SMTP via Tor (aka SMTorP) using exim4
2 Tags: english, debian, freedombox, surveillance, personvern
3 Date: 2014-11-10 13:40
4
5 <p>The right to communicate with your friends and family in private,
6 without anyone snooping, is a right every citicen have in a liberal
7 democracy. But this right is under serious attack these days.</p>
8
9 <p>A while back it occurred to me that one way to make the dragnet
10 surveillance conducted by NSA, GCHQ, FRA and others (and confirmed by
11 the whisleblower Snowden) more expensive for Internet email,
12 is to deliver all email using SMTP via Tor. Such SMTP option would be
13 a nice addition to the FreedomBox project if we could send email
14 between FreedomBox machines without leaking metadata about the emails
15 to the people peeking on the wire. I
16 <a href="http://lists.alioth.debian.org/pipermail/freedombox-discuss/2014-October/006493.html">proposed
17 this on the FreedomBox project mailing list in October</a> and got a
18 lot of useful feedback and suggestions. It also became obvious to me
19 that this was not a novel idea, as the same idea was tested and
20 documented by Johannes Berg as early as 2006, and both
21 <a href="https://github.com/pagekite/Mailpile/wiki/SMTorP">the
22 Mailpile</a> and <a href="http://dee.su/cables">the Cables</a> systems
23 propose a similar method / protocol to pass emails between users.</p>
24
25 <p>To implement such system one need to set up a Tor hidden service
26 providing the SMTP protocol on port 25, and use email addresses
27 looking like username@hidden-service-name.onion. With such addresses
28 the connections to port 25 on hidden-service-name.onion using Tor will
29 go to the correct SMTP server. To do this, one need to configure the
30 Tor daemon to provide the hidden service and the mail server to accept
31 emails for this .onion domain. To learn more about Exim configuration
32 in Debian and test the design provided by Johannes Berg in his FAQ, I
33 set out yesterday to create a Debian package for making it trivial to
34 set up such SMTP over Tor service based on Debian. Getting it to work
35 were fairly easy, and
36 <a href="https://github.com/petterreinholdtsen/exim4-smtorp">the
37 source code for the Debian package</a> is available from github. I
38 plan to move it into Debian if further testing prove this to be a
39 useful approach.</p>
40
41 <p>If you want to test this, set up a blank Debian machine without any
42 mail system installed (or run <tt>apt-get purge exim4-config</tt> to
43 get rid of exim4). Install tor, clone the git repository mentioned
44 above, build the deb and install it on the machine. Next, run
45 <tt>/usr/lib/exim4-smtorp/setup-exim-hidden-service</tt> and follow
46 the instructions to get the service up and running. Restart tor and
47 exim when it is done, and test mail delivery using swaks like
48 this:</p>
49
50 <p><blockquote><pre>
51 torsocks swaks --server dutlqrrmjhtfa3vp.onion \
52 --to fbx@dutlqrrmjhtfa3vp.onion
53 </pre></blockquote></p>
54
55 <p>This will test the SMTP delivery using tor. Replace the email
56 address with your own address to test your server. :)</p>
57
58 <p>The setup procedure is still to complex, and I hope it can be made
59 easier and more automatic. Especially the tor setup need more work.
60 Also, the package include a tor-smtp tool written in C, but its task
61 should probably be rewritten in some script language to make the deb
62 architecture independent. It would probably also make the code easier
63 to review. The tor-smtp tool currently need to listen on a socket for
64 exim to talk to it and is started using xinetd. It would be better if
65 no daemon and no socket is needed. I suspect it is possible to get
66 exim to run a command line tool for delivery instead of talking to a
67 socket, and hope to figure out how in a future version of this
68 system.</p>
69
70 <p>Until I wipe my test machine, I can be reached using the
71 <tt>fbx@dutlqrrmjhtfa3vp.onion</tt> mail address, deliverable over
72 SMTorP. :)</p>