Skip to content

Commit 3e8757e

Browse files
authored
Merge pull request #316 from dgc1980/master
added option for SSL encryption for postfix relay
2 parents d98e785 + cbfc1e0 commit 3e8757e

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ RUN apk --no-cache add \
5555
shadow \
5656
tar \
5757
tzdata \
58+
cyrus-sasl \
59+
cyrus-sasl-login \
5860
&& cp /etc/postfix/master.cf /etc/postfix/master.cf.orig \
5961
&& cp /etc/postfix/main.cf /etc/postfix/main.cf.orig \
6062
&& apk --no-cache add -t build-dependencies \

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ linux/arm64
165165
* `POSTFIX_RELAYHOST_AUTH_ENABLE`: Enable client-side authentication for relayhost (default `false`)
166166
* `POSTFIX_RELAYHOST_USERNAME`: Postfix SMTP Client username for relayhost authentication
167167
* `POSTFIX_RELAYHOST_PASSWORD`: Postfix SMTP Client password for relayhost authentication
168-
* `POSTFIX_SPAMHAUS_DQS_KEY`: Personal key for [Spamhaus DQS](#spamhaus-dqs-configuration)
168+
* `POSTFIX_RELAYHOST_SSL_ENCRYPTION`: enable SSL encrpytion over SMTP where TLS is not available. (default `false`)
169+
* `POSTFIX_SPAMAUS_DQS_KEY`: Personal key for [Spamhaus DQS](#spamhaus-dqs-configuration)
169170

170171
> [!NOTE]
171172
> `POSTFIX_RELAYHOST_USERNAME_FILE` and `POSTFIX_RELAYHOST_PASSWORD_FILE` can be

rootfs/etc/cont-init.d/00-env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ POSTFIX_MESSAGE_SIZE_LIMIT=${POSTFIX_MESSAGE_SIZE_LIMIT:-26214400}
8585
POSTFIX_SMTPD_TLS=${POSTFIX_SMTPD_TLS:-false}
8686
POSTFIX_SMTP_TLS=${POSTFIX_SMTP_TLS:-false}
8787
POSTFIX_RELAYHOST_AUTH_ENABLE=${POSTFIX_RELAYHOST_AUTH_ENABLE:-false}
88+
POSTFIX_RELAYHOST_SSL_ENCRYPTION=${POSTFIX_RELAYHOST_SSL_ENCRYPTION:-false}
8889
#POSTFIX_SPAMHAUS_DQS_KEY=${POSTFIX_SPAMHAUS_DQS_KEY:-null}
8990
#POSTFIX_RELAYHOST_USERNAME=${POSTFIX_RELAYHOST_USERNAME:-null}
9091
#POSTFIX_RELAYHOST_PASSWORD=${POSTFIX_RELAYHOST_PASSWORD:-null}

rootfs/etc/cont-init.d/15-config-postfix.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,18 @@ smtp_tls_mandatory_ciphers = high
165165
smtp_tls_ciphers = high
166166
smtp_tls_mandatory_exclude_ciphers = MD5, DES, ADH, RC4, PSD, SRP, 3DES, eNULL, aNULL
167167
smtp_tls_exclude_ciphers = MD5, DES, ADH, RC4, PSD, SRP, 3DES, eNULL, aNULL
168+
EOL
169+
170+
if [ "$POSTFIX_RELAYHOST_SSL_ENCRYPTION" = "true" ]; then
171+
cat >>/etc/postfix/main.cf <<EOL
172+
smtp_tls_wrappermode = yes
173+
smtp_tls_security_level = encrypt
174+
EOL
175+
else
176+
cat >>/etc/postfix/main.cf <<EOL
168177
smtp_tls_security_level = may
169178
EOL
179+
fi
170180
fi
171181

172182
if [ "$POSTFIX_RELAYHOST_AUTH_ENABLE" = "true" ]; then

0 commit comments

Comments
 (0)