Skip to content

Commit 70cf2cd

Browse files
committed
fix(docker-mailserver): stop exposing plaintext IMAP by default
Port 143 (and its proxyProtocol variant 10143) was included in the Service unconditionally whenever IMAP is enabled, alongside 993 - meaning plaintext, unencrypted IMAP was reachable from outside the cluster on any deployment using this chart with a LoadBalancer/NodePort service. Confirmed reachable in production. Adds service.exposePlaintextImap (default false) - only TLS IMAPS (993) is exposed unless explicitly opted into. Signed-off-by: Rishi <rishi@obmondo.com>
1 parent a5b0f4a commit 70cf2cd

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

argocd-helm-charts/docker-mailserver/charts/docker-mailserver/templates/service.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,27 +73,31 @@ spec:
7373
{{- end }}
7474

7575
{{- if and (.Values.deployment.env.ENABLE_IMAP) (not .Values.deployment.env.SMTP_ONLY) }}
76+
{{- if .Values.service.exposePlaintextImap }}
7677
- name: imap
7778
targetPort: imap
7879
port: 143
79-
{{- if eq .Values.service.type "NodePort" }}
80+
{{- if eq .Values.service.type "NodePort" }}
8081
nodePort: {{ default "30143" .Values.service.nodePort.imap }}
81-
{{- end }}
82+
{{- end }}
83+
{{- end }}
8284
- name: imaps
8385
targetPort: imaps
8486
port: 993
85-
{{- if eq .Values.service.type "NodePort" }}
87+
{{- if eq .Values.service.type "NodePort" }}
8688
nodePort: {{ default "30993" .Values.service.nodePort.imaps }}
87-
{{- end }}
89+
{{- end }}
8890
{{- if .Values.proxyProtocol.enabled }}
91+
{{- if .Values.service.exposePlaintextImap }}
8992
- name: imap-proxy
9093
targetPort: imap-proxy
9194
port: 10143
95+
{{- end }}
9296
- name: imaps-proxy
9397
targetPort: imaps-proxy
9498
port: 10993
95-
{{- end }}
96-
{{- end }}
99+
{{- end }}
100+
{{- end }}
97101

98102
{{- if and (.Values.deployment.env.ENABLE_POP3) (not .Values.deployment.env.SMTP_ONLY) }}
99103
- name: pop3

argocd-helm-charts/docker-mailserver/charts/docker-mailserver/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@ service:
323323
# clusterIp:
324324
annotations: {}
325325
labels: {}
326+
## Whether to expose plaintext IMAP (port 143, and 10143 with proxyProtocol) on the Service.
327+
## Defaults to false: only TLS IMAPS (993) is exposed. STARTTLS-capable plaintext IMAP has
328+
## no business being reachable from outside the cluster - set to true only if you have a
329+
## specific client that cannot do IMAPS and you accept the risk.
330+
exposePlaintextImap: false
326331

327332
# Note this is a dictionary and not a list so individual keys can be overridden by --set or --value helm parameters
328333
persistent_volume_claims:

0 commit comments

Comments
 (0)