From ceef6d6fd3e7f8fb2c57d8afbc733cf4049cc4c8 Mon Sep 17 00:00:00 2001 From: "andre.peters" Date: Tue, 9 Jan 2018 11:15:52 +0100 Subject: [PATCH] [Dovecot] Dovecot 2.3, Pigeonhole 0.5 [Watchdog] Fix Dovecot health check --- data/Dockerfiles/dovecot/Dockerfile | 16 ++++++++-------- data/Dockerfiles/watchdog/watchdog.sh | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/data/Dockerfiles/dovecot/Dockerfile b/data/Dockerfiles/dovecot/Dockerfile index 669f51ff..e59af905 100644 --- a/data/Dockerfiles/dovecot/Dockerfile +++ b/data/Dockerfiles/dovecot/Dockerfile @@ -3,8 +3,8 @@ LABEL maintainer "Andre Peters " ARG DEBIAN_FRONTEND=noninteractive ENV LC_ALL C -ENV DOVECOT_VERSION 2.2.33.2 -ENV PIGEONHOLE_VERSION 0.4.21 +ENV DOVECOT_VERSION 2.3.0 +ENV PIGEONHOLE_VERSION 0.5.0.1 RUN apt-get update && apt-get -y --no-install-recommends install \ automake \ @@ -63,21 +63,21 @@ RUN apt-get update && apt-get -y --no-install-recommends install \ && rm -rf /var/lib/apt/lists/* -RUN curl https://www.dovecot.org/releases/2.2/dovecot-$DOVECOT_VERSION.tar.gz | tar xvz \ - && cd dovecot-$DOVECOT_VERSION \ +RUN curl https://www.dovecot.org/releases/2.3/dovecot-$DOVECOT_VERSION.tar.gz | tar xvz \ + && cd dovecot-ce-$DOVECOT_VERSION \ && ./configure --with-mysql --with-lzma --with-lz4 --with-ssl=openssl --with-notify=inotify --with-storages=mdbox,sdbox,maildir,mbox,imapc,pop3c --with-bzlib --with-zlib \ && make -j3 \ && make install \ && make clean \ - && cd .. && rm -rf dovecot-$DOVECOT_VERSION \ - && curl https://pigeonhole.dovecot.org/releases/2.2/dovecot-2.2-pigeonhole-$PIGEONHOLE_VERSION.tar.gz | tar xvz \ - && cd dovecot-2.2-pigeonhole-$PIGEONHOLE_VERSION \ + && cd .. && rm -rf dovecot-ce-$DOVECOT_VERSION \ + && curl https://pigeonhole.dovecot.org/releases/2.3/dovecot-2.3-pigeonhole-$PIGEONHOLE_VERSION.tar.gz | tar xvz \ + && cd dovecot-2.3-pigeonhole-$PIGEONHOLE_VERSION \ && ./configure \ && make -j3 \ && make install \ && make clean \ && cd .. \ - && rm -rf dovecot-2.2-pigeonhole-$PIGEONHOLE_VERSION + && rm -rf dovecot-2.3-pigeonhole-$PIGEONHOLE_VERSION RUN cpanm Data::Uniqid Mail::IMAPClient String::Util RUN echo '* * * * * root /usr/local/bin/imapsync_cron.pl' > /etc/cron.d/imapsync diff --git a/data/Dockerfiles/watchdog/watchdog.sh b/data/Dockerfiles/watchdog/watchdog.sh index e0da33de..1302f49a 100755 --- a/data/Dockerfiles/watchdog/watchdog.sh +++ b/data/Dockerfiles/watchdog/watchdog.sh @@ -147,7 +147,7 @@ postfix_checks() { while [ ${err_count} -lt ${THRESHOLD} ]; do host_ip=$(get_container_ip postfix-mailcow) err_c_cur=${err_count} - /usr/lib/nagios/plugins/check_smtp -4 -H ${host_ip} -p 589 -f watchdog -C "RCPT TO:null@localhost" -C DATA -C . -R 250 1>&2; err_count=$(( ${err_count} + $? )) + /usr/lib/nagios/plugins/check_smtp -4 -H ${host_ip} -p 589 -f "watchdog@invalid" -C "RCPT TO:null@localhost" -C DATA -C . -R 250 1>&2; err_count=$(( ${err_count} + $? )) /usr/lib/nagios/plugins/check_smtp -4 -H ${host_ip} -p 589 -S 1>&2; err_count=$(( ${err_count} + $? )) [ ${err_c_cur} -eq ${err_count} ] && [ ! $((${err_count} - 1)) -lt 0 ] && err_count=$((${err_count} - 1)) diff_c=1 [ ${err_c_cur} -ne ${err_count} ] && diff_c=$(( ${err_c_cur} - ${err_count} )) @@ -167,7 +167,7 @@ dovecot_checks() { while [ ${err_count} -lt ${THRESHOLD} ]; do host_ip=$(get_container_ip dovecot-mailcow) err_c_cur=${err_count} - /usr/lib/nagios/plugins/check_smtp -4 -H ${host_ip} -p 24 -f "watchdog" -C "RCPT TO:" -L -R "User doesn't exist" 1>&2; err_count=$(( ${err_count} + $? )) + /usr/lib/nagios/plugins/check_smtp -4 -H ${host_ip} -p 24 -f "watchdog@invalid" -C "RCPT TO:" -L -R "User doesn't exist" 1>&2; err_count=$(( ${err_count} + $? )) /usr/lib/nagios/plugins/check_imap -4 -H ${host_ip} -p 993 -S -e "OK " 1>&2; err_count=$(( ${err_count} + $? )) /usr/lib/nagios/plugins/check_imap -4 -H ${host_ip} -p 143 -e "OK " 1>&2; err_count=$(( ${err_count} + $? )) /usr/lib/nagios/plugins/check_tcp -4 -H ${host_ip} -p 10001 -e "VERSION" 1>&2; err_count=$(( ${err_count} + $? ))