Skip to content
Snippets Groups Projects
Verified Commit 7dca5ec2 authored by Sheogorath's avatar Sheogorath :european_castle:
Browse files

fix(postfix): Add ability to overwrite service name

Currently the service name for dovecot was hardcoded in the image, which
makes it incompatible with MoK. As a result this patch updates the image
to allow a dynamic overwrite on startup as well as updating MoK to
account for the new functionality.
parent 7d0bf458
No related branches found
No related tags found
1 merge request!158fix(postfix): Add ability to overwrite service name
...@@ -3,7 +3,7 @@ name: mok ...@@ -3,7 +3,7 @@ name: mok
description: | description: |
Mail on Kubernetes (MoK) is a project to deploy a functional mailserver that runs without a database server on Kubernetes, taking advantage of configmaps and secret. Mail on Kubernetes (MoK) is a project to deploy a functional mailserver that runs without a database server on Kubernetes, taking advantage of configmaps and secret.
type: application type: application
version: 0.1.2 version: 0.1.3
sources: sources:
- https://de.postfix.org/ftpmirror/index.html - https://de.postfix.org/ftpmirror/index.html
- https://github.com/dovecot/core - https://github.com/dovecot/core
......
# mok # mok
![Version: 0.1.2](https://img.shields.io/badge/Version-0.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.1.3](https://img.shields.io/badge/Version-0.1.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
Mail on Kubernetes (MoK) is a project to deploy a functional mailserver that runs without a database server on Kubernetes, taking advantage of configmaps and secret. Mail on Kubernetes (MoK) is a project to deploy a functional mailserver that runs without a database server on Kubernetes, taking advantage of configmaps and secret.
...@@ -55,7 +55,7 @@ Mail on Kubernetes (MoK) is a project to deploy a functional mailserver that run ...@@ -55,7 +55,7 @@ Mail on Kubernetes (MoK) is a project to deploy a functional mailserver that run
| postfix.affinity | object | `{}` | | | postfix.affinity | object | `{}` | |
| postfix.image.pullPolicy | string | `"IfNotPresent"` | | | postfix.image.pullPolicy | string | `"IfNotPresent"` | |
| postfix.image.repository | string | `"quay.io/shivering-isles/postfix"` | postfix container image | | postfix.image.repository | string | `"quay.io/shivering-isles/postfix"` | postfix container image |
| postfix.image.tag | string | `"0.1.0"` | Overrides the image tag whose default is "latest" | | postfix.image.tag | string | `"0.1.1"` | Overrides the image tag whose default is "latest" |
| postfix.imagePullSecrets | list | `[]` | | | postfix.imagePullSecrets | list | `[]` | |
| postfix.nodeSelector | object | `{}` | | | postfix.nodeSelector | object | `{}` | |
| postfix.podAnnotations | object | `{}` | | | postfix.podAnnotations | object | `{}` | |
......
...@@ -66,6 +66,9 @@ spec: ...@@ -66,6 +66,9 @@ spec:
{{- toYaml .Values.postfix.podSecurityContext | nindent 8 }} {{- toYaml .Values.postfix.podSecurityContext | nindent 8 }}
containers: containers:
- name: postfix - name: postfix
env:
- name: DOVECOT_SERVICE_NAME
value: {{ include "mok.fullname" . }}-dovecot-internal.{{ .Release.Namespace }}.svc.cluster.local
image: {{ .Values.postfix.image.repository }}:{{.Values.postfix.image.tag | default "latest" }} image: {{ .Values.postfix.image.repository }}:{{.Values.postfix.image.tag | default "latest" }}
imagePullPolicy: {{ .Values.postfix.image.pullPolicy }} imagePullPolicy: {{ .Values.postfix.image.pullPolicy }}
lifecycle: lifecycle:
......
...@@ -44,7 +44,7 @@ postfix: ...@@ -44,7 +44,7 @@ postfix:
repository: quay.io/shivering-isles/postfix repository: quay.io/shivering-isles/postfix
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
# -- Overrides the image tag whose default is "latest" # -- Overrides the image tag whose default is "latest"
tag: "0.1.0" tag: "0.1.1"
imagePullSecrets: [] imagePullSecrets: []
......
release=0.1.0 release=0.1.1
...@@ -111,10 +111,6 @@ submission inet n - y - - smtpd ...@@ -111,10 +111,6 @@ submission inet n - y - - smtpd
-o syslog_name=postfix/submission -o syslog_name=postfix/submission
-o smtpd_tls_security_level=encrypt -o smtpd_tls_security_level=encrypt
-o tls_preempt_cipherlist=yes -o tls_preempt_cipherlist=yes
-o smtpd_sasl_type=dovecot
-o smtpd_sasl_path=inet:dovecot-internal:12345
-o smtpd_sasl_security_options=noanonymous
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject -o smtpd_client_restrictions=permit_sasl_authenticated,reject
-o smtpd_sender_login_maps=lmdb:/srv/tmp/sender-login-maps -o smtpd_sender_login_maps=lmdb:/srv/tmp/sender-login-maps
-o cleanup_service_name=headers-cleanup -o cleanup_service_name=headers-cleanup
...@@ -124,10 +120,6 @@ submissions inet n - y - - smtpd ...@@ -124,10 +120,6 @@ submissions inet n - y - - smtpd
-o smtpd_tls_wrappermode=yes -o smtpd_tls_wrappermode=yes
-o smtpd_tls_security_level=encrypt -o smtpd_tls_security_level=encrypt
-o tls_preempt_cipherlist=yes -o tls_preempt_cipherlist=yes
-o smtpd_sasl_type=dovecot
-o smtpd_sasl_path=inet:dovecot-internal:12345
-o smtpd_sasl_security_options=noanonymous
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject -o smtpd_client_restrictions=permit_sasl_authenticated,reject
-o smtpd_sender_login_maps=lmdb:/srv/tmp/sender-login-maps -o smtpd_sender_login_maps=lmdb:/srv/tmp/sender-login-maps
-o cleanup_service_name=headers-cleanup -o cleanup_service_name=headers-cleanup
......
...@@ -37,6 +37,10 @@ fi ...@@ -37,6 +37,10 @@ fi
## ##
postconf -e "myhostname = $HOSTNAME" postconf -e "myhostname = $HOSTNAME"
if [ -n DOVECOT_SERVICE_NAME ]; then
postconf -e "smtpd_sasl_path = inet:${DOVECOT_SERVICE_NAME}:12345"
postconf -e "virtual_transport = lmtp:inet:${DOVECOT_SERVICE_NAME}:24"
fi
cp /srv/virtual/* /srv/tmp cp /srv/virtual/* /srv/tmp
find /srv/tmp -type f -exec postmap lmdb://{} \; find /srv/tmp -type f -exec postmap lmdb://{} \;
...@@ -45,6 +49,7 @@ find /srv/tmp -type f -exec postmap lmdb://{} \; ...@@ -45,6 +49,7 @@ find /srv/tmp -type f -exec postmap lmdb://{} \;
## Kube DNS Support ## Kube DNS Support
## ##
mkdir -p /var/spool/postfix/etc/
cp /etc/resolv.conf /var/spool/postfix/etc/ cp /etc/resolv.conf /var/spool/postfix/etc/
######## ########
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment