Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

Commit

Permalink
Add configuration for postfix
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Bartels <[email protected]>
  • Loading branch information
fbartels committed Jun 11, 2021
1 parent 7402788 commit 0020170
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@ VOLUME ["/etc/kopano/", "/var/lib/mysql/", "/var/lib/kopano/"]
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN apt-get update && \
apt-get install --no-install-recommends -y curl gnupg2 pwgen software-properties-common && \
apt-get install --no-install-recommends -y curl gnupg2 jq pwgen software-properties-common && \
curl -fsSL $KOPANO_ONE_REPOSITORY_URL/$ONE_VERSION/gpg | apt-key add - && \
add-apt-repository "deb $KOPANO_ONE_REPOSITORY_URL/$ONE_VERSION $(lsb_release -cs) supported" && \
apt-get upgrade -y -o Dpkg::Options::="--force-confold" && \
rm -rf /var/cache/apt /var/lib/apt/lists/*

ENV DOCKERIZE_VERSION v0.14.0
RUN curl -sfL https://github.com/powerman/dockerize/releases/download/"$DOCKERIZE_VERSION"/dockerize-"$(uname -s)"-"$(uname -m)" \
| install /dev/stdin /usr/local/bin/dockerize && \
dockerize --version

RUN apt-get update && \
apt-get install --no-install-recommends -y kopano-one-$ONE_VERSION kopano-smtpstd kopano-kidmd && \
rm -rf /var/cache/apt /var/lib/apt/lists/* && \
Expand Down
2 changes: 2 additions & 0 deletions runit/kopano-kwebd/run
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ source ../kopano-helper.sh

ensure_config kwebd.cfg
ensure_dir /etc/kopano/kweb/extra.d
ensure_dir /etc/kopano/webapp
cfgdir=/etc/kopano/webapp tpldir=/etc/kopano.in/webapp ensure_config config.php

# read settings from kwebd.cfg into env (emulates systemds EnvironmentFile)
sed s/\ *=\ */=/g "/etc/kopano/kwebd.cfg" > /tmp/kweb-env
Expand Down
19 changes: 19 additions & 0 deletions runit/postfix/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -euo pipefail
set -x

if ! kopano-smtpstd status; then
echo "smptst has not yet started"
exit 1
fi

/usr/sbin/postfix check

# configure postfix automatically based on smtpstd configuration
postconf -e virtual_mailbox_domains="$(kopano-smtpstd status --json |jq -r '.domains | join(" ")')"
postconf -e relayhost=[127.0.0.1]:10025
postconf -e default_transport=smtp
postconf -e relay_transport=smtp

#exec /usr/lib/postfix/sbin/master -d
exec /usr/sbin/postfix -c /etc/postfix start-fg

0 comments on commit 0020170

Please sign in to comment.