Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker MTA #7921

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,20 @@ services:
volumes:
- ./docker/ldap.ldif:/ldifs/ldap.ldif
- ./var/openldap:/bitnami/openldap
mta:
image: 4teamwork/ogmta:latest
build:
context: .
dockerfile: ./docker/mta/Dockerfile
ports:
- '8025:25'
environment:
POSTFIX_MYHOSTNAME: ogmta.onegovgever.ch
POSTFIX_MYORIGIN: dev.onegovgever.ch
POSTFIX_SMTPD_TLS_SECURITY_LEVEL: none
VIRTUAL_DOMAINS_0: name=dev.onegovgever.ch,url=http://ogcore:8080/ogsite
profiles:
- mta
ianus-frontend:
image: ghcr.io/4teamwork/ianus-frontend:2024.2.0
ports:
Expand Down
15 changes: 15 additions & 0 deletions docker/mta/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM alpine:3.19

RUN apk add --no-cache \
postfix \
python3 \
py3-jinja2

COPY docker/mta/conf /etc/postfix
COPY docker/mta/configure-postfix.py docker/mta/mta2plone.py docker/mta/docker-entrypoint.sh /usr/local/bin/

VOLUME ["/var/spool/postfix"]

ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]

EXPOSE 25
31 changes: 31 additions & 0 deletions docker/mta/conf/aliases.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Person who should get root's mail. Don't receive mail as root!
#root: you

# Basic system aliases -- these MUST be present
MAILER-DAEMON: postmaster
postmaster: root

# General redirections for pseudo accounts
bin: root
daemon: root
named: root
nobody: root
uucp: root
www: root
ftp-bugs: root
postfix: root

# Put your local aliases here.

# Well-known aliases
manager: root
dumper: root
operator: root
abuse: postmaster

# trap decode to catch security attacks
decode: root

{% for domain in virtual_domains %}
{{ domain.name }}-inbox: "|/usr/local/bin/mta2plone.py {{ domain.url }}/mail-inbound"
{% endfor %}