28 lines
690 B
Bash
Executable file
28 lines
690 B
Bash
Executable file
#!/bin/ash
|
|
|
|
cat >> /etc/dovecot/dovecot-ldap.conf.ext << DOVECOTLDAP
|
|
hosts = $LDAP_SERVER
|
|
base = $LDAP_BASE
|
|
auth_bind = yes
|
|
user_filter = (&(objectClass=posixAccount)(mail=%u))
|
|
pass_filter = (&(objectClass=posixAccount)(mail=%u))
|
|
user_attrs = \
|
|
=home=/var/vmail/%d/%n, \
|
|
=mail=maildir:/var/vmail/%d/%n/Maildir
|
|
DOVECOTLDAP
|
|
|
|
cat > /etc/dovecot/conf.d/10-ssl.conf << SSL
|
|
ssl = required
|
|
ssl_cert = <$TLS_FULLCHAIN
|
|
ssl_key = <$TLS_KEY
|
|
|
|
ssl_dh_parameters_length = 2048
|
|
SSL
|
|
|
|
# debugging
|
|
#echo -e "auth_verbose=yes\nauth_debug=yes\nauth_debug_passwords=yes" >> /etc/dovecot/dovecot.conf
|
|
|
|
[ -e /var/lib/dovecot/instances ] && rm -rf /var/lib/dovecot/instances
|
|
|
|
exec dovecot -F
|