2016 ᠣᠨ ᠭᠡᠬᠦ ᠳᠦ ᠲᠡᠭᠡᠭᠡᠪᠦᠷᠢ ᠶᠢᠨ ᠠᠶᠤᠯ ᠦᠭᠡᠢ ᠪᠠᠶᠢᠳᠠᠯ ᠤᠨ ᠮᠡᠶᠢᠯᠡ ᠶᠢ ᠢ ᠮᠡᠶᠢᠯᠢ ᠪᠡᠷ
ᠶᠠᠪᠤᠭᠤᠯᠬᠤ ᠨᠢ ᠡᠨᠡ ᠪᠣᠯ ᠬᠡᠪ ᠢᠶᠡᠷ ᠯᠠ ᠪᠠᠶᠢᠨᠠ! ᠰᠡᠭᠦᠯ ᠦᠨ ᠮᠢᠯ ᠨᠢ ᠪᠠᠲᠤᠯᠠᠭᠳᠠᠭᠰᠠᠨ - ᠪᠣᠯᠤᠮᠵᠢᠲᠤ
ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠡ ᠦᠵᠡᠭᠦᠯᠦᠭᠴᠢ ᠨᠢ plaintext smtp᠂ ᠫᠣᠫ᠂ ᠡᠰᠡᠪᠡᠯ ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠦᠯᠦᠭᠴᠢ ᠡᠴᠡ
ᠢᠮᠡᠶᠢᠯᠡ ᠶᠢ ᠬᠦᠯᠢᠶᠡᠨ ᠠᠪᠳᠠᠭ ᠦᠭᠡᠢ᠃ ᠭᠡᠬᠦ ᠳᠦ ᠪᠡᠨ ᠶᠠᠬᠤ ᠪᠤᠢ? ᠣᠫᠫᠣᠷᠲ᠋ᠤᠶᠢᠨᠢᠰᠲ᠂ ᠪᠠᠭᠤᠷᠠᠢ᠂
ᠵᠠᠪᠰᠠᠷ ᠤᠨ᠂ ᠬᠠᠷᠢᠯᠴᠠᠨ ᠬᠠᠮᠢᠶᠠᠷᠤᠯ ᠲᠠᠢ ᠬᠡᠪ ᠢᠶᠡᠷ ᠪᠠᠶᠢᠨᠠ᠃ ᠡᠨᠡ ᠰᠢᠷᠬᠠ ᠳᠡᠭᠡᠷᠡ
ᠨᠡᠮᠡᠯᠲᠡ ᠲᠤᠰᠠᠯᠠᠮᠵᠢ ᠦᠵᠡᠭᠦᠯᠬᠦ ᠴᠠᠭ ᠪᠣᠯᠵᠠᠢ!
ᠢᠨᠲ᠋ᠧᠷᠨᠡᠲ ᠲᠦ ᠪᠠᠶᠢᠭᠠ ᠪᠦᠬᠦ ᠬᠦᠮᠦᠨ ᠶᠠᠵ ᠡᠭᠦᠨ ᠢ ᠬᠢᠳᠡᠭ ᠪᠤᠢ?
ᠰᠣᠩᠭᠣ ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠡᠨ ᠦ MX ᠪᠢᠴᠢᠯᠭᠡ ᠶᠢ ᠳᠠᠷᠠᠭᠠᠬᠢ ᠹᠣᠷᠮᠠᠲ᠋ᠠᠷ ᠬᠡᠷᠬᠢᠨ ᠠᠰᠢᠭᠯᠠᠬᠤ ᠲᠠᠯᠠ ᠪᠠᠷ dns᠄
_onion-mx._tcp.immerda.ch. 3600 IN SRV 0 5 25 example.onion
ᠰᠢᠳᠤᠷᠭᠤ᠂ ᠬᠠᠩᠭᠠᠯᠲᠠ ᠲᠠᠢ ᠪᠢᠰᠢ ᠪᠠᠶᠢᠬᠤ ᠶᠣᠰᠣᠲᠠᠢ᠃ ᠭᠡᠰᠡᠨ ᠬᠡᠳᠦᠢ ᠴᠤ ᠪᠢᠳᠡ ᠪᠤᠰᠤᠳ ᠪᠦᠬᠦ ᠠᠰᠢᠭᠲᠠᠢ ᠳᠠᠪᠠᠭᠤ
ᠲᠠᠯᠠ ᠶᠢ ᠣᠯᠵᠤ ᠠᠪᠤᠭᠰᠠᠭᠠᠷ ᠪᠠᠶᠢᠬᠤ ᠲᠤᠰᠤᠮ ᠢᠶᠠᠨ ᠪᠢᠳᠡ ᠮᠧᠲ᠋ᠠ ᠥᠭᠭᠥᠭᠳᠡᠯ ᠦᠨ ᠠᠯᠳᠠᠭᠳᠠᠯ ᠢ
ᠤᠯᠠᠮ ᠭᠦᠨᠵᠡᠭᠡᠶᠢᠷᠡᠭᠦᠯᠬᠦ ᠪᠣᠯᠤᠨᠠ᠃ ᠮᠥᠨ ᠪᠢᠳᠡ ᠵᠥᠪᠬᠡᠨ DNS ᠠᠰᠠᠭᠤᠯᠭᠠ ᠪᠢᠰᠢ ᠵᠥᠪᠬᠡᠨ SMTP ᠰᠧᠰ ᠢᠶᠡᠷ
ᠳᠠᠮᠵᠢᠭᠤᠯᠤᠨ ᠥᠪᠡᠷ ᠡᠴᠡ ᠪᠡᠨ ᠲᠠᠲᠠᠭᠠᠯᠵᠠᠵᠤ ᠴᠢᠳᠠᠬᠤ ᠬᠠᠯᠠᠳᠠᠭᠴᠢ ᠶᠢ ᠪᠢᠳᠡ ᠬᠠᠰᠤᠳᠠᠭ᠃
ᠣᠳᠣ ᠪᠠᠷ ᠡᠨᠡ ᠪᠣᠯ ᠵᠦᠭᠡᠷ ᠯᠠ ᠰᠠᠨᠠᠯ ᠶᠤᠮ᠂ ᠭᠡᠬᠦ ᠳᠦ ᠪᠡᠨ ᠪᠢᠳᠡᠨ ᠷᠦᠦ ᠬᠦᠷᠴᠦ ᠢᠷᠡᠪᠡᠯ
ᠡᠨᠡ ᠲᠠᠯᠠ ᠪᠠᠷ ᠬᠠᠮᠲᠤᠷᠠᠨ ᠠᠵᠢᠯᠯᠠᠬᠤ ᠰᠣᠨᠢᠷᠬᠠᠯᠲᠠᠢ ᠪᠠᠶᠢᠨᠠ!
Exim ᠍ ᠢ ᠪᠢᠳᠡ ᠬᠡᠷᠬᠢᠨ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠬᠤ ᠶᠢ ᠦᠵᠡᠶᠡ᠃ ᠡᠺᠰᠢᠮ mail ᠍ ᠦᠳ ᠢ ᠭᠠᠷ
ᠢᠶᠠᠷ ᠵᠣᠬᠢᠴᠠᠭᠤᠯᠤᠭᠳᠠᠭᠰᠠᠨ ᠪᠠᠭᠴᠠ ᠳᠣᠮᠡᠶᠢᠨ ᠢ ᠰᠣᠩᠭᠣᠬᠤ ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠡ ᠦᠵᠡᠭᠦᠯᠳᠡᠭ᠃
ᠡᠮᠦᠨᠡᠬᠢ ᠠᠵᠢᠯ ᠪᠠᠶᠢᠳᠠᠭ᠂ ᠭᠡᠬᠦ ᠳᠦ ᠪᠡᠨ exim 4.87 ᠬᠤᠪᠢᠯᠪᠤᠷᠢ ᠬᠢᠯᠪᠠᠷ ᠠᠷᠭᠠ ᠪᠠᠷ ᠭᠠᠷᠬᠤ
ᠪᠣᠯᠤᠮᠵᠢ ᠲᠠᠢ ᠪᠠᠶᠢᠳᠠᠭ᠃ ᠪᠢᠳᠡᠨ ᠳᠦ ᠤᠤ ᠬᠡᠷᠡᠭᠲᠡᠢ ᠲᠠᠯᠠ ᠪᠠᠷ ᠥᠨᠳᠦᠷ ᠲᠦᠪᠰᠢᠨ ᠦ ᠲᠣᠶᠢᠮᠣ ᠶᠢ ᠡᠨᠳᠡ ᠣᠷᠣᠭᠤᠯᠪᠠ᠃
1.ᠢᠮᠡᠶᠢᠯᠡ ᠶᠢᠨ ᠳᠣᠮᠡᠢ ᠶᠢᠨ ᠪᠠ MX ᠰᠣᠩᠭᠢᠨ ᠤ ᠬᠠᠶ᠋ᠢᠭ ᠤᠨ ᠬᠣᠭᠣᠷᠣᠨᠳᠣᠬᠢ ᠰᠲ᠋ᠠᠲ᠋ᠢᠭ ᠵᠢᠷᠤᠭᠯᠠᠯ
2᠃ ᠲᠣᠷᠢᠨ ᠤ AutomapHostsOnResolve ᠹᠦᠨᠺᠼ ᠢ ᠠᠰᠢᠭᠯᠠᠨ ᠳᠠᠮᠵᠢᠭᠤᠯᠤᠯᠲᠠ ᠶᠢ
ᠴᠢᠭᠯᠡᠭᠦᠯᠦᠭᠴᠢ ᠴᠢᠭᠯᠡᠭᠦᠯᠦᠭᠴᠢ᠄ Router ᠨᠢ ᠳᠡᠮᠣᠨ ᠲᠠᠢ ᠫᠷᠣᠭᠷᠠᠮ ᠤᠨ DNS ᠬᠠᠶᠢᠯᠲᠠ ᠶᠢ ᠭᠦᠢᠴᠡᠳᠭᠡᠳᠡᠭ᠃
ᠪᠤᠴᠠᠬᠤ IP ᠨᠢ ᠰᠣᠩᠭᠢᠨ ᠤ ᠵᠥᠪ url ᠳᠡᠭᠡᠷᠡ ᠪᠠᠶᠢᠷᠢᠰᠢᠭᠤᠯᠤᠭᠳᠠᠭᠰᠠᠨ ᠪᠠᠶᠢᠨᠠ᠃
3.ᠠ ᠲᠡᠭᠡᠭᠡᠪᠦᠷᠢ ᠶᠢᠨ ᠬᠡᠷᠡᠭᠰᠡᠯ ᠢᠶᠡᠷ ᠳᠠᠮᠵᠢᠭᠤᠯᠵᠤ ᠪᠤᠢ ᠲᠡᠭᠡᠭᠡᠭᠴᠢ ᠶᠢ ᠠᠰᠢᠭᠯᠠᠨ ᠣᠴᠢᠬᠤ ᠬᠠᠶ᠋ᠢᠭ ᠢ ᠢᠯᠡᠭᠡᠳᠡᠭ᠃
ᠡᠨᠳᠡ ᠪᠢᠳᠡ exim ᠲᠣᠬᠢᠷᠠᠨ ᠳᠤ ᠪᠠᠨ ᠭᠠᠳᠠᠭᠰᠢ ᠪᠠᠨ ᠵᠠᠬᠢᠳᠠᠯ ᠶᠠᠪᠤᠭᠤᠯᠵᠤ ᠬᠡᠷᠬᠢᠨ ᠲᠤᠬᠢᠷᠠᠭᠤᠯᠬᠤ ᠲᠠᠯᠠ ᠪᠠᠷ
ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠤᠭᠰᠠᠨ ᠪᠠᠶᠢᠨᠠ (ᠮᠥᠨ ᠲᠠ ᠡᠭᠦᠨ ᠢ ᠡᠭᠦᠨ ᠲᠡᠢ ᠢᠵᠢᠯ ᠪᠠᠶᠢᠳᠠᠯ ᠢᠶᠠᠷ ᠬᠢᠵᠦ ᠴᠢᠳᠠᠳᠠᠭ ᠪᠠᠶᠢᠬᠤ ᠶᠣᠰᠣᠲᠠᠢ)᠄
ᠡᠬᠢᠯᠡᠭᠡᠳ ᠬᠦᠯᠢᠶᠡᠨ ᠠᠪᠤᠭᠴᠢ ᠳᠣᠮᠠᠢ ᠨᠤᠭᠤᠳ ᠢ ᠰᠣᠩᠭᠢᠨ ᠤ ᠬᠠᠶ᠋ᠢᠭ ᠤᠨ ᠵᠢᠷᠤᠭᠯᠠᠯ ᠪᠣᠯᠭᠠᠨ ᠡᠭᠦᠰᠬᠡᠬᠦ᠄
/etc/exim/onionrelay.txt
example.com example.onion
lists.example.com example2.onion
ᠳᠠᠷᠠᠭᠠ ᠨᠢ ᠡᠭᠦᠨ ᠢ ᠬᠤᠷᠳᠤᠨ ᠬᠠᠶᠢᠵᠤ ᠣᠯᠬᠤ ᠶᠢᠨ ᠲᠤᠯᠠᠳᠠ cdb ᠤᠷᠤᠭᠤ ᠬᠥᠷᠪᠡᠭᠦᠯᠬᠦ ᠬᠡᠷᠡᠭᠲᠡᠢ᠄
cdb -m -c -t /tmp/onionrelay.tmp /etc/exim/onionrelay.cdb /etc/exim/onionrelay.txt
ᠰᠣᠩᠭᠢᠨ ᠤ ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠡᠨ ᠦ DNS ᠭᠠᠵᠠᠷ ᠤᠨ ᠵᠢᠷᠤᠭ ᠳᠡᠭᠡᠷᠡ Tor ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠭᠠ ᠶᠢ ᠲᠤᠬᠢᠷᠠᠭᠤᠯᠬᠤ ᠪᠣᠯᠤᠨ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠬᠤ ᠳᠤ ᠪᠠᠨ ᠯᠣᠺᠠᠯ ᠳᠧᠮᠣᠨ ᠠᠵᠢᠯᠯᠠᠭᠤᠯᠬᠤ ᠬᠡᠷᠡᠭᠲᠡᠢ᠄
/etc/torrc
AutomapHostsOnResolve 1
DNSPort 5300
DNSListenAddress 127.0.0.1
Exim ᠍ ᠢ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠤᠨᠠ ᠤᠤ᠄
/etc/exim/conf.d/perl
perl_startup = do '/etc/exim/perl-routines.pl'
perl_at_start
/etc/exim/perl-routines.pl
use Net::DNS::Resolver;
sub onionLookup {
my $hostname = shift;
my $res = Net::DNS::Resolver->new(nameservers => [qw(127.0.0.1)],);
$res->port(5300);
my $query = $res->search($hostname);
foreach my $rr ($query->answer) {
next unless $rr->type eq "A";
return $rr->address;
}
return 'no_such_host';
}
/etc/exim/conf.d/domainlists
ONION_RELAYDB=/etc/exim/onionrelay.cdb
domainlist onion_relays = cdb;ONION_RELAYDB
/etc/exim/conf.d/router
# send things over tor where we have an entry for it
onionrelays:
driver = manualroute
domains = +onion_relays
transport = onion_relay
# get the automap IP for the onion address from the tor daemon
route_data = ${perl{onionLookup}{${lookup{$domain}cdb{ONION_RELAYDB}}}}
no_more
/etc/exim/conf.d/transports
onion_relay:
driver = smtp
socks_proxy = 127.0.0.1 port=9050
ᠵᠠᠬᠢᠳᠠᠯ ᠬᠦᠯᠢᠶᠡᠨ ᠠᠪᠬᠤ ᠶᠢᠨ ᠲᠤᠯᠠᠳᠠ ᠬᠢᠬᠦ ᠶᠣᠰᠣᠲᠠᠢ ᠪᠦᠬᠦ ᠵᠦᠢᠯ ᠨᠢ Tor ᠲᠤᠷᠠ ᠰᠤᠩᠭᠤᠬᠤ ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠡ
(ᠫᠣᠷᠲ ᠤᠳ ᠣᠯᠠᠨ ᠪᠠᠶᠢᠳᠠᠭ) 25 ᠍ ᠳᠦᠭᠡᠷ ᠫᠣᠷᠲ ᠳᠡᠭᠡᠷᠡ ᠰᠣᠨᠣᠰᠴᠤ᠂ ᠬᠠᠶ᠋ᠢᠭ ᠢ ᠳᠡᠯᠡᠬᠡᠢ ᠳᠦ ᠨᠡᠶᠢᠲᠡᠯᠡᠬᠦ ᠪᠣᠯᠤᠨᠠ᠃
ᠪᠢᠳᠡ ᠡᠨᠡᠬᠦ ᠳᠠᠯᠳᠠ ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠡ ᠶᠢ ᠲᠤᠰ ᠲᠤ ᠪᠠᠨ VM ᠳᠡᠭᠡᠷᠡ ᠠᠵᠢᠯᠯᠠᠭᠤᠯᠵᠤ᠂ ᠥᠪᠡᠷ ᠦᠨ MX ᠍ ᠢ
ᠳᠣᠲᠣᠭᠠᠳᠤ ᠳᠤ ᠪᠠᠨ ᠳᠠᠮᠵᠢᠭᠤᠯᠬᠤ ᠶᠢᠨ ᠲᠤᠯᠠᠳᠠ ᠨᠡᠭᠡᠭᠡᠯᠲᠡ ᠲᠡᠢ ᠷᠧᠯᠧ ᠠᠵᠢᠯᠯᠠᠭᠤᠯᠬᠤ ᠦᠭᠡᠢ ᠪᠠᠶᠢᠬᠤ ᠶᠢ ᠵᠥᠪᠯᠡᠵᠦ ᠪᠠᠶᠢᠨᠠ᠃
ᠲᠠ ᠮᠥᠨ ONION ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠡ ᠶᠢ MX ᠳᠡᠭᠡᠷᠡ ᠰᠢᠭᠤᠳ ᠲᠤᠬᠢᠷᠠᠭᠤᠯᠬᠤ ᠪᠣᠯᠤᠮᠵᠢ ᠲᠠᠢ ᠪᠣᠯᠪᠠᠴᠤ
ᠬᠣᠯᠪᠣᠯᠲᠠ 127.0.0.1 ᠍ ᠰ ᠭᠠᠷᠴᠤ ᠢᠷᠡᠳᠡᠭ ᠪᠣᠯᠬᠣᠷ ᠲᠠ ᠠᠩᠬᠠᠷᠤᠯ ᠲᠠᠢ ᠪᠠᠶᠢᠬᠤ ᠬᠡᠷᠡᠭᠲᠡᠢ᠃ ᠶᠡᠬᠡᠩᠬᠢ
ᠵᠠᠬᠢᠳᠠᠯ ᠤᠨ ᠰᠧᠷᠸᠧᠷ ᠨᠢ localhost ᠍ ᠢ ᠳᠠᠪᠠᠭᠤ ᠡᠷᠬᠡ ᠲᠡᠢ ᠪᠡᠷ ᠬᠠᠨᠳᠤᠵᠤ ᠪᠠᠶᠢᠭᠠ ᠠᠴᠠ
ᠵᠠᠶᠢᠯᠠᠰᠬᠢᠬᠤ ᠬᠡᠷᠡᠭᠲᠡᠢ᠃ ᠪᠣᠯᠤᠮᠵᠢᠲᠤ ᠲᠣᠭᠣᠷᠢᠨ ᠭᠠᠷᠬᠤ ᠠᠷᠭᠠ ᠵᠠᠮ ᠤᠳ ᠨᠢ ᠯᠣᠺᠠᠯ ᠵᠢᠷᠤᠭᠯᠠᠯ ᠢ ᠥᠭᠡᠷᠡ
ᠫᠣᠷ ᠲᠤ ᠷᠤ ᠬᠤᠯᠪᠤᠬᠤ ᠶᠤᠮ ᠤᠤ ᠡᠰᠡᠪᠡᠯ ᠲᠡᠭᠡᠭᠡᠭᠴᠢ ᠳᠧᠮᠣᠨ ᠢ ᠥᠭᠡᠷᠡ ip (ᠥᠭᠡᠷᠡ ᠪᠡᠷ ᠬᠡᠯᠡᠪᠡᠯ 127.0.0.2) ᠬᠤᠯᠪᠤᠬᠤ ᠶᠣᠰᠣᠲᠠᠢ᠃