Skip to content

Commit

Permalink
Build an experimental version (Cyrus 3.8.0~rc1)
Browse files Browse the repository at this point in the history
  • Loading branch information
guimard committed May 15, 2023
1 parent fa435d6 commit d62dc72
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 8 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,26 @@ jobs:
provider: dockerhub
short_description: 'Cyrus-Imapd and Postfix based on Debian backports packages'
readme_file: './README.md'

build-and-push-cyrus-imapd-postfix-experimental:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image for cyrus-imapd-postfix
uses: docker/build-push-action@v4
with:
context: ./dev
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/s390x
push: true
tags: |
yadd/cyrus-imapd-postfix:experimental
22 changes: 14 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,27 @@ ENV DEBIAN_VERSION=bullseye

RUN echo "# Install packages from ${DEBIAN_VERSION}" && \
apt-get -y update && \
apt-get -y install xz-utils && \
apt-get -y dist-upgrade && \
echo "deb http://deb.debian.org/debian" ${DEBIAN_VERSION}"-backports main" > /etc/apt/sources.list.d/backports.list && \
apt-get -y update

FROM debian-backports-updated
FROM debian-backports-updated as debian-backports-updated-with-s6

ARG S6_OVERLAY_VERSION=3.1.3.0

# S6
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/syslogd-overlay-noarch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && rm /tmp/s6-overlay-noarch.tar.xz && \
tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz && rm /tmp/s6-overlay-x86_64.tar.xz && \
tar -C / -Jxpf /tmp/syslogd-overlay-noarch.tar.xz && rm /tmp/syslogd-overlay-noarch.tar.xz

FROM debian-backports-updated-with-s6

ENV DEBIAN_VERSION=bullseye

LABEL maintainer="Yadd [email protected]>" \
name="yadd/cyrus-imapd-postfix" \
version="v1.0"
Expand Down Expand Up @@ -71,13 +84,6 @@ RUN echo 'conversations: 1' >> /etc/imapd.conf
RUN echo 'conversations_db: twoskip' >> /etc/imapd.conf
RUN /usr/lib/cyrus/bin/ctl_conversationsdb -b -r

ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/syslogd-overlay-noarch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && rm /tmp/s6-overlay-noarch.tar.xz && \
tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz && rm /tmp/s6-overlay-x86_64.tar.xz && \
tar -C / -Jxpf /tmp/syslogd-overlay-noarch.tar.xz && rm /tmp/syslogd-overlay-noarch.tar.xz


EXPOSE 25 465 587 110 143 993 995 2000 8008 8443

Expand Down
97 changes: 97 additions & 0 deletions dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
ARG DEBIANVERSION=unstable

FROM debian:${DEBIANVERSION}-slim as debian-unstable-updated

ENV DEBIAN_VERSION=unstable

COPY apt-order /etc/apt/preferences.d/

RUN echo "# Install packages from ${DEBIAN_VERSION}" && \
echo "deb http://deb.debian.org/debian experimental main" > /etc/apt/sources.list.d/backports.list && \
apt-get -y update && \
apt-get -y dist-upgrade && \
apt-get -y install xz-utils

FROM debian-unstable-updated as debian-unstable-updated-with-s6

ARG S6_OVERLAY_VERSION=3.1.3.0

# S6
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/syslogd-overlay-noarch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz && rm /tmp/s6-overlay-noarch.tar.xz && \
tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz && rm /tmp/s6-overlay-x86_64.tar.xz && \
tar -C / -Jxpf /tmp/syslogd-overlay-noarch.tar.xz && rm /tmp/syslogd-overlay-noarch.tar.xz

FROM debian-unstable-updated-with-s6

ENV DEBIAN_VERSION=bullseye

LABEL maintainer="Yadd [email protected]>" \
name="yadd/cyrus-imapd-postfix" \
version="v1.0"

ENV DEBIAN_VERSION=bullseye \
MAILNAME=mail.example.com \
OTHER_DESTINATIONS="example.com mail.example.com" \
RELAY_HOST= \
MYNETWORKS="127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128" \
ROOT_ADDRESS= \
CYRUS_PWD= \
SASL_PWCHECK_METHOD="saslauthd auxprop" \
SASLDB=sasldb

