2025-01-27 18:19:49 +01:00
|
|
|
FROM alpine:latest AS qpsmtpd-setup
|
|
|
|
|
|
|
|
RUN apk update && apk add --no-cache git
|
|
|
|
|
|
|
|
WORKDIR /tmp
|
|
|
|
|
2025-02-07 09:47:45 +01:00
|
|
|
# use the repository fork of byterazor because of reading config from environment variables
|
2025-01-27 18:19:49 +01:00
|
|
|
RUN git clone https://gitea.federationhq.de/byterazor/qpsmtpd.git
|
2025-02-07 09:47:45 +01:00
|
|
|
RUN cd /tmp/qpsmtpd;git checkout config
|
2025-01-27 18:19:49 +01:00
|
|
|
|
2025-02-07 09:47:45 +01:00
|
|
|
RUN git clone https://gitea.federationhq.de/byterazor/QPSMTPD-MailserverInterface.git
|
2025-01-27 18:19:49 +01:00
|
|
|
FROM debian:stable-slim
|
|
|
|
|
2025-02-07 09:47:45 +01:00
|
|
|
RUN apt-get update && apt-get -qy install perl-base tini bash
|
2025-01-27 18:19:49 +01:00
|
|
|
|
|
|
|
# qpsmtpd dependencies
|
|
|
|
RUN apt-get -qy install libnet-dns-perl libmime-base64-urlsafe-perl libtimedate-perl
|
2025-02-07 09:47:45 +01:00
|
|
|
RUN apt-get -qy install libmailtools-perl libnet-ip-perl libdbd-mariadb-perl libdbd-mysql-perl
|
|
|
|
RUN apt-get -qy install libclamav-client-perl cpanminus libmoose-perl
|
2025-01-27 18:19:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
# qpsmtpd runs under the smtpd user
|
|
|
|
RUN adduser -u 34342 --disabled-login smtpd
|
|
|
|
RUN mkdir -p /usr/share/qpsmtpd
|
|
|
|
|
|
|
|
COPY --from=qpsmtpd-setup /tmp/qpsmtpd/qpsmtpd /usr/bin/
|
|
|
|
COPY --from=qpsmtpd-setup /tmp/qpsmtpd/qpsmtpd-forkserver /usr/bin/
|
|
|
|
COPY --from=qpsmtpd-setup /tmp/qpsmtpd/qpsmtpd-prefork /usr/bin/
|
|
|
|
COPY --from=qpsmtpd-setup /tmp/qpsmtpd/plugins /usr/share/qpsmtpd/plugins
|
|
|
|
COPY --from=qpsmtpd-setup /tmp/qpsmtpd/lib /usr/share/perl5/
|
2025-02-07 09:47:45 +01:00
|
|
|
COPY --from=qpsmtpd-setup /tmp/QPSMTPD-MailserverInterface/federationhq_rcpt /usr/share/qpsmtpd/plugins/federationhq_rcpt
|
|
|
|
COPY --from=qpsmtpd-setup /tmp/QPSMTPD-MailserverInterface/clamdscan /usr/share/qpsmtpd/plugins/virus/clamdscan
|
2025-02-07 15:47:51 +01:00
|
|
|
COPY --from=qpsmtpd-setup /tmp/QPSMTPD-MailserverInterface/Net/LMTP.pm /usr/share/perl5/Net/LMTP.pm
|
2025-02-07 12:00:55 +01:00
|
|
|
COPY --from=qpsmtpd-setup /tmp/QPSMTPD-MailserverInterface/queue/lmtp /usr/share/qpsmtpd/plugins/queue/lmtp
|
2025-02-07 09:47:45 +01:00
|
|
|
RUN cpanm Net::ClamAV::Client
|
2025-02-08 19:03:39 +01:00
|
|
|
RUN cpanm Minion
|
|
|
|
RUN cpanm Minion::Backend::mysql
|
2025-02-07 12:00:55 +01:00
|
|
|
|
2025-01-27 18:19:49 +01:00
|
|
|
# create spool directory
|
|
|
|
RUN mkdir -p /var/spool/qpsmtpd
|
|
|
|
RUN chown smtpd:smtpd /var/spool/qpsmtpd
|
|
|
|
RUN chmod 0700 /var/spool/qpsmtpd
|
|
|
|
|
|
|
|
ADD scripts/entryPoint.sh /entryPoint.sh
|
|
|
|
RUN chmod a+x /entryPoint.sh
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/bin/tini", "--", "/entryPoint.sh"]
|
|
|
|
|