Commit adda3a5c authored by w4t's avatar w4t

wtserver 0.24

parent c6ac6e23
......@@ -27,7 +27,7 @@ InstallFTP() {
"onlyTLS") echo -n -e "${red}TLS Only${NC}"; echo 2 >/etc/pure-ftpd/conf/TLS ;;
*) echo -n -e "${red}Both FTP and TLS${NC}"; echo 1 >/etc/pure-ftpd/conf/TLS ;;
esac
echo -e "connections [${green}DONE${NC}]"
echo -e " connections [${green}DONE${NC}]"
echo -n -e "$IDENTATION_LVL_1 Generating and Installing SSL Certificate for FTP Server... "
mkdir -p /etc/ssl/private/ >>"$PROGRAMS_INSTALL_LOG_FILES" 2>&1
......
......@@ -66,23 +66,23 @@ InstallMTA() {
-e "/^#default_login_user =/a log_path = /var/log/mail.log" \
"/etc/dovecot/conf.d/10-master.conf"
sed -i 's/ #user =/ user = postfix/' /etc/dovecot/conf.d/10-master.conf
sed -i 's/ #group =/ group = postfix/' /etc/dovecot/conf.d/10-master.conf
sed -i "s/ #user =/ user = postfix/" /etc/dovecot/conf.d/10-master.conf
sed -i "s/ #group =/ group = postfix/" /etc/dovecot/conf.d/10-master.conf
# The inotify `max_user_instances` default is 128, which constrains
# the total number of watched (IMAP IDLE push) folders by open connections.
# See http://www.dovecot.org/pipermail/dovecot/2013-March/088834.html.
# A reboot is required for this to take effect (which we don't do as
# as a part of setup). Test with `cat /proc/sys/fs/inotify/max_user_instances`.
sed -i '/^#*\s*fs\.inotify\.max_user_instances\s*=/d; $a\fs.inotify.max_user_instances=1024' /etc/sysctl.conf
sed -i "/^#*\s*fs\.inotify\.max_user_instances\s*=/d; $a\fs.inotify.max_user_instances=1024" /etc/sysctl.conf
# Set the location where we'll store user mailboxes. '%d' is the domain name and '%n' is the
# username part of the user's email address. We'll ensure that no bad domains or email addresses
# are created within the management daemon.
sed -i -E \
-e 's/^mail_location\s*=\s*.*/mail_location = maildir:$STORAGE_ROOT\/mail\/mailboxes\/%d\/%n/' \
-e 's/^mail_privileged_group\s*=\s*.*/mail_privileged_group = mail/' \
-e 's/^#first_valid_uid\s*=\s*.*/first_valid_uid = 0/' \
-e "s/^mail_location\s*=\s*.*/mail_location = maildir:$STORAGE_ROOT\/mail\/mailboxes\/%d\/%n/" \
-e "s/^mail_privileged_group\s*=\s*.*/mail_privileged_group = mail/" \
-e "s/^#first_valid_uid\s*=\s*.*/first_valid_uid = 0/" \
/etc/dovecot/conf.d/10-mail.conf
# Create, subscribe, and mark as special folders: INBOX, Drafts, Sent, Trash, Spam and Archive.
......@@ -120,21 +120,21 @@ EOF
# The LOGIN mechanism is supposedly for Microsoft products like Outlook to do SMTP login (I guess
# since we're using Dovecot to handle SMTP authentication?).
sed -i -E \
-e 's/^#?disable_plaintext_auth\s*=\s*.*/disable_plaintext_auth = yes/' \
-e 's/^auth_mechanisms\s*=\s*.*/auth_mechanisms = plain login/' \
-e "s/^#?disable_plaintext_auth\s*=\s*.*/disable_plaintext_auth = yes/" \
-e "s/^auth_mechanisms\s*=\s*.*/auth_mechanisms = plain login/" \
/etc/dovecot/conf.d/10-auth.conf
# Enable SSL, specify the location of the SSL certificate and private key files.
# Use Mozilla's "Intermediate" recommendations at https://ssl-config.mozilla.org/#server=dovecot&server-version=2.3.7.2&config=intermediate&openssl-version=1.1.1,
# except that the current version of Dovecot does not have a TLSv1.3 setting, so we only use TLSv1.2.
sed -i -E \
-e 's/^ssl\s*=\s*.*/ssl = required/' \
-e 's|^ssl_cert\s*=\s*<.*|ssl_cert = <$STORAGE_ROOT/ssl/ssl_certificate.pem|' \
-e 's|^ssl_key\s*=\s*<.*|ssl_key = <$STORAGE_ROOT/ssl/ssl_private_key.pem|' \
-e 's/^#?ssl_min_protocol\s*=\s*.*/ssl_min_protocol = TLSv1.2/' \
-e 's/^#?ssl_cipher_list\s*=\s*.*/ssl_cipher_list = ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384/' \
-e 's/^#?ssl_prefer_server_ciphers\s*=\s*.*/ssl_prefer_server_ciphers = yes/' \
-e 's|^#?ssl_dh\s*=\s*<.*|ssl_dh = <$STORAGE_ROOT/ssl/dh4096.pem|' \
-e "s/^ssl\s*=\s*.*/ssl = required/" \
-e "s|^ssl_cert\s*=\s*<.*|ssl_cert = <$STORAGE_ROOT/ssl/ssl_certificate.pem|" \
-e "s|^ssl_key\s*=\s*<.*|ssl_key = <$STORAGE_ROOT/ssl/ssl_private_key.pem|" \
-e "s/^#?ssl_min_protocol\s*=\s*.*/ssl_min_protocol = TLSv1.2/" \
-e "s/^#?ssl_cipher_list\s*=\s*.*/ssl_cipher_list = ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384/" \
-e "s/^#?ssl_prefer_server_ciphers\s*=\s*.*/ssl_prefer_server_ciphers = yes/" \
-e "s|^#?ssl_dh\s*=\s*<.*|ssl_dh = <$STORAGE_ROOT/ssl/dh4096.pem|" \
/etc/dovecot/conf.d/10-ssl.conf
# Disable in-the-clear IMAP/POP because there is no reason for a user to transmit
......@@ -151,13 +151,13 @@ EOF
# The risk is that if the connection is silent for too long it might be reset
# by a peer. See [#129](https://github.com/mail-in-a-box/mailinabox/issues/129)
# and [How bad is IMAP IDLE](http://razor.occams.info/blog/2014/08/09/how-bad-is-imap-idle/).
sed -i -E 's/^#?imap_idle_notify_interval\s*=\s*.*/imap_idle_notify_interval = 4 mins/' /etc/dovecot/conf.d/20-imap.conf
sed -i -E "s/^#?imap_idle_notify_interval\s*=\s*.*/imap_idle_notify_interval = 4 mins/" /etc/dovecot/conf.d/20-imap.conf
# Set POP3 UIDL.
# UIDLs are used by POP3 clients to keep track of what messages they've downloaded.
# For new POP3 servers, the easiest way to set up UIDLs is to use IMAP's UIDVALIDITY
# and UID values, the default in Dovecot.
sed -i -E 's/^#?pop3_uidl_format\s*=\s*.*/pop3_uidl_format = %08Xu%08Xv/' /etc/dovecot/conf.d/20-pop3.conf
sed -i -E "s/^#?pop3_uidl_format\s*=\s*.*/pop3_uidl_format = %08Xu%08Xv/" /etc/dovecot/conf.d/20-pop3.conf
# ### LDA (LMTP)
......@@ -197,7 +197,7 @@ EOF
# Setting a `postmaster_address` is required or LMTP won't start. An alias
# will be created automatically by our management daemon.
sed -i -E 's/^#?postmaster_address\s*=\s*.*/postmaster_address = postmaster@$CFG_HOSTNAME_DOMAIN/' /etc/dovecot/conf.d/15-lda.conf
sed -i -E "s/^#?postmaster_address\s*=\s*.*/postmaster_address = postmaster@$CFG_HOSTNAME_DOMAIN/" /etc/dovecot/conf.d/15-lda.conf
# ### Sieve
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment