Skip to content

Commit

Permalink
v1.0.1 - updated base image to ubuntu:22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
Topheee committed Jan 21, 2023
1 parent 62c96fd commit 7d07731
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag topheee/postfix-courier-mail:1.0
run: docker build . --file Dockerfile --tag topheee/postfix-courier-mail:beta
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_HUB_PW }}" | docker login -u "${{ secrets.DOCKER_HUB_USER }}" --password-stdin
run: echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USER }}" --password-stdin
- name: Push the Docker image
run: docker push topheee/postfix-courier-mail:1.0
run: docker push topheee/postfix-courier-mail:beta
- name: Logout of Docker Hub
run: docker logout

20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Docker Image Release

on:
release:
types: [published]

jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag topheee/postfix-courier-mail:${{ github.event.release.name }}
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USER }}" --password-stdin
- name: Push the Docker image
run: docker push topheee/postfix-courier-mail:${{ github.event.release.name }}
- name: Logout of Docker Hub
run: docker logout

8 changes: 2 additions & 6 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag topheee/postfix-courier-mail:1.0
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_HUB_PW }}" | docker login -u "${{ secrets.DOCKER_HUB_USER }}" --password-stdin
- name: Push the Docker image
run: docker push topheee/postfix-courier-mail:1.0
run: docker build . --file Dockerfile --tag topheee/postfix-courier-mail:weekly
- name: Logout of Docker Hub
run: docker logout

24 changes: 15 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu:focal
FROM ubuntu:22.04

# SMTP and IMAPS ports
# SMTP and IMAPS
EXPOSE 25 993

# *** SMTP ***
Expand Down Expand Up @@ -113,20 +113,26 @@ RUN postconf -e 'home_mailbox = emails/' && \
postconf -e 'swap_bangpath = no' && \
postconf -e 'tls_append_default_CA = no' && \
postconf -e 'tls_dane_digests = sha512 sha256' && \
postconf -e 'tls_preempt_cipherlist = yes' && \
# we run in chroot mode (although it is not really necessary, because Docker already does it)
echo 'smtp inet n - y - - smtpd' >> /etc/postfix/master.cf
postconf -e 'tls_preempt_cipherlist = yes'

# we run in chroot mode (although it is not really necessary, because Docker already does it)
RUN sed -i '/^smtp /d' /etc/postfix/master.cf && \
echo 'smtp inet n - y - - smtpd' >> /etc/postfix/master.cf

# *** SASL ***
# based on https://wiki.debian.org/PostfixAndSASL

RUN usermod -G sasl postfix && \
echo 'pwcheck_method: saslauthd' >> /etc/postfix/sasl/smtpd.conf && \
echo 'mech_list: plain login' >> /etc/postfix/sasl/smtpd.conf && \
sed 's/^#*START=.*/START=yes/' /etc/default/saslauthd | \
sed 's/^#*MECHANISMS=.*$/MECHANISMS="rimap"/' | \
sed 's/^#*MECH_OPTIONS=.*$/MECH_OPTIONS="localhost"/' | \
sed 's/^#*OPTIONS=.*$/OPTIONS="-c -m \/var\/spool\/postfix\/var\/run\/saslauthd"/' > /etc/default/saslauthd-postfix
sed '/^#*START=.*/d' /etc/default/saslauthd | \
sed '/^#*MECHANISMS=.*/d' | \
sed '/^#*MECH_OPTIONS=.*/d' | \
sed '/^#*OPTIONS=.*/d' > /etc/default/saslauthd-postfix && \
echo 'START=yes' >> /etc/default/saslauthd-postfix && \
echo 'MECHANISMS="rimap"' >> /etc/default/saslauthd-postfix && \
echo 'MECH_OPTIONS="localhost"' >> /etc/default/saslauthd-postfix && \
echo 'OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"' >> /etc/default/saslauthd-postfix

# *** IMAP(S) ***
# see also https://help.ubuntu.com/community/PostfixCompleteVirtualMailSystemHowto
Expand Down
2 changes: 1 addition & 1 deletion entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fi

postfix reload

/etc/init.d/rsyslog start
/usr/sbin/rsyslogd -f/etc/rsyslog.conf
sleep 1
/etc/init.d/saslauthd start
/etc/init.d/postfix start
Expand Down

0 comments on commit 7d07731

Please sign in to comment.