RUN \
echo cyrus-common cyrus-common/removespools boolean false | debconf-set-selections && \
echo postfix postfix/main_mailer_type select "Internet Site" | debconf-set-selections && \
echo postfix postfix/mailname string "$MAILNAME" | debconf-set-selections && \
echo postfix postfix/destinations string "$OTHER_DESTINATIONS" | debconf-set-selections && \
echo postfix postfix/relayhost string "" | debconf-set-selections && \
echo postfix postfix/procmail boolean false | debconf-set-selections && \
echo postfix postfix/protocols select all | debconf-set-selections && \
echo postfix postfix/recipient_delim string "+" | debconf-set-selections && \
echo postfix postfix/chattr boolean false | debconf-set-selections && \
echo postfix postfix/mynetworks string "$MYNETWORKS" | debconf-set-selections && \
echo postfix postfix/mailbox_limit string 0 | debconf-set-selections && \
echo postfix postfix/root_address string "$ROOT_ADDRESS" | debconf-set-selections && \
echo postfix postfix/newaliases boolean false | debconf-set-selections && \
apt install -y xz-utils \
cyrus-imapd/experimental \
cyrus-pop3d/experimental \
cyrus-nntpd/experimental \
cyrus-admin/experimental \
cyrus-caldav/experimental \
libcyrus-imap-perl/experimental \
postfix \
sasl2-bin && \
apt autoremove -y && apt clean && rm -rf /var/lib/apt/lists/* && \
rm -f /etc/postfix/master.cf.proto \
/etc/postfix/sasl_passwd \
/etc/postfix/canonical \
/etc/postfix/dynamicmaps.cf \
/etc/postfix/sasl_passwd.db \
/etc/postfix/canonical \
/etc/postfix/dynamicmaps.cf \
/etc/postfix/sasl_passwd.db \
/etc/postfix/main.cf \
/etc/postfix/regexmap \
/etc/postfix/canonical.db \
/etc/postfix/master.cf \
/etc/postfix/main.cf.proto

RUN perl -i -pe 's/httpmodules: .*$/httpmodules: carddav caldav jmap/' /etc/imapd.conf
RUN echo 'conversations: 1' >> /etc/imapd.conf
RUN echo 'conversations_db: twoskip' >> /etc/imapd.conf
RUN /usr/lib/cyrus/bin/ctl_conversationsdb -b -r


EXPOSE 25 465 587 110 143 993 995 2000 8008 8443

VOLUME [ "/etc", "/var/lib/cyrus", "/var/spool/cyrus", "/var/spool/mail", "/var/spool/sieve" ]

copy install /

CMD ["/usr/sbin/cyrmaster", "-D", "-l", "32", "-C", "/etc/imapd.conf", "-M", "/etc/cyrus.conf"]

ENTRYPOINT ["/init"]
8 changes: 8 additions & 0 deletions dev/apt-order
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Package: *
Pin: release a=unstable
Pin-Priority: 500

Package: *
Pin: release a=experimental
Pin-Priority: 1

11 changes: 11 additions & 0 deletions dev/install/etc/cont-init.d/cyrus-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/command/with-contenv sh

mkdir -p /run/cyrus
chown cyrus /run/cyrus

if test "$CYRUS_PWD" = ""; then
echo "CYRUS_PWD isn't set, unable to configure cyrus adm password" >&2
else
echo -n "$CYRUS_PWD" | saslpasswd2 -p cyrus
fi
perl -i -pe 's/^sasl_auxprop_plugin:.*$//;s/^sasl_pwcheck_method:.*$/sasl_pwcheck_method: '$SASL_PWCHECK_METHOD'\nsasl_auxprop_plugin: '$SASLDB'/' /etc/imapd.conf
27 changes: 27 additions & 0 deletions dev/install/etc/services.d/postfix/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/command/with-contenv sh

if test ! -e /etc/postfix/main.cf; then

#echo cyrus-common cyrus-common/removespools boolean false | debconf-set-selections
#echo postfix postfix/main_mailer_type select "Internet Site" | debconf-set-selections
#echo postfix postfix/relayhost string "" | debconf-set-selections
#echo postfix postfix/procmail boolean false | debconf-set-selections
#echo postfix postfix/protocols select all | debconf-set-selections
#echo postfix postfix/recipient_delim string "+" | debconf-set-selections
#echo postfix postfix/chattr boolean false | debconf-set-selections
#echo postfix postfix/mailbox_limit string 0 | debconf-set-selections
#echo postfix postfix/newaliases boolean false | debconf-set-selections
echo postfix postfix/mailname string "$MAILNAME" | debconf-set-selections
echo postfix postfix/destinations string "$OTHER_DESTINATIONS" | debconf-set-selections
echo postfix postfix/mynetworks string "$MYNETWORKS" | debconf-set-selections
echo postfix postfix/root_address string "$ROOT_ADDRESS" | debconf-set-selections

/var/lib/dpkg/info/postfix.postinst configure
export DEBIAN_FRONTEND="noninteractive"
dpkg-reconfigure postfix
echo 'cyrus unix - n n - - pipe' >> /etc/postfix/master.cf
echo ' flags=DRX user=cyrus argv=/usr/lib/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}' >> /etc/postfix/master.cf
echo "mailbox_transport = cyrus" >> /etc/postfix/main.cf
fi

postfix start-fg

0 comments on commit d62dc72

Please sign in to comment.