| 
				
			 | 
			
			
				@@ -73,6 +73,48 @@ GPGIT_COMMIT='583dc76119f19420f8a33f606744faa7c8922738' 
			 | 
		
	
		
			
			| 
				73
			 | 
			
				73
			 | 
			
			
				 # refresh gpg keys every few hours 
			 | 
		
	
		
			
			| 
				74
			 | 
			
				74
			 | 
			
			
				 REFRESH_GPG_KEYS_HOURS=2 
			 | 
		
	
		
			
			| 
				75
			 | 
			
				75
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				
			 | 
			
				76
			 | 
			
			
				+function add_email_hostname { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				77
			 | 
			
			
				+    extra_email_hostname="$1" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				78
			 | 
			
			
				+    email_hostnames=$(cat /etc/exim4/update-exim4.conf.conf | grep "dc_other_hostnames" | awk -F "'" '{print $2}') 
			 | 
		
	
		
			
			| 
				
			 | 
			
				79
			 | 
			
			
				+    if [[ "$email_hostnames" != *"$extra_email_hostname"* ]]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				80
			 | 
			
			
				+        sed -i "s|dc_other_hostnames=.*|dc_other_hostnames='$emailhostnames;extra_email_hostname'|g" /etc/exim4/update-exim4.conf.conf 
			 | 
		
	
		
			
			| 
				
			 | 
			
				81
			 | 
			
			
				+        update-exim4.conf 
			 | 
		
	
		
			
			| 
				
			 | 
			
				82
			 | 
			
			
				+        dpkg-reconfigure --frontend noninteractive exim4-config 
			 | 
		
	
		
			
			| 
				
			 | 
			
				83
			 | 
			
			
				+        systemctl restart saslauthd 
			 | 
		
	
		
			
			| 
				
			 | 
			
				84
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				85
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				
			 | 
			
				86
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				87
			 | 
			
			
				+function configure_email_onion { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				88
			 | 
			
			
				+    if [[ $(is_completed $FUNCNAME) == "1" ]]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				89
			 | 
			
			
				+        return 
			 | 
		
	
		
			
			| 
				
			 | 
			
				90
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				91
			 | 
			
			
				+    if [[ $SYSTEM_TYPE == "mesh"* ]]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				92
			 | 
			
			
				+        return 
			 | 
		
	
		
			
			| 
				
			 | 
			
				93
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				94
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				95
			 | 
			
			
				+    echo 'HiddenServiceDir /var/lib/tor/hidden_service_email/' >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				
			 | 
			
				96
			 | 
			
			
				+    echo 'HiddenServicePort 25 127.0.0.1:25' >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				
			 | 
			
				97
			 | 
			
			
				+    echo 'HiddenServicePort 587 127.0.0.1:587' >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				
			 | 
			
				98
			 | 
			
			
				+    echo 'HiddenServicePort 465 127.0.0.1:465' >> /etc/tor/torrc 
			 | 
		
	
		
			
			| 
				
			 | 
			
				99
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				100
			 | 
			
			
				+    function_check onion_update 
			 | 
		
	
		
			
			| 
				
			 | 
			
				101
			 | 
			
			
				+    onion_update 
			 | 
		
	
		
			
			| 
				
			 | 
			
				102
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				103
			 | 
			
			
				+    function_check wait_for_onion_service 
			 | 
		
	
		
			
			| 
				
			 | 
			
				104
			 | 
			
			
				+    wait_for_onion_service email 
			 | 
		
	
		
			
			| 
				
			 | 
			
				105
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				106
			 | 
			
			
				+    if [[ $(onion_service_exists email) == "0" ]]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				107
			 | 
			
			
				+        echo $"email onion site hostname not found" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				108
			 | 
			
			
				+        exit 782352 
			 | 
		
	
		
			
			| 
				
			 | 
			
				109
			 | 
			
			
				+    fi 
			 | 
		
	
		
			
			| 
				
			 | 
			
				110
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				111
			 | 
			
			
				+    onion_address=$(cat /var/lib/tor/hidden_service_email/hostname) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				112
			 | 
			
			
				+    set_completion_param "email onion domain" "${onion_address}" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				113
			 | 
			
			
				+    add_email_hostname "$onion_address" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				114
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				115
			 | 
			
			
				+    mark_completed $FUNCNAME 
			 | 
		
	
		
			
			| 
				
			 | 
			
				116
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				
			 | 
			
				117
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				76
			 | 
			
				118
			 | 
			
			
				 function check_email_address_exists { 
			 | 
		
	
		
			
			| 
				77
			 | 
			
				119
			 | 
			
			
				     read_config_param ONION_ONLY 
			 | 
		
	
		
			
			| 
				78
			 | 
			
				120
			 | 
			
			
				     read_config_param MY_USERNAME 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -1706,6 +1748,7 @@ function install_email { 
			 | 
		
	
		
			
			| 
				1706
			 | 
			
				1748
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				1707
			 | 
			
				1749
			 | 
			
			
				     check_email_address_exists 
			 | 
		
	
		
			
			| 
				1708
			 | 
			
				1750
			 | 
			
			
				     install_email_basic 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1751
			 | 
			
			
				+    configure_email_onion 
			 | 
		
	
		
			
			| 
				1709
			 | 
			
				1752
			 | 
			
			
				     #install_email_with_tor 
			 | 
		
	
		
			
			| 
				1710
			 | 
			
				1753
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				1711
			 | 
			
				1754
			 | 
			
			
				     mark_completed $FUNCNAME 
			 |