Update run.sh
Add trusted networks option
This commit is contained in:
		
							
								
								
									
										14
									
								
								run.sh
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								run.sh
									
									
									
									
									
								
							@@ -51,5 +51,19 @@ if [ ! -z "${SMTP_HEADER_TAG}" ]; then
 | 
			
		||||
  echo "Setting configuration option SMTP_HEADER_TAG with value: ${SMTP_HEADER_TAG}"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
#Check for subnet restrictions
 | 
			
		||||
nets='10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16'
 | 
			
		||||
if [ ! -z "${SMTP_NETWORKS}" ]; then
 | 
			
		||||
        for i in $(sed 's/,/\ /g' <<<$SMTP_NETWORKS); do
 | 
			
		||||
                if grep -Eq "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/[0-9]{1,2}" <<<$i ; then
 | 
			
		||||
                        nets+=", $i"
 | 
			
		||||
                else
 | 
			
		||||
                        echo "$i is not in proper IPv4 subnet format. Ignoring."
 | 
			
		||||
                fi
 | 
			
		||||
        done
 | 
			
		||||
fi
 | 
			
		||||
add_config_value "mynetworks" "${nets}"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#Start services
 | 
			
		||||
supervisord
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user