Skip to content

Commit bc34b8f

Browse files
committed
Adding DKIM instructions and config files
1 parent 0725f95 commit bc34b8f

File tree

6 files changed

+85
-1
lines changed

6 files changed

+85
-1
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Mailserver is intentionally modular. Its main mail-related functions are separat
3737

3838
* [docker-mailserver](https://github.com/technicalguru/docker-mailserver) - Provides help, guidance and examples how to orchestrate the Docker images
3939
* [docker-mailserver-postfix](https://github.com/technicalguru/docker-mailserver-postfix) - Implements the core mailing functionality to send and receive messages.
40+
* [docker-mailserver-opendkim](https://github.com/technicalguru/docker-mailserver-opendkim) - OpenDKIM image (DKIM signing milter component)
4041
* [docker-mailserver-postfixadmin](https://github.com/technicalguru/docker-mailserver-postfixadmin) - Provides administration function for domains and mailboxes
4142
* [docker-mailserver-amavis](https://github.com/technicalguru/docker-mailserver-amavis) - Provides mail scanners to detect viruses and spam
4243
* [docker-mailserver-roundcube](https://github.com/technicalguru/docker-mailserver-roundcube) - A webmail interface that lets you pick-up, read, manage and send e-mails

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ configuration scripts.
2020
# Sub-projects
2121

2222
* [docker-mailserver-postfix](https://github.com/technicalguru/docker-mailserver-postfix) - Postfix/Dovecot image (mailserver component)
23+
* [docker-mailserver-opendkim](https://github.com/technicalguru/docker-mailserver-opendkim) - OpenDKIM image (DKIM signing milter component)
2324
* [docker-mailserver-postfixadmin](https://github.com/technicalguru/docker-mailserver-postfixadmin) - Image for PostfixAdmin (Web UI to manage mailboxes and domain in Postfix)
2425
* [docker-mailserver-amavis](https://github.com/technicalguru/docker-mailserver-amavis) - Amavis, ClamAV and SpamAssassin (provides spam and virus detection)
2526
* [docker-mailserver-roundcube](https://github.com/technicalguru/docker-mailserver-roundcube) - Roundcube Webmailer
@@ -37,6 +38,7 @@ A complete mailserver is the coordinated setup of multiple components. Various d
3738

3839
1. [MySQL >8.0](https://hub.docker.com/\_/mysql) or [MariaDB >10.4](https://hub.docker.com/\_/mariadb) as the database backend
3940
1. [Postfix/Dovecot instance](https://hub.docker.com/repository/docker/technicalguru/mailserver-postfix)
41+
1. [OpenDKIM instance](https://github.com/technicalguru/docker-mailserver-opendkim) (optional)
4042
1. [Amavis/ClamAV/SpamAssassin instance](https://hub.docker.com/repository/docker/technicalguru/mailserver-amavis)
4143
1. [PostfixAdmin instance](https://hub.docker.com/repository/docker/technicalguru/mailserver-postfixadmin)
4244
1. [Roundcube](https://hub.docker.com/repository/docker/technicalguru/mailserver-roundcube)
@@ -62,7 +64,7 @@ Please refer to the special [HELM](examples/helm-charts) section.
6264
* Postfix's main ports can be protected by TLS. Please make use of this as it increases security of your setup. In fact,
6365
the Postfix setup was never tested thoroughly without TLS so it is possible it will not work properly - especially when
6466
passwords are required.
65-
* PostfixAdmin and Roundcube are Web User Interfaces that are exposed as HTTP only. An attacker could easily copy your network
67+
* PostfixAdmin, OpenDKIM and Roundcube provide Web User Interfaces that are exposed as HTTP only. An attacker could easily copy your network
6668
traffic and read your passwords. Make sure you have an appropriate Ingress Controller or Reverse Proxy in front and your traffic
6769
is routed internally on your host only.
6870
* If your internal network traffix in a Kubernetes cluster is crossing node borders, you will need to ensure that it is encrypted.

examples/helm-charts/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ helm install \
8383
Now, everything is complete to actually create your domains and mailboxes. Follow the instructions as given in
8484
[mailserver-postfixadmin](https://github.com/technicalguru/docker-mailserver-postfixadmin) documentation.
8585

86+
## Setup DKIM Signing
87+
88+
The OpenDKIM container does not create any keys (yet). Please follow the key setup instruction of the
89+
[mailserver-opendkim](https://github.com/technicalguru/docker-mailserver-opendkim) documentation.
90+
8691
## Setup Roundcube WebMailer
8792

8893
Roundcube will require a correct database setup. It can create all the schema tables itself but the database

examples/kubernetes/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,27 @@ kubectl get pods -n mailserver
117117

118118
Also check that the new pod has no issues. Use `kubectl logs <pod-name>` or your logging infrastructure.
119119

120+
## Setup OpenDKIM
121+
122+
Check the `services/opendkim.yaml` file. If the service definition fits
123+
then create the service:
124+
125+
```
126+
kubectl apply -f services/opendkim.yaml
127+
```
128+
129+
Second, adust the `deployments/opendkim.yaml` file. It requires you to change the
130+
database and domain data. A complete description can be found
131+
in the [mailserver-opendkim](https://github.com/technicalguru/docker-mailserver-opendkim) documentation.
132+
If the deployment definition is ok for you then apply it:
133+
134+
```
135+
kubectl apply -f deployments/opendkim.yaml
136+
```
137+
138+
You need to execute some further steps in order to setup signing keys. Follow the instructions as given in
139+
[mailserver-opendkim](https://github.com/technicalguru/docker-mailserver-opendkim) documentation.
140+
120141
## Setup Amavis Virus and Spam Checker
121142

122143
Check the `services/amavis.yaml` file. If the service definition fits
@@ -221,6 +242,8 @@ Here are some useful links that help you to test whether your new Mailserver wor
221242
* [**Relay Test**](http://www.aupads.org/test-relay.html) - checks whether your mailserver can be misused as an open mail gateway (relay)
222243
* [**TLS Test**](https://www.checktls.com/) - checks whether your TLS configuration is complete and works as intended
223244
* [**SMTP Test**](https://mxtoolbox.com/diagnostic.aspx) - A general mailserver diagnostic tool
245+
* [**DMARC DKIM Record Checker**](https://www.dmarcanalyzer.com/how-to-validate-a-domainkey-dkim-record/) - checks correctness of your DKIM DNS TXT entry
246+
* [**DKIM Check**](https://www.appmaildev.com/en/dkim) - verifies your DKIM signing feature by giving you a temporary recipient address where you send a test mail
224247

225248
# Congratulations!
226249

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: opendkim
5+
namespace: mailserver
6+
spec:
7+
selector:
8+
matchLabels:
9+
app: mailserver
10+
tier: opendkim
11+
template:
12+
metadata:
13+
labels:
14+
app: mailserver
15+
tier: opendkim
16+
logType: opendkim
17+
spec:
18+
containers:
19+
- name: opendkim
20+
image: technicalguru/mailserver-opendkim
21+
imagePullPolicy: IfNotPresent
22+
env:
23+
- name: DKIM_DOMAIN
24+
value: "<my-first-domain>"
25+
- name: DKIM_PORT
26+
value: "41001"
27+
- name: DKIM_DB_HOST
28+
value: "mariadb"
29+
- name: DKIM_DB_NAME
30+
value: "opendkim"
31+
- name: DKIM_DB_USER
32+
value: "opendkim"
33+
- name: DKIM_DB_PASS
34+
value: "<my-mariadb-opendkim-password>"
35+
- name: DKIM_SETUP_PASS
36+
value: "<my-mariadb-root-password>"
37+
ports:
38+
- containerPort: 41001
39+
name: opendkim
40+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: opendkim
5+
namespace: mailserver
6+
spec:
7+
selector:
8+
app: mailserver
9+
tier: opendkim
10+
ports:
11+
- port: 41001
12+
name: opendkim
13+
targetPort: opendkim

0 commit comments

Comments
 (0)