Browse Source

simplify code

pull/91/head
kgskgs 4 years ago
parent
commit
e0ee038763
1 changed files with 3 additions and 6 deletions
  1. +3
    -6
      emailwiz.sh

+ 3
- 6
emailwiz.sh View File

@@ -114,12 +114,10 @@ spamassassin unix - n n - - pipe
# /etc/dovecot/dovecot.conf because it's easier to manage. You can get a backup # /etc/dovecot/dovecot.conf because it's easier to manage. You can get a backup
# of the original in /usr/share/dovecot if you want. # of the original in /usr/share/dovecot if you want.


dovecot_v="$(dovecot --version | cut -d ' ' -f1 | cut -d '.' -f1-2)"
dovecot_v_major=${dovecot_v%.*}
dovecot_v_minor=${dovecot_v#*.}
dovecot_v="$(dovecot --version | cut -d '.' -f1-2)"
dovecot_dh="ssl_dh = </usr/share/dovecot/dh.pem" dovecot_dh="ssl_dh = </usr/share/dovecot/dh.pem"


[ $dovecot_v_major -eq 2 ] && [ $dovecot_v_minor -lt 3 ] || [ $dovecot_v_major -lt 2 ] && dovecot_dh="#$dovecot_dh"
[ ${dovecot_v%.*} -eq 2 ] && [ ${dovecot_v#*.} -lt 3 ] || [ ${dovecot_v%.*} -lt 2 ] && dovecot_dh="#$dovecot_dh"


echo "Creating Dovecot config (v $dovecot_v)..." echo "Creating Dovecot config (v $dovecot_v)..."


@@ -134,8 +132,7 @@ echo "# Dovecot config
ssl = required ssl = required
ssl_cert = <$certdir/fullchain.pem ssl_cert = <$certdir/fullchain.pem
ssl_key = <$certdir/privkey.pem ssl_key = <$certdir/privkey.pem
#You have to add ssl_dh if your Dovecot version is 2.3 or greater!
#https://wiki.dovecot.org/SSL/DovecotConfiguration#SSL_security_settings
# You have to add ssl_dh if your Dovecot version is 2.3 or greater!
$dovecot_dh $dovecot_dh
# Plaintext login. This is safe and easy thanks to SSL. # Plaintext login. This is safe and easy thanks to SSL.
auth_mechanisms = plain login auth_mechanisms = plain login


Loading…
Cancel
Save