Pārlūkot izejas kodu

imap configuration

Bob Mottram 11 gadus atpakaļ
vecāks
revīzija
2d64a20638
1 mainītis faili ar 24 papildinājumiem un 0 dzēšanām
  1. 24
    0
      install-freedombone.sh

+ 24
- 0
install-freedombone.sh Parādīt failu

6
 # Directory where source code is downloaded and compiled
6
 # Directory where source code is downloaded and compiled
7
 INSTALL_DIR=/root/build
7
 INSTALL_DIR=/root/build
8
 
8
 
9
+export DEBIAN_FRONTEND=noninteractive
10
+
9
 function initial_setup {
11
 function initial_setup {
10
   apt-get -y update
12
   apt-get -y update
11
   apt-get -y dist-upgrade
13
   apt-get -y dist-upgrade
525
   service cron restart
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
 initial_setup
551
 initial_setup
529
 install_editor
552
 install_editor
530
 enable_backports
553
 enable_backports
544
 script_to_make_self_signed_certificates
567
 script_to_make_self_signed_certificates
545
 configure_email
568
 configure_email
546
 spam_filtering
569
 spam_filtering
570
+configure_imap