diff --git a/Containerfile b/Containerfile index 888587c..c9d6328 100644 --- a/Containerfile +++ b/Containerfile @@ -4,17 +4,19 @@ RUN apk update && apk add --no-cache git WORKDIR /tmp -# use the repository fork of byterazor because of additional plugins +# use the repository fork of byterazor because of reading config from environment variables RUN git clone https://gitea.federationhq.de/byterazor/qpsmtpd.git -RUN cd /tmp/qpsmtpd;git checkout rcpt_mysql +RUN cd /tmp/qpsmtpd;git checkout config +RUN git clone https://gitea.federationhq.de/byterazor/QPSMTPD-MailserverInterface.git FROM debian:stable-slim -RUN apt-get update && apt-get -qy install perl tini bash +RUN apt-get update && apt-get -qy install perl-base tini bash # qpsmtpd dependencies RUN apt-get -qy install libnet-dns-perl libmime-base64-urlsafe-perl libtimedate-perl -RUN apt-get -qy install libmailtools-perl libnet-ip-perl libdbd-mariadb-perl libdbd-mysql-perl +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 # qpsmtpd runs under the smtpd user @@ -26,21 +28,15 @@ 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/ - +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 +RUN cpanm Net::ClamAV::Client # create spool directory RUN mkdir -p /var/spool/qpsmtpd RUN chown smtpd:smtpd /var/spool/qpsmtpd RUN chmod 0700 /var/spool/qpsmtpd -# create base configuration -RUN mkdir -p /etc/qpsmtpd -COPY config /etc/qpsmtpd -RUN chown -R smtpd:smtpd /etc/qpsmtpd - - ADD scripts/entryPoint.sh /entryPoint.sh -ADD scripts/plugins/ /plugins/ -RUN chmod -R a+x /plugins/* RUN chmod a+x /entryPoint.sh ENTRYPOINT ["/usr/bin/tini", "--", "/entryPoint.sh"]