Switching to alpine:3.12 and use fetchmail from alpine repository

alpine3:12 provides fetchmail 6.4.5, so building fetchmail from alpha branch
is not needed anymore (ssl wrapped mode issue fixed) since 6.4.2
master
ofthesun9 4 years ago
parent 1d35b1283d
commit e8b72099a7

@ -1,17 +1,4 @@
# First stage: Build
ARG DISTRO=alpine:3.10
FROM $DISTRO as builder
# build dependencies
RUN apk add --no-cache curl tar xz autoconf git gettext build-base openssl openssl-dev
RUN curl -L 'https://sourceforge.net/projects/fetchmail/files/branch_7-alpha/fetchmail-7.0.0-alpha6.tar.xz/download' | tar xJ
RUN cd fetchmail-7.0.0-alpha6 && \
sed -i -e 's/SSLv3_client_method/SSLv23_client_method/' socket.c && \
./configure --with-ssl --prefix /usr/local --disable-nls && \
make
ARG DISTRO=alpine:3.10
ARG DISTRO=alpine:3.12
FROM $DISTRO
# python3 shared with most images
@ -20,13 +7,11 @@ RUN apk add --no-cache \
&& pip3 install --upgrade pip
# Image specific layers under this line
RUN apk add --no-cache ca-certificates openssl \
RUN apk add --no-cache fetchmail ca-certificates openssl \
&& pip3 install requests
COPY --from=builder /fetchmail-7.0.0-alpha6/fetchmail /usr/local/bin
COPY fetchmail.py /fetchmail.py
RUN adduser -D fetchmail
USER fetchmail
CMD ["/fetchmail.py"]

@ -56,7 +56,7 @@ def run(debug):
for fetch in fetches:
fetchmailrc = ""
options = "options antispam 501, 504, 550, 553, 554"
options += " sslmode wrapped" if fetch["tls"] else ""
options += " ssl" if fetch["tls"] else ""
options += " keep" if fetch["keep"] else " fetchall"
fetchmailrc += RC_LINE.format(
user_email=escape_rc_string(fetch["user_email"]),

Loading…
Cancel
Save