From b858142c2d01856f7a74a238d04c42a2546bd791 Mon Sep 17 00:00:00 2001 From: Sheogorath <sheogorath@shivering-isles.com> Date: Mon, 27 Nov 2023 05:52:22 +0100 Subject: [PATCH] removal(mok): Strip down postfix image --- charts/mok/README.md | 2 +- charts/mok/templates/secret.yaml | 8 + .../tests/__snapshot__/domains_test.yaml.snap | 8 + .../tests/__snapshot__/dovecot_test.yaml.snap | 10 +- .../tests/__snapshot__/postfix_test.yaml.snap | 10 +- .../tests/__snapshot__/relay_test.yaml.snap | 8 + charts/mok/tests/dovecot_test.yaml | 4 +- charts/mok/tests/postfix_test.yaml | 4 +- charts/mok/values.yaml | 2 +- images/postfix/.release | 2 +- images/postfix/Earthfile | 20 +- images/postfix/config/.gitignore | 1 - images/postfix/config/header_checks | 7 - images/postfix/config/main.cf | 170 ---------------- images/postfix/config/master.cf | 182 ------------------ images/postfix/docker/rsyslog.conf | 13 -- images/postfix/docker/start.sh | 61 ------ images/postfix/docker/supervisord.conf | 24 --- 18 files changed, 54 insertions(+), 482 deletions(-) delete mode 100644 images/postfix/config/.gitignore delete mode 100644 images/postfix/config/header_checks delete mode 100644 images/postfix/config/main.cf delete mode 100644 images/postfix/config/master.cf delete mode 100644 images/postfix/docker/rsyslog.conf delete mode 100644 images/postfix/docker/start.sh delete mode 100644 images/postfix/docker/supervisord.conf diff --git a/charts/mok/README.md b/charts/mok/README.md index 6666e4e8e..49f5d4d02 100644 --- a/charts/mok/README.md +++ b/charts/mok/README.md @@ -56,7 +56,7 @@ Mail on Kubernetes (MoK) is a project to deploy a functional mailserver that run | postfix.hostname | string | `nil` | explicitly set postfix hostname | | postfix.image.pullPolicy | string | `"IfNotPresent"` | | | postfix.image.repository | string | `"quay.io/shivering-isles/postfix"` | postfix container image | -| postfix.image.tag | string | `"0.5.2"` | Overrides the image tag whose default is "latest" | +| postfix.image.tag | string | `"0.6.0"` | Overrides the image tag whose default is "latest" | | postfix.imagePullSecrets | list | `[]` | | | postfix.nodeSelector | object | `{}` | | | postfix.podAnnotations | object | `{}` | | diff --git a/charts/mok/templates/secret.yaml b/charts/mok/templates/secret.yaml index 019525340..b710d88e2 100644 --- a/charts/mok/templates/secret.yaml +++ b/charts/mok/templates/secret.yaml @@ -73,3 +73,11 @@ stringData: {{- end }} tls-policies: | {{- .Values.relay.tlsPolicies | nindent 4 }} + header_checks: | + /^Message-ID:/i IGNORE + /^Mime-Version: 1.0.*/ REPLACE Mime-Version: 1.0 + /^User-Agent:/ IGNORE + /^X-Enigmail:/ IGNORE + /^X-Mailer:/ IGNORE + /^X-Originating-IP:/ IGNORE + /^X-PHP-Originating-Script:/ IGNORE diff --git a/charts/mok/tests/__snapshot__/domains_test.yaml.snap b/charts/mok/tests/__snapshot__/domains_test.yaml.snap index bb1884ac8..3b58bb924 100644 --- a/charts/mok/tests/__snapshot__/domains_test.yaml.snap +++ b/charts/mok/tests/__snapshot__/domains_test.yaml.snap @@ -33,6 +33,14 @@ keeps stays the same: example.com OK example.net OK example.info OK + header_checks: | + /^Message-ID:/i IGNORE + /^Mime-Version: 1.0.*/ REPLACE Mime-Version: 1.0 + /^User-Agent:/ IGNORE + /^X-Enigmail:/ IGNORE + /^X-Mailer:/ IGNORE + /^X-Originating-IP:/ IGNORE + /^X-PHP-Originating-Script:/ IGNORE mailboxes: | john@example.com OK relayhosts: "" diff --git a/charts/mok/tests/__snapshot__/dovecot_test.yaml.snap b/charts/mok/tests/__snapshot__/dovecot_test.yaml.snap index d524567fa..e23581c40 100644 --- a/charts/mok/tests/__snapshot__/dovecot_test.yaml.snap +++ b/charts/mok/tests/__snapshot__/dovecot_test.yaml.snap @@ -79,7 +79,7 @@ should match snapshot: template: metadata: annotations: - checksum/config: 66ea930a9b7e50528ddc0aa54786d07f78c7f56d1daea45b21d9eb94f8e5c4f2 + checksum/config: 8169e727a431edd14dee881a9db5779aa38f2dad6008da57bf280862cfed621c labels: app.kubernetes.io/component: dovecot app.kubernetes.io/instance: RELEASE-NAME @@ -194,6 +194,14 @@ should match snapshot: stringData: aliases: "" domains: "" + header_checks: | + /^Message-ID:/i IGNORE + /^Mime-Version: 1.0.*/ REPLACE Mime-Version: 1.0 + /^User-Agent:/ IGNORE + /^X-Enigmail:/ IGNORE + /^X-Mailer:/ IGNORE + /^X-Originating-IP:/ IGNORE + /^X-PHP-Originating-Script:/ IGNORE mailboxes: "" relayhosts: "" sasl_passwd: "" diff --git a/charts/mok/tests/__snapshot__/postfix_test.yaml.snap b/charts/mok/tests/__snapshot__/postfix_test.yaml.snap index 824edf19b..deaf86867 100644 --- a/charts/mok/tests/__snapshot__/postfix_test.yaml.snap +++ b/charts/mok/tests/__snapshot__/postfix_test.yaml.snap @@ -419,7 +419,7 @@ should match snapshot: metadata: annotations: checksum/config: 7957f3df6d998c42c57e91d61ff347f0fcc9d0f89b3d09b5716f60c019b7528c - checksum/secret: 66ea930a9b7e50528ddc0aa54786d07f78c7f56d1daea45b21d9eb94f8e5c4f2 + checksum/secret: 8169e727a431edd14dee881a9db5779aa38f2dad6008da57bf280862cfed621c labels: app.kubernetes.io/component: postfix app.kubernetes.io/instance: RELEASE-NAME @@ -665,6 +665,14 @@ should match snapshot: stringData: aliases: "" domains: "" + header_checks: | + /^Message-ID:/i IGNORE + /^Mime-Version: 1.0.*/ REPLACE Mime-Version: 1.0 + /^User-Agent:/ IGNORE + /^X-Enigmail:/ IGNORE + /^X-Mailer:/ IGNORE + /^X-Originating-IP:/ IGNORE + /^X-PHP-Originating-Script:/ IGNORE mailboxes: "" relayhosts: "" sasl_passwd: "" diff --git a/charts/mok/tests/__snapshot__/relay_test.yaml.snap b/charts/mok/tests/__snapshot__/relay_test.yaml.snap index aed610e31..339525ec5 100644 --- a/charts/mok/tests/__snapshot__/relay_test.yaml.snap +++ b/charts/mok/tests/__snapshot__/relay_test.yaml.snap @@ -27,6 +27,14 @@ keeps stays the same: stringData: aliases: "" domains: "" + header_checks: | + /^Message-ID:/i IGNORE + /^Mime-Version: 1.0.*/ REPLACE Mime-Version: 1.0 + /^User-Agent:/ IGNORE + /^X-Enigmail:/ IGNORE + /^X-Mailer:/ IGNORE + /^X-Originating-IP:/ IGNORE + /^X-PHP-Originating-Script:/ IGNORE mailboxes: "" relayhosts: | @example.com [mail.example.org]:587 diff --git a/charts/mok/tests/dovecot_test.yaml b/charts/mok/tests/dovecot_test.yaml index 4842c529d..4c3c75825 100644 --- a/charts/mok/tests/dovecot_test.yaml +++ b/charts/mok/tests/dovecot_test.yaml @@ -97,7 +97,7 @@ tests: asserts: - equal: path: spec.template.metadata.annotations["checksum/config"] - value: 66ea930a9b7e50528ddc0aa54786d07f78c7f56d1daea45b21d9eb94f8e5c4f2 + value: 8169e727a431edd14dee881a9db5779aa38f2dad6008da57bf280862cfed621c documentIndex: 2 template: dovecot.yaml - it: has a changing config hash for auto-reload @@ -114,7 +114,7 @@ tests: asserts: - equal: path: spec.template.metadata.annotations["checksum/config"] - value: 9215abccdd6c1f21fd329db0133f6f8e892c50aab3dcde3259ea797e8ad2a959 + value: 6ee744494b7b05190228983d6f941dbf677e8211991a887c2995597942e7eedf documentIndex: 2 template: dovecot.yaml - it: scales with replicaCount diff --git a/charts/mok/tests/postfix_test.yaml b/charts/mok/tests/postfix_test.yaml index 88af4a1e1..a78420284 100644 --- a/charts/mok/tests/postfix_test.yaml +++ b/charts/mok/tests/postfix_test.yaml @@ -84,7 +84,7 @@ tests: asserts: - equal: path: spec.template.metadata.annotations["checksum/secret"] - value: 66ea930a9b7e50528ddc0aa54786d07f78c7f56d1daea45b21d9eb94f8e5c4f2 + value: 8169e727a431edd14dee881a9db5779aa38f2dad6008da57bf280862cfed621c documentIndex: 1 template: postfix.yaml - it: has a changing config hash for auto-reload @@ -101,7 +101,7 @@ tests: asserts: - equal: path: spec.template.metadata.annotations["checksum/secret"] - value: 9215abccdd6c1f21fd329db0133f6f8e892c50aab3dcde3259ea797e8ad2a959 + value: 6ee744494b7b05190228983d6f941dbf677e8211991a887c2995597942e7eedf documentIndex: 1 template: postfix.yaml - it: has a PDB by default if the replica count is > 1 diff --git a/charts/mok/values.yaml b/charts/mok/values.yaml index 0c20e064c..0f9b1b241 100644 --- a/charts/mok/values.yaml +++ b/charts/mok/values.yaml @@ -46,7 +46,7 @@ postfix: repository: quay.io/shivering-isles/postfix pullPolicy: IfNotPresent # -- Overrides the image tag whose default is "latest" - tag: "0.5.2" + tag: "0.6.0" imagePullSecrets: [] diff --git a/images/postfix/.release b/images/postfix/.release index 70915b5ac..5307758bc 100644 --- a/images/postfix/.release +++ b/images/postfix/.release @@ -1 +1 @@ -release=0.5.2 +release=0.6.0 diff --git a/images/postfix/Earthfile b/images/postfix/Earthfile index 56e150739..edd3e97dd 100644 --- a/images/postfix/Earthfile +++ b/images/postfix/Earthfile @@ -17,27 +17,17 @@ container: ARG latest=false # Install pre-requirements - RUN apk add --no-cache ca-certificates rsyslog supervisor + RUN apk add --no-cache ca-certificates RUN update-ca-certificates RUN apk add --no-cache postfix cyrus-sasl cyrus-sasl-login RUN mkdir /var/spool/postfix/etc && echo "smtp 25/tcp mail # Simple Mail Transfer" > /var/spool/postfix/etc/services - COPY config/main.cf /etc/postfix/ - COPY config/master.cf /etc/postfix/ - COPY docker/supervisord.conf /etc/ - COPY docker/rsyslog.conf /etc/ - COPY docker/start.sh /usr/local/libexec/start.sh - RUN chmod +x /usr/local/libexec/start.sh - COPY --chown=postfix:postfix +dhparams/postfix_dhparams.pem /etc/postfix/postfix_dhparams.pem - # 25: SMTP (Server2Server) - # 465: SUBMISSIONS (SSL) - # 587: SMTP (StartTLS) - # 10025: Postscreen for HAProxy - EXPOSE 25 465 587 10025 - - ENTRYPOINT [ "sh" , "/usr/local/libexec/start.sh" ] + COPY --chown=root:root +dhparams/postfix_dhparams.pem /etc/postfix/postfix_dhparams.pem + EXPOSE 25 465 587 + + ENTRYPOINT [ "postfix", "start-fg"] DO ../.utils/+LABEL --image=postfix --version=main IF [ $latest = "true" ] SAVE IMAGE --push ${registry}:latest diff --git a/images/postfix/config/.gitignore b/images/postfix/config/.gitignore deleted file mode 100644 index 3997beadf..000000000 --- a/images/postfix/config/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.db \ No newline at end of file diff --git a/images/postfix/config/header_checks b/images/postfix/config/header_checks deleted file mode 100644 index 520aef1bd..000000000 --- a/images/postfix/config/header_checks +++ /dev/null @@ -1,7 +0,0 @@ -/^Message-ID:/i IGNORE -/^Mime-Version: 1.0.*/ REPLACE Mime-Version: 1.0 -/^User-Agent:/ IGNORE -/^X-Enigmail:/ IGNORE -/^X-Mailer:/ IGNORE -/^X-Originating-IP:/ IGNORE -/^X-PHP-Originating-Script:/ IGNORE diff --git a/images/postfix/config/main.cf b/images/postfix/config/main.cf deleted file mode 100644 index d6605dc05..000000000 --- a/images/postfix/config/main.cf +++ /dev/null @@ -1,170 +0,0 @@ -############### Please enable soft_bounce during maintenance: ################# - -# Fatal 5xx Errors will be downgraded to temporary 4xx Errors. -#soft_bounce = yes - -############################################################################### - -smtpd_banner = $myhostname ESMTP $mail_name -biff = no - -append_dot_mydomain = no - -readme_directory = no - -mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 -mydestination = -mailbox_size_limit = 51200000 -message_size_limit = 51200000 -recipient_delimiter = + -inet_interfaces = all -myorigin = /etc/mailname -inet_protocols = all - -######## -## -## TLS Configuration -## - -smtpd_tls_cert_file=/srv/tls/tls.crt -smtpd_tls_key_file=/srv/tls/tls.key -smtpd_tls_loglevel = 1 - -smtp_tls_cert_file=/srv/tls/tls.crt -smtp_tls_key_file=/srv/tls/tls.key -smtp_tls_loglevel = 1 - -smtpd_tls_security_level = may -smtp_tls_security_level = may - -# generated 2023-02-26, Mozilla Guideline v5.6, Postfix 3.4.8, OpenSSL 1.1.1k, intermediate configuration -# https://ssl-config.mozilla.org/#server=postfix&version=3.4.8&config=intermediate&openssl=1.1.1k&guideline=5.6 -smtpd_tls_auth_only = yes -smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 -smtp_tls_mandatory_protocols = !SSLv2, !SSLv3 -lmtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 -smtpd_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 -smtp_tls_protocols = !SSLv2, !SSLv3 -lmtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1 -smtpd_tls_mandatory_ciphers = medium - -tls_medium_cipherlist = ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384 -tls_preempt_cipherlist = no -tls_ssl_options = NO_COMPRESSION - -smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt -smtpd_tls_dh1024_param_file = /etc/postfix/postfix_dhparams.pem - -smtp_tls_policy_maps = lmdb:/srv/tmp/tls-policies - -######## -## -## SASL Configuration Configuration -## - -smtpd_sasl_type = dovecot -smtpd_sasl_path = inet:dovecot-internal:12345 -smtpd_sasl_auth_enable = yes -broken_sasl_auth_clients = yes -smtpd_sasl_security_options = noanonymous, noplaintext -smtpd_sasl_tls_security_options = noanonymous -smtpd_tls_auth_only = yes - -lmtp_host_lookup = dns, native -virtual_transport = lmtp:inet:dovecot-internal:24 - -######## -## -## Postscreen Configuration -## - -postscreen_upstream_proxy_protocol = haproxy -postscreen_upstream_proxy_timeout = 5s -postscreen_access_list = permit_mynetworks -postscreen_blacklist_action = drop -postscreen_greet_action = ignore -# Disable zombie detection -postscreen_greet_banner = -postscreen_dnsbl_action = enforce -postscreen_dnsbl_threshold = 3 -postscreen_dnsbl_allowlist_threshold = -1 -postscreen_dnsbl_sites = - zen.spamhaus.org=127.0.1.[2..254]*3, - ix.dnsbl.manitu.net*3, - bl.spamcop.net, - b.barracudacentral.org, - safe.dnsbl.sorbs.net, - swl.spamhaus.org*-10, - -######## -## -## SMTPD Restrictions Configuration -## - -smtpd_recipient_restrictions = -# check_recipient_access btree:/srv/config/access_recipient, -# check_recipient_access pgsql:/srv/tmp/recipient-access.cf -# check_client_access cidr:/srv/config/access_client, -# check_helo_access btree:/srv/config/access_helo, -# check_sender_access btree:/srv/config/access_sender, - reject_non_fqdn_sender, - reject_non_fqdn_recipient, - reject_unknown_sender_domain, - reject_unknown_recipient_domain, - reject_invalid_hostname, - warn_if_reject reject_unauth_pipelining, - permit_mynetworks, - reject_unauth_destination, - reject_known_sender_login_mismatch, - reject_unverified_recipient, - permit - -smtpd_sender_restrictions = - permit_mynetworks, - reject_non_fqdn_sender, - reject_authenticated_sender_login_mismatch, - permit_sasl_authenticated - -#smtpd_restriction_classes = local_only -#local_only = -# check_recipient_access btree:/srv/config/local_domains, -# check_sender_access regexp:/srv/config/local_only_reject.regexp - -######## -## -## Virtual Maps Configuration -## - -virtual_uid_maps = static:5000 -virtual_gid_maps = static:5000 - -virtual_alias_maps = lmdb:/srv/tmp/aliases -virtual_mailbox_maps = lmdb:/srv/tmp/mailboxes -virtual_mailbox_domains = lmdb:/srv/tmp/domains -local_recipient_maps = $virtual_mailbox_maps - -## Relay config - -sender_dependent_relayhost_maps = lmdb:/srv/tmp/relayhosts - -## SMTP sasl - -smtp_sasl_auth_enable = yes -smtp_sasl_security_options = noanonymous -smtp_sasl_tls_security_options = noanonymous -smtp_sasl_password_maps = lmdb:/srv/tmp/sasl_passwd -smtp_tls_note_starttls_offer = yes - -######## -## -## Miscellaneous -## - -default_database_type = btree - -#mime_header_checks = pcre:/srv/config/mime_header_checks.pcre - -maximal_queue_lifetime = 1d -bounce_queue_lifetime = 1d -unverified_recipient_reject_code = 577 -compatibility_level = 2 diff --git a/images/postfix/config/master.cf b/images/postfix/config/master.cf deleted file mode 100644 index 1b1485339..000000000 --- a/images/postfix/config/master.cf +++ /dev/null @@ -1,182 +0,0 @@ -# ========================================================================== -# service type private unpriv chroot wakeup maxproc command + args -# (yes) (yes) (yes) (never) (100) -# ========================================================================== -10025 inet n - - - 1 postscreen - -o postscreen_upstream_proxy_protocol=haproxy - -o syslog_name=postfix/10025 -smtpd pass - - - - - smtpd - -o smtpd_tls_received_header=yes - -o content_filter= -dnsblog unix - - - - 0 dnsblog -tlsproxy unix - - - - 0 tlsproxy -#smtps inet n - - - - smtpd -# -o syslog_name=postfix/smtps -# -o smtpd_tls_wrappermode=yes -# -o smtpd_sasl_auth_enable=yes -# -o smtpd_reject_unlisted_recipient=no -# -o smtpd_client_restrictions=$mua_client_restrictions -# -o smtpd_helo_restrictions=$mua_helo_restrictions -# -o smtpd_sender_restrictions=$mua_sender_restrictions -# -o smtpd_recipient_restrictions= -# -o smtpd_relay_restrictions=permit_sasl_authenticated,reject -# -o milter_macro_daemon_name=ORIGINATING -#628 inet n - - - - qmqpd -smtp inet n - y - - smtpd - -o smtpd_tls_received_header=yes - -o content_filter= -pickup unix n - y 60 1 pickup - -o receive_override_options=no_header_body_checks -cleanup unix n - y - 0 cleanup -qmgr unix n - n 300 1 qmgr -#qmgr unix n - n 300 1 oqmgr -tlsmgr unix - - y 1000? 1 tlsmgr -rewrite unix - - y - - trivial-rewrite -bounce unix - - y - 0 bounce -defer unix - - y - 0 bounce -trace unix - - y - 0 bounce -verify unix - - y - 1 verify -flush unix n - y 1000? 0 flush -proxymap unix - - n - - proxymap -proxywrite unix - - n - 1 proxymap -smtp unix - - y - - smtp -# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 -relay unix - - y - - smtp -showq unix n - y - - showq -error unix - - y - - error -retry unix - - y - - error -discard unix - - y - - discard -local unix - n n - - local -virtual unix - n n - - virtual -lmtp unix - - y - - lmtp -anvil unix - - y - 1 anvil -# -# ==================================================================== -# Interfaces to non-Postfix software. Be sure to examine the manual -# pages of the non-Postfix software to find out what options it wants. -# -# Many of the following services use the Postfix pipe(8) delivery -# agent. See the pipe(8) man page for information about ${recipient} -# and other message envelope options. -# ==================================================================== -# -# maildrop. See the Postfix MAILDROP_README file for details. -# Also specify in main.cf: maildrop_destination_recipient_limit=1 -# -scache unix - - y - 1 scache -maildrop unix - n n - - pipe - flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} -# -# ==================================================================== -# -# Recent Cyrus versions can use the existing "lmtp" master.cf entry. -# -# Specify in cyrus.conf: -# lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4 -# -# Specify in main.cf one or more of the following: -# mailbox_transport = lmtp:inet:localhost -# virtual_transport = lmtp:inet:localhost -# -# ==================================================================== -# -# Cyrus 2.1.5 (Amos Gouaux) -# Also specify in main.cf: cyrus_destination_recipient_limit=1 -# -#cyrus unix - n n - - pipe -# user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user} -# -# ==================================================================== -# Old example of delivery via Cyrus. -# -#old-cyrus unix - n n - - pipe -# flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user} -# -# ==================================================================== -# -# See the Postfix UUCP_README file for configuration details. -# -uucp unix - n n - - pipe - flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) -# -# Other external delivery methods. -# -ifmail unix - n n - - pipe - flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) -bsmtp unix - n n - - pipe - flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient -scalemail-backend unix - n n - 2 pipe - flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} -mailman unix - n n - - pipe - flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py - ${nexthop} ${user} - -submission inet n - y - - smtpd - -o syslog_name=postfix/submission - -o smtpd_tls_security_level=encrypt - -o tls_preempt_cipherlist=yes - -o smtpd_sasl_auth_enable=yes - -o smtpd_tls_auth_only=yes - -o smtpd_reject_unlisted_recipient=no - -o smtpd_recipient_restrictions= - -o smtpd_relay_restrictions=permit_sasl_authenticated,reject - -o smtpd_sender_login_maps=lmdb:/srv/tmp/sender-login-maps - -o sender_dependent_relayhost_maps=lmdb:/srv/tmp/relayhosts - -o cleanup_service_name=headers-cleanup - -submissions inet n - y - - smtpd - -o syslog_name=postfix/submissions - -o smtpd_tls_wrappermode=yes - -o smtpd_tls_security_level=encrypt - -o tls_preempt_cipherlist=yes - -o smtpd_sasl_auth_enable=yes - -o smtpd_tls_auth_only=yes - -o smtpd_reject_unlisted_recipient=no - -o smtpd_recipient_restrictions= - -o smtpd_relay_restrictions=permit_sasl_authenticated,reject - -o smtpd_sender_login_maps=lmdb:/srv/tmp/sender-login-maps - -o sender_dependent_relayhost_maps=lmdb:/srv/tmp/relayhosts - -o cleanup_service_name=headers-cleanup - -dovecot unix - n n - - pipe flags=DRhu - user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient} - -#smtp-amavis unix - - y - 2 smtp -# -o smtp_data_done_timeout=1800 -# -o smtp_send_xforward_command=yes -# -o disable_mime_output_conversion=yes -# -o smtp_generic_maps= - -#127.0.0.1:10025 inet n - y - - smtpd -# -o content_filter= -# -o smtpd_proxy_filter= -# -o smtpd_authorized_xforward_hosts=127.0.0.0/8 -# -o smtpd_client_restrictions= -# -o smtpd_helo_restrictions= -# -o smtpd_sender_restrictions= -# -o smtpd_recipient_restrictions=permit_mynetworks,reject -# -o smtpd_data_restrictions= -# -o mynetworks=127.0.0.0/8 -# -o receive_override_options=no_unknown_recipient_checks -## -o header_checks=pcre:/etc/postfix/submission_header_checks.pcre - - -#127.0.0.1:10027 inet n - y - - smtpd -# -o content_filter=smtp-amavis:[127.0.0.1]:10028 -# -o smtpd_proxy_filter= -# -o smtpd_authorized_xforward_hosts=127.0.0.0/8 -# -o smtpd_client_restrictions= -# -o smtpd_helo_restrictions= -# -o smtpd_sender_restrictions= -# -o smtpd_recipient_restrictions=permit_mynetworks,reject -# -o smtpd_data_restrictions= -# -o mynetworks=127.0.0.0/8 -# -o receive_override_options=no_unknown_recipient_checks -# -o cleanup_service_name=subcleanup - -subcleanup unix n - y - 0 cleanup -# -o header_checks=pcre:/srv/config/submission_header_checks.pcre - -headers-cleanup unix n - - - 0 cleanup - -o syslog_name=postfix/headers-cleanup - -o header_checks=regexp:/etc/postfix/header_checks diff --git a/images/postfix/docker/rsyslog.conf b/images/postfix/docker/rsyslog.conf deleted file mode 100644 index b11424083..000000000 --- a/images/postfix/docker/rsyslog.conf +++ /dev/null @@ -1,13 +0,0 @@ -$ModLoad immark.so # provides --MARK-- message capability -$ModLoad imuxsock.so # provides support for local system logging (e.g. via logger command) - -# default permissions for all log files. -$FileOwner root -$FileGroup adm -$FileCreateMode 0640 -$DirCreateMode 0755 -$Umask 0022 - -#*.info /dev/stdout -#mail.* /dev/stdout -mail.info /dev/stdout \ No newline at end of file diff --git a/images/postfix/docker/start.sh b/images/postfix/docker/start.sh deleted file mode 100644 index cec07c39b..000000000 --- a/images/postfix/docker/start.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -SHOULD_EXIT_EARLY=false - -function var_not_set { - echo "Environment variable $1 is not set" - SHOULD_EXIT_EARLY=true -} - -######## -## -## Variables -## - -if [ -z $HOSTNAME ]; then - HOSTNAME="$(hostname -f)" -fi - -######## -## -## Test if we should return early -## - -if [ $SHOULD_EXIT_EARLY = true ]; then - exit 1 -fi - - -######## -## -## Preparation -## - -######## -## -## Postfix Configuration -## - -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 -find /srv/tmp -type f -exec postmap lmdb://{} \; - -######## -## -## Kube DNS Support -## - -mkdir -p /var/spool/postfix/etc/ -cp /etc/resolv.conf /var/spool/postfix/etc/ - -######## -## -## Start -## - -# exec postfix start -exec supervisord -c /etc/supervisord.conf diff --git a/images/postfix/docker/supervisord.conf b/images/postfix/docker/supervisord.conf deleted file mode 100644 index bbc1cc653..000000000 --- a/images/postfix/docker/supervisord.conf +++ /dev/null @@ -1,24 +0,0 @@ -[supervisord] -user = root -nodaemon = true -logfile = /dev/null -logfile_maxbytes= 0 - -[program:rsyslog] -command = rsyslogd -n -autostart = true -autorestart = true -startsecs = 2 -stopwaitsecs = 2 -stdout_logfile = /dev/stdout -stderr_logfile = /dev/stderr -stdout_logfile_maxbytes = 0 -stderr_logfile_maxbytes = 0 - -[program:postfix] -process_name = master -autostart = true -autorestart = false -directory = /etc/postfix -command = /usr/sbin/postfix -c /etc/postfix start -startsecs = 0 \ No newline at end of file -- GitLab