Compare commits

...

2 Commits

Author SHA1 Message Date
267a4954ab enable starttls and generate self-signed certificate
All checks were successful
ci/woodpecker/tag/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
2024-12-21 14:22:39 +01:00
81f57a53ce fixes
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2024-12-21 13:43:41 +01:00
7 changed files with 16 additions and 9 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
.*~
ENV
ENV.test
tmp/

View File

@ -12,7 +12,7 @@ ENV SMARTHOST_PASS=""
# ip addresses or networks to allow for relaying, separate multiple ones by semicolon
ENV RELAYNETS="127.0.0.1/32"
RUN apk add --no-cache exim m4
RUN apk add --no-cache exim m4 openssl
COPY exim.conf.m4 /etc/exim
COPY start.sh /etc/exim

View File

@ -8,7 +8,7 @@ kubectl create secret generic smtp-secrets \
--from-literal=SMARTHOST="smtprelaypool.ispgateway.de" \
--from-literal=SMARTHOST_USER="pseudosmarthostuser@hottis.de" \
--from-literal=SMARTHOST_PASS="$SMARTHOST_PASSWORD" \
--from-literal=RELAY_NETWORKS=":10.0.0.0/8" | \
--from-literal=RELAYNETS=":10.0.0.0/8" | \
kubectl apply -n system -f -
kubectl apply -n system -f deploy.yml

View File

@ -18,7 +18,7 @@ spec:
spec:
containers:
- name: smtp
image: quay.io/wollud1969/exim-docker:0.2.1
image: quay.io/wollud1969/exim-docker:0.2.2
envFrom:
- secretRef:
name: smtp-secrets

View File

@ -22,7 +22,8 @@ primary_hostname = HOSTNAME
acl_smtp_rcpt = acl_check_rcpt
tls_advertise_hosts =
tls_certificate = /etc/exim/tls.crt
tls_privatekey = /etc/exim/tls.key
begin routers
smarthost_route:

View File

@ -8,9 +8,10 @@ option to send mail from other containers without the need to configure the smar
Four environment variables are used to configure the container:
* `SMARTHOST`: The is the name of the smarthost. exim within this container will send all mail to this smarthost for further delivery. Make sure the smarthost accepts mail from this container without authentication.
* `LOCALMAILNAME`: The domain name which shall be used as the domain part of the sender address in every outgoing mail.
* `SMARTHOST_USER`: Login for smarthost. If no authentication is required, skip it.
* `SMARTHOST_PASS`: Password for smarthost.
* `LOCALMAILNAME`: The domain name which shall be used as the domain part of the sender address in every outgoing mail. If not required, skip it.
* `RELAYNETS`: Networks exim in this container accepts for relaying. Separate multiple networks by semicolon.
* `ROOT`: Addresses to forward root mail to. Separate multiple addresses by space.
## Deployment
@ -23,7 +24,7 @@ Typically, don't expose the smtp port of this container to the default network o
```
#!/bin/bash
IMAGE=quay.io/wollud1969/exim-docker:0.0.9
IMAGE=quay.io/wollud1969/exim-docker:0.2.2
MAILER_NETWORK=mailer-network
docker network create $MAILER_NETWORK || echo "mailer-network already exists"
@ -37,7 +38,6 @@ docker run \
-e SMARTHOST=smarthost.example.com \
-e LOCALMAILNAME=krohne.com \
-e RELAYNETS=$RELAYNETS \
-e ROOT=root@example.com \
--network $MAILER_NETWORK \
--name mailer \
--restart always \

View File

@ -1,4 +1,9 @@
#!/bin/sh
m4 exim.conf.m4 > exim.conf && exim -bd -q15m -v
openssl genpkey -algorithm RSA -out tls.key && \
openssl req -new -key tls.key -out tls.csr -subj "/C=DE/CN=$HOSTNAME" && \
openssl x509 -req -in tls.csr -signkey tls.key -out tls.crt -days 3650 && \
chown exim tls.key tls.crt && \
m4 exim.conf.m4 > exim.conf && \
exim -bd -q15m -v