docker icon indicating copy to clipboard operation
docker copied to clipboard

Second domain no DKIM signing

Open JensSpanier opened this issue 2 years ago • 9 comments

Support guidelines

I've found a bug and checked that ...

  • [X] ... the documentation does not mention anything about my problem
  • [X] ... there are no open or closed issues that are related to my problem

Description

I've added another domain to ANONADDY_ALL_DOMAINS. So my config looks like this:

ANONADDY_DOMAIN=example.com
ANONADDY_ALL_DOMAINS=example.com,example2.com
RSPAMD_ENABLE=true
RSPAMD_NO_LOCAL_ADDRS=true

I also created DKIM keys for both domains. The folder data/dkim has the following files:

  • example.com.private
  • example.com.txt
  • example2.com.private
  • example2.com.txt

Signing mails with DKIM from example.com works just fine. But in mails from example2.com there is no DKIM header.

Expected behaviour

All domains should get a DKIM singature.

Actual behaviour

Only first domain and custom domains get a DKIM signature.

Steps to reproduce

  1. Add two domains to ANONADDY_ALL_DOMAINS
  2. Create DKIM keys
  3. Send mail to second domain in ANONADDY_ALL_DOMAINS

Docker info

Client: Docker Engine - Community
 Version:    24.0.6
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.2
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.21.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 4
  Running: 3
  Paused: 0
  Stopped: 1
 Images: 3
 Server Version: 24.0.6
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 8165feabfdfe38c65b599c4993d227328c231fca
 runc version: v1.1.8-0-g82f18fe
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-84-generic
 Operating System: Ubuntu 22.04.3 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 1
 Total Memory: 957.5MiB
 Name: ina.spnr.de
 ID: 0dd3d1d8-58d7-49a8-8704-2ead68269b64
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Docker Compose config

No response

Logs

/

Additional info

No response

JensSpanier avatar Sep 26 '23 16:09 JensSpanier

Create only for master domain example.com a dkim privatekey and add in dns from example.com a txt record default._domainkey dkim,… FJFKKFBFJFKFNFBFBFJFJFB==

For domains added via anonaddy web ui goto dns and create a cname redirect default._domainkey (on example2 domain dns) to default._domainkey.example.com.

PaddyPat avatar Oct 21 '23 20:10 PaddyPat

Thanks for your reply. But that’s not what I was planning to do. I want to add example.com and example2.com globally so every user can use these domains. Adding example2.com via web ui only allows one user to use this domain.

Like I said, DKIM signing for example.com and all Domains added via web ui by users works fine. But a second global domain doesn’t get a DKIM signature.

JensSpanier avatar Oct 22 '23 07:10 JensSpanier

What is the contents of the Rspamd DKIM config file? Typically /etc/rspamd/local.d/dkim_signing.conf but may be different with Docker.

willbrowningme avatar Oct 23 '23 11:10 willbrowningme

I think 14-config-rspamd.sh may need updating to loop over all the domains in ANONADDY_ALL_DOMAINS and to add each of them to the signing table - https://github.com/anonaddy/docker/blob/master/rootfs/etc/cont-init.d/14-config-rspamd.sh#L22-L29

And also update DKIM_PRIVATE_KEY so that it copies all keys from data/dkim. Or just sign all additional domains with they same key to simplify things.

willbrowningme avatar Oct 23 '23 11:10 willbrowningme

In my opinion signing everything with the same key would be fine.

JensSpanier avatar Oct 29 '23 08:10 JensSpanier