Use onion address as the main email address on onion-only installs
This commit is contained in:
parent
741c1c5bef
commit
90dd6b1183
|
@ -120,6 +120,34 @@ function email_create_template {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function create_email_onion_address {
|
||||||
|
if ! grep -q "hidden_service_email" /etc/tor/torrc; then
|
||||||
|
{ echo 'HiddenServiceDir /var/lib/tor/hidden_service_email/';
|
||||||
|
echo 'HiddenServiceVersion 3';
|
||||||
|
echo 'HiddenServicePort 25 127.0.0.1:25';
|
||||||
|
echo 'HiddenServicePort 587 127.0.0.1:587';
|
||||||
|
echo 'HiddenServicePort 465 127.0.0.1:465'; } >> /etc/tor/torrc
|
||||||
|
|
||||||
|
function_check onion_update
|
||||||
|
onion_update
|
||||||
|
|
||||||
|
function_check wait_for_onion_service
|
||||||
|
wait_for_onion_service email
|
||||||
|
|
||||||
|
if [ ! -f /var/lib/tor/hidden_service_email/hostname ]; then
|
||||||
|
echo $"email onion site hostname not found"
|
||||||
|
systemctl restart tor
|
||||||
|
exit 782352
|
||||||
|
fi
|
||||||
|
|
||||||
|
onion_address=$(cat /var/lib/tor/hidden_service_email/hostname)
|
||||||
|
set_completion_param "email onion domain" "${onion_address}"
|
||||||
|
add_email_hostname "$onion_address"
|
||||||
|
else
|
||||||
|
onion_address=$(cat /var/lib/tor/hidden_service_email/hostname)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function configure_email_onion {
|
function configure_email_onion {
|
||||||
if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
|
if [[ $(is_completed "${FUNCNAME[0]}") == "1" ]]; then
|
||||||
return
|
return
|
||||||
|
@ -128,29 +156,7 @@ function configure_email_onion {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! grep -q "hidden_service_email" /etc/tor/torrc; then
|
create_email_onion_address
|
||||||
{ echo 'HiddenServiceDir /var/lib/tor/hidden_service_email/';
|
|
||||||
echo 'HiddenServiceVersion 3';
|
|
||||||
echo 'HiddenServicePort 25 127.0.0.1:25';
|
|
||||||
echo 'HiddenServicePort 587 127.0.0.1:587';
|
|
||||||
echo 'HiddenServicePort 465 127.0.0.1:465'; } >> /etc/tor/torrc
|
|
||||||
fi
|
|
||||||
|
|
||||||
function_check onion_update
|
|
||||||
onion_update
|
|
||||||
|
|
||||||
function_check wait_for_onion_service
|
|
||||||
wait_for_onion_service email
|
|
||||||
|
|
||||||
if [ ! -f /var/lib/tor/hidden_service_email/hostname ]; then
|
|
||||||
echo $"email onion site hostname not found"
|
|
||||||
systemctl restart tor
|
|
||||||
exit 782352
|
|
||||||
fi
|
|
||||||
|
|
||||||
onion_address=$(cat /var/lib/tor/hidden_service_email/hostname)
|
|
||||||
set_completion_param "email onion domain" "${onion_address}"
|
|
||||||
add_email_hostname "$onion_address"
|
|
||||||
|
|
||||||
#apt-get -yq install tinycdb perl
|
#apt-get -yq install tinycdb perl
|
||||||
|
|
||||||
|
@ -218,6 +224,7 @@ function configure_email_onion {
|
||||||
sed -i 's|DNSListenAddress.*|DNSListenAddress 127.0.0.1|g' /etc/tor/torrc
|
sed -i 's|DNSListenAddress.*|DNSListenAddress 127.0.0.1|g' /etc/tor/torrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
update-exim4.conf.template -r
|
||||||
update-exim4.conf
|
update-exim4.conf
|
||||||
dpkg-reconfigure --frontend noninteractive exim4-config
|
dpkg-reconfigure --frontend noninteractive exim4-config
|
||||||
systemctl restart tor
|
systemctl restart tor
|
||||||
|
@ -247,6 +254,12 @@ function check_email_address_exists {
|
||||||
MY_EMAIL_ADDRESS="${MY_USERNAME}@${DEFAULT_DOMAIN_NAME}"
|
MY_EMAIL_ADDRESS="${MY_USERNAME}@${DEFAULT_DOMAIN_NAME}"
|
||||||
write_config_param "MY_EMAIL_ADDRESS" "$MY_EMAIL_ADDRESS"
|
write_config_param "MY_EMAIL_ADDRESS" "$MY_EMAIL_ADDRESS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $ONION_ONLY != 'no' ]]; then
|
||||||
|
my_email=$onion_address
|
||||||
|
MY_EMAIL_ADDRESS=$onion_address
|
||||||
|
write_config_param "MY_EMAIL_ADDRESS" "$MY_EMAIL_ADDRESS"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function backup_email {
|
function backup_email {
|
||||||
|
@ -1543,6 +1556,7 @@ function install_email {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
create_email_onion_address
|
||||||
check_email_address_exists
|
check_email_address_exists
|
||||||
install_email_basic
|
install_email_basic
|
||||||
configure_email_onion
|
configure_email_onion
|
||||||
|
|
Loading…
Reference in New Issue