Compare commits

...

8 Commits

Author SHA1 Message Date
a4893df95d Merge pull request 'develop' (#6) from develop into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #6
2024-05-11 16:02:34 +00:00
bae26ad0ce Rebase to Alpine 3.19 2024-05-11 16:01:41 +00:00
0f3c1f55c8 Merge pull request 'Move to Alpine 3.17, move to Postfix 3.7.4' (#5) from master into develop
Reviewed-on: #5
2024-05-11 15:59:55 +00:00
6f23ed5a8d Move to Alpine 3.17, move to Postfix 3.7.4
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-23 18:54:14 +00:00
12e18e674e Update 'README.md'
Some checks reported errors
continuous-integration/drone/push Build was killed
2022-12-25 19:39:16 +00:00
ceb1deff74 Add '.drone.yml'
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2022-12-25 19:38:45 +00:00
b58fc0ab55 Open permissions on config files 2022-06-03 15:38:54 +00:00
1d843aaa61 Initial commit 2022-06-03 15:15:31 +00:00
4 changed files with 108 additions and 0 deletions

40
.drone.yml Normal file
View File

@ -0,0 +1,40 @@
kind: pipeline
type: docker
name: build-multiarch-images
platform:
os: linux
arch: amd64
steps:
- name: make-tags
image: node
commands:
- echo -n "${DRONE_COMMIT_SHA:0:10}, latest" > .tags
- name: build
image: thegeeklab/drone-docker-buildx
privileged: true
settings:
registry: git.mrmeeb.stream
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: git.mrmeeb.stream/mrmeeb/postfix
platforms:
- linux/arm64
- linux/amd64
- name: notify
image: plugins/slack
settings:
webhook:
from_secret: slack_webhook
trigger:
branch:
- master
event:
exclude:
- pull_request

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM alpine:3.19
RUN apk update && \
apk add bash gawk cyrus-sasl cyrus-sasl-login cyrus-sasl-crammd5 mailx \
postfix postfix-pgsql && \
rm -rf /var/cache/apk/* && \
mkdir -p /var/log/supervisor/ /var/run/supervisor/ && \
touch /etc/postfix/pgsql-relay-domains.cf && \
touch /etc/postfix/pgsql-transport-maps.cf && \
echo 'maillog_file = /dev/stdout' >> /etc/postfix/main.cf && \
sed -i -e 's/inet_interfaces = localhost/inet_interfaces = all/g' /etc/postfix/main.cf
RUN mkdir /config
COPY run.sh /
RUN chmod +x /run.sh
RUN newaliases
EXPOSE 25
#ENTRYPOINT ["/run.sh"]
CMD ["/run.sh"]

View File

@ -1,3 +1,5 @@
# Postfix Docker # Postfix Docker
[![Build Status](https://drone.mrmeeb.stream/api/badges/MrMeeb/postfix-docker/status.svg)](https://drone.mrmeeb.stream/MrMeeb/postfix-docker)
Dockerised Postfix for fully-dockerised SimpleLogin deployment Dockerised Postfix for fully-dockerised SimpleLogin deployment

45
run.sh Normal file
View File

@ -0,0 +1,45 @@
#!/bin/bash
[ "${DEBUG}" == "yes" ] && set -x
function add_config_value() {
local key=${1}
local value=${2}
# local config_file=${3:-/etc/postfix/main.cf}
[ "${key}" == "" ] && echo "ERROR: No key set !!" && exit 1
[ "${value}" == "" ] && echo "ERROR: No value set !!" && exit 1
echo "Setting configuration option ${key} with value: ${value}"
postconf -e "${key} = ${value}"
}
#Copy files into config dir
#Move missing files from Postfix to /config
mv -n /etc/postfix/main.cf /config/main.cf
mv -n /etc/postfix/master.cf /config/master.cf
mv -n /etc/postfix/pgsql-relay-domains.cf /config/pgsql-relay-domains.cf
mv -n /etc/postfix/pgsql-transport-maps.cf /config/pgsql-transport-maps.cf
#Delete files from Postfix
rm /etc/postfix/main.cf
rm /etc/postfix/master.cf
rm /etc/postfix/pgsql-relay-domains.cf
rm /etc/postfix/pgsql-transport-maps.cf
#Link files into Postfix
ln -s /config/main.cf /etc/postfix/main.cf
ln -s /config/pgsql-relay-domains.cf /etc/postfix/pgsql-relay-domains.cf
ln -s /config/pgsql-transport-maps.cf /etc/postfix/pgsql-transport-maps.cf
ln -s /config/master.cf /etc/postfix/master.cf
#Open permissions
chmod -R 777 /config
#Start services
# If host mounting /var/spool/postfix, we need to delete old pid file before
# starting services
rm -f /var/spool/postfix/pid/master.pid
exec /usr/sbin/postfix -c /etc/postfix start-fg