From 63197ab052bb0468a8e3f489c34082d4b7103a3b Mon Sep 17 00:00:00 2001 From: Edward Fitz Abucay Date: Fri, 20 Oct 2023 11:37:23 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=95=20Fix=20problems=20on=20DKIM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Edward Fitz Abucay --- ...build-push-release.yml => build-push-release-images.yml} | 6 +++--- data/s6-overlay/s6-rc.d/init-mailer-config/run | 6 +++--- data/templates/opendkim/key.table.tmpl | 2 +- data/templates/opendkim/opendkim.conf.tmpl | 1 - data/templates/opendkim/signing.table.tmpl | 1 + data/templates/opendkim/trusted.hosts.tmpl | 1 + data/templates/postfix/generic.tmpl | 2 ++ data/templates/postfix/main.cf.tmpl | 2 +- 8 files changed, 12 insertions(+), 9 deletions(-) rename .github/workflows/{build-push-release.yml => build-push-release-images.yml} (98%) diff --git a/.github/workflows/build-push-release.yml b/.github/workflows/build-push-release-images.yml similarity index 98% rename from .github/workflows/build-push-release.yml rename to .github/workflows/build-push-release-images.yml index 5b8781e..d703b9e 100644 --- a/.github/workflows/build-push-release.yml +++ b/.github/workflows/build-push-release-images.yml @@ -1,9 +1,9 @@ -name: build-push-release +name: build-push-release-images on: push: - tags: + tags: - 'release-*.*.*' - + env: # Use docker.io for Docker Hub if empty REGISTRY: ghcr.io diff --git a/data/s6-overlay/s6-rc.d/init-mailer-config/run b/data/s6-overlay/s6-rc.d/init-mailer-config/run index 2d5d425..7d86464 100755 --- a/data/s6-overlay/s6-rc.d/init-mailer-config/run +++ b/data/s6-overlay/s6-rc.d/init-mailer-config/run @@ -8,10 +8,10 @@ mkdir -p /var/spool/postfix/pid \ && chown -R 0:0 /var/spool/postfix/pid mkdir -p /var/spool/postfix/opendkim \ - && chown -R opendkim:postfix /var/spool/postfix/opendkim + && chown -R 0:0 /var/spool/postfix/opendkim mkdir /run/opendkim \ - && chown -R opendkim:opendkim /run/opendkim + && chown -R 0:0 /run/opendkim TEMPLATES_DIR=/etc/templates dockerize \ @@ -54,7 +54,7 @@ if [[ ! -d "${OPENDKIM_KEYS_DIR}" ]]; then echo "Creating DKIM keys for $JMAIL_ORIGIN" mkdir -p $OPENDKIM_KEYS_DIR opendkim-genkey -b 1024 -d $JMAIL_ORIGIN -D $OPENDKIM_KEYS_DIR -s sendonly - chown -R opendkim: $OPENDKIM_KEYS_DIR/sendonly.private + chown -R 0:0 $OPENDKIM_KEYS_DIR/sendonly.private fi cat $OPENDKIM_KEYS_DIR/sendonly.txt diff --git a/data/templates/opendkim/key.table.tmpl b/data/templates/opendkim/key.table.tmpl index 6c14ab8..8c00d65 100644 --- a/data/templates/opendkim/key.table.tmpl +++ b/data/templates/opendkim/key.table.tmpl @@ -1 +1 @@ -sendonly._domainkey.{{ .Env.JMAIL_ORIGIN }} {{ .Env.JMAIL_ORIGIN}}:sendonly:/etc/opendkim/keys/{{ .Env.JMAIL_ORIGIN }}/sendonly.private +sendonly._domainkey.{{ .Env.JMAIL_ORIGIN }} {{ .Env.JMAIL_ORIGIN }}:sendonly:/etc/opendkim/keys/{{ .Env.JMAIL_ORIGIN }}/sendonly.private diff --git a/data/templates/opendkim/opendkim.conf.tmpl b/data/templates/opendkim/opendkim.conf.tmpl index bee0e0f..4465573 100644 --- a/data/templates/opendkim/opendkim.conf.tmpl +++ b/data/templates/opendkim/opendkim.conf.tmpl @@ -19,6 +19,5 @@ Socket local:/var/spool/postfix/opendkim/opendkim.sock ReportAddress postmaster@{{ .Env.JMAIL_ORIGIN }} SendReports yes -UserID opendkim InternalHosts refile:/etc/opendkim/trusted.hosts diff --git a/data/templates/opendkim/signing.table.tmpl b/data/templates/opendkim/signing.table.tmpl index 771ccdb..d66a208 100644 --- a/data/templates/opendkim/signing.table.tmpl +++ b/data/templates/opendkim/signing.table.tmpl @@ -1 +1,2 @@ *@{{ .Env.JMAIL_ORIGIN }} sendonly._domainkey.{{ .Env.JMAIL_ORIGIN }} +*@*.{{ .Env.JMAIL_ORIGIN }} sendonly._domainkey.{{ .Env.JMAIL_ORIGIN }} diff --git a/data/templates/opendkim/trusted.hosts.tmpl b/data/templates/opendkim/trusted.hosts.tmpl index 231e5bf..f3e64c3 100644 --- a/data/templates/opendkim/trusted.hosts.tmpl +++ b/data/templates/opendkim/trusted.hosts.tmpl @@ -6,4 +6,5 @@ localhost 172.16.0.0/12 192.168.0.0/16 +{{ .Env.JMAIL_ORIGIN }} *.{{ .Env.JMAIL_ORIGIN }} diff --git a/data/templates/postfix/generic.tmpl b/data/templates/postfix/generic.tmpl index 2df9df8..546eda5 100644 --- a/data/templates/postfix/generic.tmpl +++ b/data/templates/postfix/generic.tmpl @@ -1 +1,3 @@ +root@{{ .Env.JMAIL_ORIGIN }} noreply@{{ .Env.JMAIL_ORIGIN }} root@localhost noreply@{{ .Env.JMAIL_ORIGIN }} +root@localhost.localdomain noreply@{{ .Env.JMAIL_ORIGIN }} diff --git a/data/templates/postfix/main.cf.tmpl b/data/templates/postfix/main.cf.tmpl index 97a99ee..a1d2567 100644 --- a/data/templates/postfix/main.cf.tmpl +++ b/data/templates/postfix/main.cf.tmpl @@ -6,7 +6,7 @@ allow_percent_hack = no myhostname = {{ .Env.JMAIL_HOSTNAME }} myorigin = {{ .Env.JMAIL_ORIGIN }} -mydestination = localhost.local, localhost.localdomain, localhost +mydestination = localhost.localdomain, localhost mynetworks = 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 127.0.0.0/8 # Incoming