seems to work

This commit is contained in:
Simon Bruder 2018-03-24 20:52:41 +00:00
parent 0d17808d1c
commit cd706d76fe
6 changed files with 8 additions and 14 deletions

View file

@ -7,7 +7,7 @@ RUN apk add --no-cache \
RUN sed -i 's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' /etc/dovecot/conf.d/10-auth.conf \ RUN sed -i 's/#!include auth-ldap.conf.ext/!include auth-ldap.conf.ext/' /etc/dovecot/conf.d/10-auth.conf \
&& sed -i 's/!include auth-passwdfile.conf.ext/#!include auth-passwdfile.conf.ext/' /etc/dovecot/conf.d/10-auth.conf \ && sed -i 's/!include auth-passwdfile.conf.ext/#!include auth-passwdfile.conf.ext/' /etc/dovecot/conf.d/10-auth.conf \
&& sed -i 's/#first_valid_uid = .*/first_valid_uid = 100/g' /etc/dovecot/conf.d/10-mail.conf \ && sed -i 's/#first_valid_uid = .*/first_valid_uid = 100/g' /etc/dovecot/conf.d/10-mail.conf \
&& sed -i 's/#last = .*/last = 100/g' /etc/dovecot/conf.d/10-mail.conf && sed -i 's/#last_valid_uid = .*/last_valid_uid = 100/g' /etc/dovecot/conf.d/10-mail.conf
RUN addgroup -S vmail \ RUN addgroup -S vmail \
&& adduser -S -g '' -H -D -h /var/vmail vmail vmail && adduser -S -g '' -H -D -h /var/vmail vmail vmail

View file

@ -1,6 +1,7 @@
passdb { passdb {
driver = ldap driver = ldap
args = /etc/dovecot/dovecot-ldap.conf.ext args = /etc/dovecot/dovecot-ldap.conf.ext
override_fields = user=%{auth_user}
} }
userdb { userdb {

View file

@ -4,11 +4,7 @@ cat >> /etc/dovecot/dovecot-ldap.conf.ext << DOVECOTLDAP
hosts = $LDAP_SERVER hosts = $LDAP_SERVER
base = $LDAP_BASE base = $LDAP_BASE
auth_bind = yes auth_bind = yes
user_filter = (&(objectClass=posixAccount)(mail=%u))
pass_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 DOVECOTLDAP
cat > /etc/dovecot/conf.d/10-ssl.conf << SSL cat > /etc/dovecot/conf.d/10-ssl.conf << SSL
@ -19,9 +15,6 @@ ssl_key = <$TLS_KEY
ssl_dh_parameters_length = 2048 ssl_dh_parameters_length = 2048
SSL 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 [ -e /var/lib/dovecot/instances ] && rm -rf /var/lib/dovecot/instances
exec dovecot -F exec dovecot -F

View file

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
sudo chown root:root aliases docker-compose exec postfix sh -c "
docker-compose exec postfix postmap /etc/postfix/virtual chown root:root /etc/postfix/virtual;
sudo chown $USER:$USER aliases postmap /etc/postfix/virtual;
chown $(id -u):$(id -g) /etc/postfix/virtual"

View file

@ -43,8 +43,6 @@ RUN echo '' > /etc/postfix/main.cf \
&& postconf -e strict_rfc821_envelopes='yes' \ && postconf -e strict_rfc821_envelopes='yes' \
&& echo 'MAILER-DAEMON: postmaster\npostmaster: root' > /etc/postfix/aliases && echo 'MAILER-DAEMON: postmaster\npostmaster: root' > /etc/postfix/aliases
# && postconf -e virtual_mailbox_maps='ldap:/etc/postfix/ldap/mailbox.cf' \
COPY master.cf /etc/postfix/master.cf COPY master.cf /etc/postfix/master.cf
COPY smtp_header_checks /etc/postfix/smtp_header_checks COPY smtp_header_checks /etc/postfix/smtp_header_checks

View file

@ -13,8 +13,9 @@ postconf -e smtpd_tls_cert_file="$TLS_FULLCHAIN"
postconf -e virtual_mailbox_domains="$DOMAINS" postconf -e virtual_mailbox_domains="$DOMAINS"
for hash in access_recipient access_sender access_helo;do #virtual;do for hash in access_recipient access_sender access_helo virtual;do
touch /etc/postfix/$hash touch /etc/postfix/$hash
chown root:root /etc/postfix/$hash
postmap /etc/postfix/$hash postmap /etc/postfix/$hash
done done