| 
				
			 | 
			
			
				@@ -6,6 +6,8 @@ MY_USERNAME=$2 
			 | 
		
	
		
			
			| 
				6
			 | 
			
				6
			 | 
			
			
				 # Directory where source code is downloaded and compiled 
			 | 
		
	
		
			
			| 
				7
			 | 
			
				7
			 | 
			
			
				 INSTALL_DIR=/root/build 
			 | 
		
	
		
			
			| 
				8
			 | 
			
				8
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				
			 | 
			
				9
			 | 
			
			
				+export DEBIAN_FRONTEND=noninteractive 
			 | 
		
	
		
			
			| 
				
			 | 
			
				10
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				9
			 | 
			
				11
			 | 
			
			
				 function initial_setup { 
			 | 
		
	
		
			
			| 
				10
			 | 
			
				12
			 | 
			
			
				   apt-get -y update 
			 | 
		
	
		
			
			| 
				11
			 | 
			
				13
			 | 
			
			
				   apt-get -y dist-upgrade 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -525,6 +527,27 @@ function spam_filtering { 
			 | 
		
	
		
			
			| 
				525
			 | 
			
				527
			 | 
			
			
				   service cron restart 
			 | 
		
	
		
			
			| 
				526
			 | 
			
				528
			 | 
			
			
				 } 
			 | 
		
	
		
			
			| 
				527
			 | 
			
				529
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				
			 | 
			
				530
			 | 
			
			
				+function configure_imap { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				531
			 | 
			
			
				+  apt-get -y install dovecot-common dovecot-imapd 
			 | 
		
	
		
			
			| 
				
			 | 
			
				532
			 | 
			
			
				+  makecert dovecot 
			 | 
		
	
		
			
			| 
				
			 | 
			
				533
			 | 
			
			
				+  chown root:dovecot /etc/ssl/certs/dovecot.crt 
			 | 
		
	
		
			
			| 
				
			 | 
			
				534
			 | 
			
			
				+  chown root:dovecot /etc/ssl/private/dovecot.key 
			 | 
		
	
		
			
			| 
				
			 | 
			
				535
			 | 
			
			
				+  chown root:dovecot /etc/ssl/private/dovecot.dhparams 
			 | 
		
	
		
			
			| 
				
			 | 
			
				536
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				537
			 | 
			
			
				+  sed -i 's|#ssl = yes|ssl = yes|g' /etc/dovecot/conf.d/10-ssl.conf 
			 | 
		
	
		
			
			| 
				
			 | 
			
				538
			 | 
			
			
				+  sed -i 's|ssl_cert = </etc/dovecot/dovecot.pem|ssl_cert = </etc/ssl/certs/dovecot.crt|g' /etc/dovecot/conf.d/10-ssl.conf 
			 | 
		
	
		
			
			| 
				
			 | 
			
				539
			 | 
			
			
				+  sed -i 's|ssl_key = </etc/dovecot/private/dovecot.pem|/etc/ssl/private/dovecot.key|g' /etc/dovecot/conf.d/10-ssl.conf 
			 | 
		
	
		
			
			| 
				
			 | 
			
				540
			 | 
			
			
				+  sed -i 's|#ssl_dh_parameters_length = 1024|ssl_dh_parameters_length = 1024|g' /etc/dovecot/conf.d/10-ssl.conf 
			 | 
		
	
		
			
			| 
				
			 | 
			
				541
			 | 
			
			
				+  sed -i 's/#ssl_prefer_server_ciphers = no/ssl_prefer_server_ciphers = yes/g' /etc/dovecot/conf.d/10-ssl.conf 
			 | 
		
	
		
			
			| 
				
			 | 
			
				542
			 | 
			
			
				+  echo "ssl_cipher_list = 'EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA'" >> /etc/dovecot/conf.d/10-ssl.conf 
			 | 
		
	
		
			
			| 
				
			 | 
			
				543
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				544
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				545
			 | 
			
			
				+  sed -i 's/#listen = *, ::/listen = */g' /etc/dovecot/dovecot.conf 
			 | 
		
	
		
			
			| 
				
			 | 
			
				546
			 | 
			
			
				+  sed -i 's/#disable_plaintext_auth = yes/disable_plaintext_auth = no/g' /etc/dovecot/conf.d/10-auth.conf 
			 | 
		
	
		
			
			| 
				
			 | 
			
				547
			 | 
			
			
				+  sed -i 's/auth_mechanisms = plain/auth_mechanisms = plain login/g' /etc/dovecot/conf.d/10-auth.conf 
			 | 
		
	
		
			
			| 
				
			 | 
			
				548
			 | 
			
			
				+  sed -i 's|#   mail_location = maildir:~/Maildir|   mail_location = maildir:~/Maildir:LAYOUT=fs|g' /etc/dovecot/conf.d/10-mail.conf 
			 | 
		
	
		
			
			| 
				
			 | 
			
				549
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				
			 | 
			
				550
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				528
			 | 
			
				551
			 | 
			
			
				 initial_setup 
			 | 
		
	
		
			
			| 
				529
			 | 
			
				552
			 | 
			
			
				 install_editor 
			 | 
		
	
		
			
			| 
				530
			 | 
			
				553
			 | 
			
			
				 enable_backports 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -544,3 +567,4 @@ configure_internet_protocol 
			 | 
		
	
		
			
			| 
				544
			 | 
			
				567
			 | 
			
			
				 script_to_make_self_signed_certificates 
			 | 
		
	
		
			
			| 
				545
			 | 
			
				568
			 | 
			
			
				 configure_email 
			 | 
		
	
		
			
			| 
				546
			 | 
			
				569
			 | 
			
			
				 spam_filtering 
			 | 
		
	
		
			
			| 
				
			 | 
			
				570
			 | 
			
			
				+configure_imap 
			 |