Compare commits

...

12 Commits

Author SHA1 Message Date
701be3e283 Update alpine Docker tag to v3.22
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
Test Pull Request / Build Image (pull_request) Successful in 53s
Test Pull Request / Notify (pull_request) Successful in 4s
Build Main Image / Build Image (push) Successful in 31s
Build Main Image / Notify (push) Successful in 3s
2025-06-06 19:00:28 +00:00
6479f6b8af Update alpine Docker tag to v3.21
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
Test Pull Request / Build Image (pull_request) Successful in 59s
Test Pull Request / Notify (pull_request) Successful in 2s
Build Main Image / Build Image (push) Successful in 31s
Build Main Image / Notify (push) Successful in 2s
2025-01-20 23:00:21 +00:00
43db89f75d Add Renovate (#8) [skip-ci]
Some checks failed
Build Main Image / Notify (push) Has been cancelled
Build Main Image / Build Image (push) Has been cancelled
Fixes #4

Reviewed-on: #8
2025-01-20 22:42:49 +00:00
ce80b046fb Add Gitea Actions (#7)
All checks were successful
Build Main Image / Build Image (push) Successful in 31s
Build Main Image / Notify (push) Successful in 3s
Reviewed-on: #7
2024-08-04 17:13:58 +00:00
873041c11f Merge pull request 'develop' (#6) from develop into master
Reviewed-on: #6
2024-05-11 16:02:34 +00:00
86a6ac8f44 Rebase to Alpine 3.19 2024-05-11 16:01:41 +00:00
228a63ff4b 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
931355d7dc Move to Alpine 3.17, move to Postfix 3.7.4 2023-03-23 18:54:14 +00:00
872cc263a3 Update 'README.md' 2022-12-25 19:39:16 +00:00
8123cce06f Add '.drone.yml' 2022-12-25 19:38:45 +00:00
99a561421a Open permissions on config files 2022-06-03 15:38:54 +00:00
40a6a73826 Initial commit 2022-06-03 15:15:31 +00:00
5 changed files with 172 additions and 0 deletions

View File

@ -0,0 +1,52 @@
name: Build Main Image
on:
push:
branches:
- 'master'
env:
FULL_TAG: git.mrmeeb.stream/mrmeeb/postfix:latest
jobs:
"Build Image":
runs-on: [ubuntu-docker-latest, linux/amd64]
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: git.mrmeeb.stream
username: ${{ env.GITHUB_ACTOR }}
password: ${{ secrets.GTCR_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ env.FULL_TAG }}
provenance: false
- name: Notify on failure
uses: rjstone/discord-webhook-notify@v1
if: failure()
with:
severity: error
details: Build failed!
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
username: Gitea
avatarUrl: ${{ vars.RUNNER_ICON_URL }}
"Notify":
runs-on: [ubuntu-docker-latest, linux/amd64]
needs: ["Build Image"]
steps:
- name: Notify of success
uses: rjstone/discord-webhook-notify@v1
if: success()
with:
severity: info
details: Build succeeded!
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
username: Gitea
avatarUrl: ${{ vars.RUNNER_ICON_URL }}

View File

@ -0,0 +1,46 @@
name: Test Pull Request
on:
pull_request:
branches:
- 'master'
env:
FULL_TAG: git.mrmeeb.stream/mrmeeb/postfix:develop
jobs:
"Build Image":
runs-on: [ubuntu-docker-latest, linux/amd64]
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
uses: docker/build-push-action@v5
with:
push: false
platforms: linux/amd64,linux/arm64
tags: ${{ env.FULL_TAG }}
provenance: false
- name: Notify on failure
uses: rjstone/discord-webhook-notify@v1
if: failure()
with:
severity: error
details: Build failed!
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
username: Gitea
avatarUrl: ${{ vars.RUNNER_ICON_URL }}
"Notify":
runs-on: [ubuntu-docker-latest, linux/amd64]
needs: ["Build Image"]
steps:
- name: Notify of success
uses: rjstone/discord-webhook-notify@v1
if: success()
with:
severity: info
details: Build succeeded!
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
username: Gitea
avatarUrl: ${{ vars.RUNNER_ICON_URL }}

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM alpine:3.22
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"]

8
renovate.json Normal file
View File

@ -0,0 +1,8 @@
{
"extends": [":automergeMinor", ":automergePr", ":automergeRequireAllStatusChecks", ":dependencyDashboard", ":disableRateLimiting", ":rebaseStalePrs"],
"baseBranches": ["master"],
"major": {
"dependencyDashboardApproval": true
},
"minimumReleaseAge": "7 days"
}

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