FROM alpine:3.24 LABEL maintainer="Cabillot Julien " COPY entrypoint.sh /entrypoint.sh COPY patch.py /tmp/patch.py # hadolint ignore=DL3018 RUN apk add --no-cache offlineimap openssl tini && \ adduser -D offlineimap && \ # Apply post-install patches: # - UnicodeEncodeError fallback for defective messages (Maildir + IMAP) # - SSL SECLEVEL=1 in imaplib2 to allow connecting to servers with weak DH keys # (OpenSSL 3.x defaults to SECLEVEL=2) python3 /tmp/patch.py && rm /tmp/patch.py COPY --chown=offlineimap offlineimaprc.*.tmpl /home/offlineimap/ USER "offlineimap" ENTRYPOINT ["/sbin/tini", "--"] CMD [ "/entrypoint.sh" ]