Browse Source

Speculative onion routing of email

Bob Mottram 7 years ago
parent
commit
24025e53b5
1 changed files with 35 additions and 0 deletions
  1. 35
    0
      src/freedombone-base-email

+ 35
- 0
src/freedombone-base-email View File

@@ -150,6 +150,41 @@ function configure_email_onion {
150 150
     set_completion_param "email onion domain" "${onion_address}"
151 151
     add_email_hostname "$onion_address"
152 152
 
153
+    #echo "$DEFAULT_DOMAIN_NAME $onion_address" > /etc/exim4/onionrelay.txt
154
+    #cdb -m -c -t /tmp/onionrelay.tmp /etc/exim4/onionrelay.cdb /etc/exim4/onionrelay.txt
155
+
156
+    #{ "perl_startup = do '/etc/exim4/perl-routines.pl'";
157
+    #  "perl_at_start"; } > /etc/exim4/conf.d/main/perl
158
+
159
+    #{ "use Net::DNS::Resolver;";
160
+    #  "sub onionLookup {";
161
+    #  "  my \$hostname = shift;";
162
+    #  "  my \$res = Net::DNS::Resolver->new(nameservers => [qw(127.0.0.1)],);";
163
+    #  "  \$res->port(5300);";
164
+    #  "  my \$query = \$res->search(\$hostname);";
165
+    #  "  foreach my \$rr (\$query->answer) {";
166
+    #  "    next unless \$rr->type eq \"A\";";
167
+    #  "    return \$rr->address;";
168
+    #  "  }";
169
+    #  "  return 'no_such_host';";
170
+    #  "}"; } > /etc/exim4/perl-routines.pl
171
+
172
+    #{ "ONION_RELAYDB=/etc/exim4/onionrelay.cdb";
173
+    #  "domainlist onion_relays     = cdb;ONION_RELAYDB"; } > /etc/exim4/conf.d/domainlists
174
+
175
+    #{ "# send things over tor where we have an entry for it";
176
+    #  "onionrelays:";
177
+    #  "  driver    = manualroute";
178
+    #  "  domains   = +onion_relays";
179
+    #  "  transport = onion_relay";
180
+    #  "  # get the automap IP for the onion address from the tor daemon";
181
+    #  "  route_data = \${perl{onionLookup}{\${lookup{\$domain}cdb{ONION_RELAYDB}}}}";
182
+    #  "  no_more"; } > /etc/exim4/conf.d/router/50_exim4-config-onion
183
+
184
+    #{ "onion_relay:";
185
+    #  "  driver = smtp";
186
+    #  "  socks_proxy = 127.0.0.1 port=9050"; } > /etc/exim4/conf.d/transport/50_exim4-config_onion
187
+
153 188
     mark_completed "${FUNCNAME[0]}"
154 189
 }
155 190