Skip to content

Commit 1d9b972

Browse files
sklein94cesmarvin
authored andcommitted
Merge branch 'release/v3.6.4-3'
2 parents c2b01e9 + 3050f87 commit 1d9b972

8 files changed

+123
-6
lines changed

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [v3.6.4-3] - 2022-05-24
10+
### Added
11+
- support for SASL authentication (#13)
12+
913
## [v3.6.4-2] - 2022-04-06
1014
### Change
11-
- Upgrade zlib package to fix CVE-2018-25032; #11
15+
- Upgrade zlib package to fix CVE-2018-25032; (#11)
1216

1317
## [v3.6.4-1] - 2022-02-10
1418
### Fixed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM registry.cloudogu.com/official/base:3.15.3-1
22
LABEL NAME="official/postfix" \
3-
VERSION="3.6.4-2" \
3+
VERSION="3.6.4-3" \
44
55

66
# INSTALL POSTFIX

docs/development/Send_Mails_locally_de.md

+35-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,38 @@ Konkret müssen folgende Schritte ausgeführt werden:
4242
4343
<strg>+<d>
4444
```
45-
* In Web-Oberfläche vom MailHog - ```localhost:8025``` - Mail-Empfang prüfen
45+
* In Web-Oberfläche vom MailHog - ```localhost:8025``` - Mail-Empfang prüfen
46+
47+
48+
## Einrichtung eines Proxy vor MailHog zum testen von Authentifizerungsworkflows
49+
MailHog unterstützt keine Authentifizerung, aus diesem Grund kann mithilfe des Tools [E-MailRelay](http://emailrelay.sourceforge.net/index.html)
50+
ein Proxy vor dem MailHog aufgebaut werden.
51+
52+
Dazu muss E-MailRelay [heruntergeladen](http://emailrelay.sourceforge.net/Download.html),
53+
entpackt und installiert `sudo ./configure && sudo make && sudo make install` werden.
54+
55+
Für die Authentifizierung kann eine Password-Datei angelegt werden, die z.B. so aussehen kann:
56+
57+
secret.auth
58+
```
59+
server plain adminuser adminpw
60+
```
61+
62+
E-MailRelay kann mittels
63+
```
64+
sudo emailrelay -t --as-server --forward-on-disconnect --log --verbose --log-file mailrelay.log --log-time --port 587 --forward-to localhost:1025 --server-auth ./secret.auth
65+
```
66+
als Proxy vor MailHog gestartet werden.
67+
68+
Der Parameter `-t` startet den Proxy in einer Terminal-Sitzung. Das macht es einfacher, den Server neu zu starten.
69+
Der Relay-Host muss auf die mit dem `-port` spezifizierte Adresse zeigen.
70+
```
71+
etcdctl set /config/postfix/relayhost 192.168.56.1:587
72+
```
73+
74+
Anschließend kann das entsprechende Passwort für Postfix konfiguriert werden.
75+
Beim Verschicken von Mails wird dann die SASL-Authentifizierung verwendet:
76+
```
77+
etcdctl set /config/postfix/sasl_username adminuser
78+
etcdctl set /config/postfix/sasl_password adminpw
79+
```

docs/development/Send_Mails_locally_en.md

+35-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,38 @@ Specifically, the following steps need to be performed:
4242
4343
<strg>+<d>
4444
```
45-
* In web interface of MailHog - ```localhost:8025`` - check mail reception
45+
* In web interface of MailHog - ```localhost:8025`` - check mail reception
46+
47+
48+
## Setting up a proxy in front of MailHog to test authentication workflows.
49+
MailHog does not support authentication, therefore using the tool [E-MailRelay](http://emailrelay.sourceforge.net/index.html)
50+
tool to set up a proxy in front of MailHog.
51+
52+
To do this, E-MailRelay must be [downloaded](http://emailrelay.sourceforge.net/Download.html),
53+
unpacked and installed `sudo ./configure && sudo make && sudo make install`.
54+
55+
For the authentication a password file can be created, which can look like this for example
56+
57+
secret.auth
58+
```
59+
server plain adminuser adminpw
60+
```
61+
62+
E-MailRelay can be created using
63+
```
64+
sudo emailrelay -t --as-server --forward-on-disconnect --log --verbose --log-file mailrelay.log --log-time --port 587 --forward-to localhost:1025 --server-auth ./secret.auth
65+
```
66+
can be started as a proxy before MailHog.
67+
68+
The `-t` parameter starts the proxy in a terminal session. This makes it easier to restart the server.
69+
The relay host must point to the address specified with the `-port`.
70+
```
71+
etcdctl set /config/postfix/relayhost 192.168.56.1:587
72+
```
73+
74+
Afterwards the appropriate password for Postfix can be configured.
75+
SASL authentication is then used when sending mails:
76+
```
77+
etcdctl set /config/postfix/sasl_username adminuser
78+
etcdctl set /config/postfix/sasl_password adminpw
79+
```

docs/operations/Configure_Dogu_de.md

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ Postfix-Dogu bietet die folgenden Einstellungen:
3232
etcdctl set /config/postfix/relayhost <Wert für den Relayhost>
3333
```
3434

35+
### SASL Authentifizierung
36+
37+
* Pfad des Konfigurationsschlüssels: `sasl_username` __und__ `sasl_password`
38+
* Sind beide Schlüssel vorhanden wird beim start SASL Authentifizierung konfiguriert
39+
* Optional
40+
3541
### SMTP TLS Sicherheitsstufe
3642

3743
* Pfad des Konfigurationsschlüssels: `smtp_tls_security_level`

docs/operations/Configure_Dogu_en.md

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ the following settings:
3232
etcdctl set /config/postfix/relayhost <value for the relay host>
3333
```
3434

35+
### SASL authentication
36+
37+
* Path of the configuration key: `sasl_username` __and__ `sasl_password`.
38+
* If both keys are present, SASL authentication is configured at startup.
39+
* Optional
40+
3541
### SMTP TLS security level
3642

3743
* Configuration key path: `smtp_tls_security_level`

dogu.json

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Name": "official/postfix",
3-
"Version": "3.6.4-2",
3+
"Version": "3.6.4-3",
44
"DisplayName": "Postfix",
55
"Description": "Postfix - Mail Transfer Agent",
66
"Logo": "https://cloudogu.com/images/dogus/postfix.png",
@@ -16,6 +16,17 @@
1616
"Name": "relayhost",
1717
"Description": "The next-hop destination of non-local mail"
1818
},
19+
{
20+
"Name": "sasl_username",
21+
"Description": "username for sasl authentication",
22+
"Optional": true
23+
},
24+
{
25+
"Name": "sasl_password",
26+
"Description": "password for sasl authentication, if the mail relay server needs an md5 encrypted password pass the encrypted password in here otherwise plain",
27+
"Optional": true,
28+
"Encrypted": false
29+
},
1930
{
2031
"Name": "smtp_tls_security_level",
2132
"Description": "The default SMTP TLS security level for the Postfix SMTP client",

resources/startup.sh

+23-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ function writeIntoFileAndSetIfConfigured {
3333
MAILRELAY=$(doguctl config relayhost)
3434
NAME=$(hostname)
3535
DOMAIN=$(doguctl config --global domain)
36+
POSTFIX_SASL_USER=$(doguctl config --default "NOT_SET" sasl_username)
37+
POSTFIX_SASL_PASSWORD=$(doguctl config --default "NOT_SET" sasl_password)
3638
NET=""
3739
OPTIONS=('smtp_tls_security_level' 'smtp_tls_loglevel'
3840
'smtp_tls_exclude_ciphers' 'smtp_tls_mandatory_ciphers'
@@ -45,15 +47,34 @@ for i in $(netstat -nr | grep -v ^0 | grep -v Dest | grep -v Kern| awk '{print $
4547
NET="${NET} ${i}/${CIDR}"
4648
done
4749

50+
echo "start Postfix configuration ..."
51+
4852
# POSTFIX CONFIG
53+
postconf -e relayhost="${MAILRELAY}"
4954
postconf -e mydomain="localhost.local"
5055
postconf -e myhostname="${NAME}.${DOMAIN}"
5156
postconf -e mydestination="${NAME}.${DOMAIN}, localhost.localdomain, localhost"
5257
postconf -e mynetworks="127.0.0.1 ${NET}"
5358
postconf -e smtputf8_enable=no
54-
postconf -e relayhost="${MAILRELAY}"
5559
postconf -e smtpd_recipient_restrictions="permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination"
5660

61+
62+
# check if SASL authentication should be configured
63+
if [ "${POSTFIX_SASL_USER}" != "NOT_SET" ] && [ "${POSTFIX_SASL_PASSWORD}" != "NOT_SET" ]; then
64+
echo "found SASL pw and user ... configure Postfix to use SASL authentication"
65+
66+
# SASL security in postfix
67+
echo "${MAILRELAY} ${POSTFIX_SASL_USER}:${POSTFIX_SASL_PASSWORD}"> /etc/postfix/sasl_passwd
68+
postmap /etc/postfix/sasl_passwd
69+
70+
postconf -e smtp_sasl_auth_enable="yes" # enable SASL authentication in the Postfix SMTP client. By default, the Postfix SMTP client uses no authentication.
71+
postconf -e smtp_sasl_security_options="noanonymous" # removes the prohibition on plaintext password
72+
postconf -e smtp_sasl_password_maps="lmdb:/etc/postfix/sasl_passwd" #hash:/ is deprecated using lmdb:/ instead
73+
else
74+
echo "configure no SASL authentication"
75+
fi
76+
77+
5778
for option in "${OPTIONS[@]}"; do
5879
setValueIfConfigured "${option}"
5980
done
@@ -66,5 +87,6 @@ writeIntoFileAndSetIfConfigured "smtp_tls_CAfile" "/etc/postfix/CAcert.pem"
6687
# LOGGING CONFIG
6788
./logging.sh
6889

90+
echo "finished configuration, start Postfix ..."
6991
# START POSTFIX
7092
exec /usr/bin/supervisord -c /etc/supervisord.conf

0 commit comments

Comments
 (0)