X-Git-Url: http://pere.pagekite.me/gitweb/exim4-smtorp.git/blobdiff_plain/3ac64df92d976bbaf2cacbbd558e37fcb592d184..28c01cd58a3a615835deb69b294ac7450883ccf6:/setup-exim-hidden-service diff --git a/setup-exim-hidden-service b/setup-exim-hidden-service index 48af3e2..d14a3ae 100644 --- a/setup-exim-hidden-service +++ b/setup-exim-hidden-service @@ -3,15 +3,6 @@ # Configure a machine without exim installed as a mail server receiving # email using SMTP via Tor. -if dpkg -l exim4-config > /dev/null ; then - echo "******************************************************************" - echo "* Unable to set up SMTP over Tor, exim4-config already installed *" - echo "* Purge the package and try again, or *" - echo "* run "dpkg-reconfigure exim4-config" to configure manually. *" - echo "******************************************************************" - exit 1 -fi - append_if_missing() { file="$1" string="$2" @@ -25,7 +16,7 @@ append_if_missing() { fi } -DEBIAN_FRONTEND=noninteractive apt-get install -y tor +DEBIAN_FRONTEND=noninteractive apt-get install -y tor xinetd torhsdir=$(awk '/^HiddenServiceDir (.*) *$/ { print $2 }' /etc/tor/torrc) if [ -e "$torhsdir/hostname" ] ; then torhsname=$(cat "$torhsdir/hostname") @@ -49,6 +40,16 @@ else fi fi +if dpkg -l exim4-config > /dev/null ; then + echo "******************************************************************" + echo "* Unable to set up SMTP over Tor, exim4-config already installed *" + echo "* Purge the package and try again, or *" + echo "* run "dpkg-reconfigure exim4-config" to configure manually. *" + echo "******************************************************************" + echo "* Enable '$torhsname' as mail domain. + exit 1 +fi + cat <