From 9456dad28d8d8359997a4217504ddb824956f560 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 2 Jan 2016 10:35:00 +0000 Subject: [PATCH] Include any messages in the renewal failure email --- src/freedombone | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/freedombone b/src/freedombone index 0359d730..df54a2be 100755 --- a/src/freedombone +++ b/src/freedombone @@ -1700,8 +1700,11 @@ function letsencrypt_renewals { echo ' if [ -f /etc/nginx/sites-available/$LETSENCRYPT_DOMAIN ]; then' >> $renewals_script echo ' ${PROJECT_NAME}-renew-cert -h $LETSENCRYPT_DOMAIN -p letsencrypt' >> $renewals_script echo ' if [ ! "$?" = "0" ]; then' >> $renewals_script - echo -n " echo \"$renewal_failure_msg\" | mail -s \"$renewal_email_title\" " >> $renewals_script + echo " echo \"${renewal_failure_msg}\n\n\" > ~/temp_renewletsencrypt.txt" >> $renewals_script + echo ' ${PROJECT_NAME}-renew-cert -h $LETSENCRYPT_DOMAIN -p letsencrypt >> ~/temp_renewletsencrypt.txt' >> $renewals_script + echo -n " cat ~/temp_renewletsencrypt.txt | mail -s \"${renewal_email_title}\" " >> $renewals_script echo '$ADMIN_EMAIL_ADDRESS' >> $renewals_script + echo ' rm ~/temp_renewletsencrypt.txt' >> $renewals_script echo ' fi' >> $renewals_script echo ' fi' >> $renewals_script echo ' done' >> $renewals_script @@ -3702,7 +3705,7 @@ function set_your_domain_name { return fi - set_hostname $DEFAULT_DOMAIN_NAME + set_hostname $DEFAULT_DOMAIN_NAME echo 'set_your_domain_name' >> $COMPLETION_FILE } @@ -4128,7 +4131,7 @@ function configure_email { fi EMAIL_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_email/hostname) if [[ $ONION_ONLY != "no" ]]; then - set_hostname ${EMAIL_ONION_HOSTNAME} + set_hostname ${EMAIL_ONION_HOSTNAME} MY_EMAIL_ADDRESS=${MY_USERNAME}@${DEFAULT_DOMAIN_NAME} fi if ! grep -q "Email onion domain" $COMPLETION_FILE; then @@ -4217,13 +4220,13 @@ function configure_email { sed -i 's|pam_mail.so nopen|pam_mail.so dir=~/Maildir nopen|g' /etc/pam.d/su echo 'dc_eximconfig_configtype="internet"' > /etc/exim4/update-exim4.conf.conf - if [[ $ONION_ONLY == "no" ]]; then - # 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 - fi + if [[ $ONION_ONLY == "no" ]]; then + # 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 + fi echo "dc_local_interfaces=''" >> /etc/exim4/update-exim4.conf.conf echo "dc_readhost=''" >> /etc/exim4/update-exim4.conf.conf echo "dc_relay_domains=''" >> /etc/exim4/update-exim4.conf.conf