onion email

This commit is contained in:
Bob Mottram 2016-01-09 13:29:34 +00:00
parent 58700799df
commit e92d76206c
1 changed files with 44 additions and 44 deletions

View File

@ -4325,49 +4325,50 @@ function configure_email {
sed -i "s|Email onion domain.*|Email onion domain:${EMAIL_ONION_HOSTNAME}|g" $COMPLETION_FILE
fi
echo '# tor stuff first' > /etc/exim4/conf.d/router/100_smtorp
echo '#' >> /etc/exim4/conf.d/router/100_smtorp
echo '# if were submitting mail *from* a .tor/.onion address,' >> /etc/exim4/conf.d/router/100_smtorp
echo '# make sure any header lines that may give us away is' >> /etc/exim4/conf.d/router/100_smtorp
echo '# stripped out, and add a new, cryptic Message-ID.' >> /etc/exim4/conf.d/router/100_smtorp
echo '# In address_data we store the name we should HELO as.' >> /etc/exim4/conf.d/router/100_smtorp
echo 'tor_to_any:' >> /etc/exim4/conf.d/router/100_smtorp
echo ' debug_print = "R: manualroute from .onion to $local_part@$domain"' >> /etc/exim4/conf.d/router/100_smtorp
echo ' driver = manualroute' >> /etc/exim4/conf.d/router/100_smtorp
echo ' domains = ! +local_domains' >> /etc/exim4/conf.d/router/100_smtorp
echo ' condition = ${if match {$sender_address_domain}{\N.*\.(onion|tor)$\N}}' >> /etc/exim4/conf.d/router/100_smtorp
echo ' address_data = $sender_address_domain' >> /etc/exim4/conf.d/router/100_smtorp
echo ' transport = remote_smtp_onion' >> /etc/exim4/conf.d/router/100_smtorp
echo ' self = send' >> /etc/exim4/conf.d/router/100_smtorp
echo ' route_list = * localhost' >> /etc/exim4/conf.d/router/100_smtorp
echo ' headers_remove = Received:Message-ID:X-Mailer:User-Agent' >> /etc/exim4/conf.d/router/100_smtorp
echo ' headers_add = Message-ID: <${lc:${sha1:$message_id}}@$sender_address_domain>' >> /etc/exim4/conf.d/router/100_smtorp
echo '' >> /etc/exim4/conf.d/router/100_smtorp
echo '# this catches the case where were submitting mail' >> /etc/exim4/conf.d/router/100_smtorp
echo '# from a regular email address where we dont need to' >> /etc/exim4/conf.d/router/100_smtorp
echo '# rewrite any headers' >> /etc/exim4/conf.d/router/100_smtorp
echo 'any_to_tor:' >> /etc/exim4/conf.d/router/100_smtorp
echo ' debug_print = "R: manualroute for $local_part@$domain"' >> /etc/exim4/conf.d/router/100_smtorp
echo ' driver = manualroute' >> /etc/exim4/conf.d/router/100_smtorp
echo ' domains = ! +local_domains' >> /etc/exim4/conf.d/router/100_smtorp
echo ' transport = remote_smtp_onion' >> /etc/exim4/conf.d/router/100_smtorp
echo ' self = send' >> /etc/exim4/conf.d/router/100_smtorp
echo ' route_list = *.onion localhost ; *.tor localhost' >> /etc/exim4/conf.d/router/100_smtorp
echo ' address_data = $smtp_active_hostname' >> /etc/exim4/conf.d/router/100_smtorp
# see https://github.com/petterreinholdtsen/exim4-smtorp
echo '# tor stuff first' > /etc/exim4/conf.d/router/100_exim4-smtorp
echo '#' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo '# if were submitting mail *from* a .tor/.onion address,' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo '# make sure any header lines that may give us away is' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo '# stripped out, and add a new, cryptic Message-ID.' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo '# In address_data we store the name we should HELO as.' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo 'tor_to_any:' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' debug_print = "R: manualroute from .onion to $local_part@$domain"' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' driver = manualroute' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' domains = ! +local_domains' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' condition = ${if match {$sender_address_domain}{\N.*\.(onion|tor)$\N}}' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' address_data = $sender_address_domain' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' transport = remote_smtp_onion' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' self = send' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' route_list = * localhost' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' headers_remove = Received:Message-ID:X-Mailer:User-Agent' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' headers_add = Message-ID: <${lc:${sha1:$message_id}}@$sender_address_domain>' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo '' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo '# this catches the case where were submitting mail' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo '# from a regular email address where we dont need to' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo '# rewrite any headers' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo 'any_to_tor:' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' debug_print = "R: manualroute for $local_part@$domain"' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' driver = manualroute' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' domains = ! +local_domains' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' transport = remote_smtp_onion' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' self = send' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' route_list = *.onion localhost ; *.tor localhost' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo ' address_data = $smtp_active_hostname' >> /etc/exim4/conf.d/router/100_exim4-smtorp
echo 'remote_smtp_onion:' > /etc/exim4/conf.d/transport/100_smtorp
echo ' debug_print = "T: remote_smtp_onion for $local_part@$original_domain"' >> /etc/exim4/conf.d/transport/100_smtorp
echo ' driver = smtp' >> /etc/exim4/conf.d/transport/100_smtorp
echo '' >> /etc/exim4/conf.d/transport/100_smtorp
echo ' # set helo_data to where we want to connect to,' >> /etc/exim4/conf.d/transport/100_smtorp
echo ' # for the proxy program tor-smtp' >> /etc/exim4/conf.d/transport/100_smtorp
echo ' helo_data = "$address_data $original_domain"' >> /etc/exim4/conf.d/transport/100_smtorp
echo '' >> /etc/exim4/conf.d/transport/100_smtorp
echo ' # wherever we configured our script at' >> /etc/exim4/conf.d/transport/100_smtorp
echo ' port = 12668' >> /etc/exim4/conf.d/transport/100_smtorp
echo '' >> /etc/exim4/conf.d/transport/100_smtorp
echo ' # cannot use TLS otherwise it will EHLO again!!' >> /etc/exim4/conf.d/transport/100_smtorp
echo ' hosts_avoid_tls = *' >> /etc/exim4/conf.d/transport/100_smtorp
echo 'remote_smtp_onion:' > /etc/exim4/conf.d/transport/100_exim4-smtorp
echo ' debug_print = "T: remote_smtp_onion for $local_part@$original_domain"' >> /etc/exim4/conf.d/transport/100_exim4-smtorp
echo ' driver = smtp' >> /etc/exim4/conf.d/transport/100_exim4-smtorp
echo '' >> /etc/exim4/conf.d/transport/100_exim4-smtorp
echo ' # set helo_data to where we want to connect to,' >> /etc/exim4/conf.d/transport/100_exim4-smtorp
echo ' # for the proxy program tor-smtp' >> /etc/exim4/conf.d/transport/100_exim4-smtorp
echo ' helo_data = "$address_data $original_domain"' >> /etc/exim4/conf.d/transport/100_exim4-smtorp
echo '' >> /etc/exim4/conf.d/transport/100_exim4-smtorp
echo ' # wherever we configured our script at' >> /etc/exim4/conf.d/transport/100_exim4-smtorp
echo ' port = 12668' >> /etc/exim4/conf.d/transport/100_exim4-smtorp
echo '' >> /etc/exim4/conf.d/transport/100_exim4-smtorp
echo ' # cannot use TLS otherwise it will EHLO again!!' >> /etc/exim4/conf.d/transport/100_exim4-smtorp
echo ' hosts_avoid_tls = *' >> /etc/exim4/conf.d/transport/100_exim4-smtorp
if [ ! -d $INSTALL_DIR ]; then
mkdir -p $INSTALL_DIR
@ -4412,8 +4413,7 @@ function configure_email {
# both ICANN and onion domains
echo "dc_other_hostnames='${DEFAULT_DOMAIN_NAME};${EMAIL_ONION_HOSTNAME}'" >> /etc/exim4/update-exim4.conf.conf
else
# in onion-only mode the default domain is the same as the onion domain for email
echo "dc_other_hostnames='${DEFAULT_DOMAIN_NAME}'" >> /etc/exim4/update-exim4.conf.conf
echo "dc_other_hostnames='${EMAIL_ONION_HOSTNAME}'" >> /etc/exim4/update-exim4.conf.conf
fi
echo "dc_local_interfaces=''" >> /etc/exim4/update-exim4.conf.conf
echo "dc_readhost=''" >> /etc/exim4/update-exim4.conf.conf