Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

email notification with empty message id causes delivery failure #1351

Open
3 tasks done
cheggerdev opened this issue Jan 27, 2025 · 0 comments
Open
3 tasks done

email notification with empty message id causes delivery failure #1351

cheggerdev opened this issue Jan 27, 2025 · 0 comments

Comments

@cheggerdev
Copy link

Support guidelines

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

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

Description

diun notification per email sends email with an empty message id.
This results in an error when mail delivery goes through a relay.

Expected behaviour

diun sends email with a message id that mail delivery is successful through a relay.

Actual behaviour

At first, diun successfully establishes a TLS connection to my relay server:

2025-01-27T16:27:19+01:00 nas-server postfix/smtpd[30443]: connect from unknown[172.16.3.2]
2025-01-27T16:27:19+01:00 nas-server postfix/smtpd[30443]: Anonymous TLS connection established from unknown[172.16.3.2]: TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 ...
2025-01-27T16:27:19+01:00 nas-server postfix/smtpd[30443]: 9AA8F785B: client=unknown[172.16.3.2], sasl_method=PLAIN, sasl_username=abc

Then diun sends a mail with an empty message id:

2025-01-27T16:27:19+01:00 nas-server postfix/cleanup[30450]: 9AA8F785B: message-id=<>
2025-01-27T16:27:19+01:00 nas-server postfix/qmgr[29158]: 9AA8F785B: from=<[email protected]>, size=7294, nrcpt=1 (queue active)
2025-01-27T16:27:19+01:00 nas-server postfix/smtpd[30443]: disconnect from unknown[172.16.3.2] ehlo=1 auth=1 mail=1 rcpt=1 data=1 quit=1 commands=6

Then the relay wants to send it further for real:

2025-01-27T16:27:19+01:00 nas-server postfix/smtp[30455]: Trusted TLS connection established to mail.my-domain.de [10.30.20.10]:587: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 ...
2025-01-27T16:27:21+01:00 nas-server postfix/smtp[30455]: 9AA8F785B: to=<[email protected]>, relay=mail.my-domain.de [10.30.20.10]:587, delay=1.6, delays=0.07/0.01/1.6/0, dsn=4.7.8, status=deferred (SASL authentication failed; server mail.my-domain.de [10.30.20.10] said: 535 5.7.8 Error: authentication failed: )
2025-01-27T16:27:21+01:00 nas-server postfix/smtp[30455]: get message_id fail

And the empty message id from diun results in failure.

How can I configure diun to generate a message id?

Steps to reproduce

  1. Setup a relay smtp
  2. Configure diun to send email notification to the relay
  3. Watch the relay logs where email delivery fails because of empty message id

Diun version

4.29.0

Docker info

Client:
 Context:    default
 Debug Mode: false

Server:
 Containers: 22
  Running: 22
  Paused: 0
  Stopped: 0
 Images: 44
 Server Version: 20.10.23
 Storage Driver: btrfs
  Build Version: Btrfs v4.0
  Library Version: 101
 Logging Driver: db
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs db fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b23a389d8c181697302d163356e97dec04eb8d88
 runc version: 5af893d
 init version: ed96d00
 Security Options:
  apparmor
 Kernel Version: 4.4.302+
 Operating System: DiskStation

 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.619GiB
 Name: APEHLStation
 ID: UELP:SO6E:EWNI:257D:LAEM:4QOI:2SDM:P3BT:PVHN:KRMU:5A55:NRXW
 Docker Root Dir: /volume1/@docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No kernel memory TCP limit support
WARNING: No cpu cfs quota support
WARNING: No cpu cfs period support
WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support

Docker Compose config

services:
    diun:
        image: crazymax/diun:latest
        container_name: diun
        command: serve
        env_file:
            - .env
        restart: unless-stopped
        volumes:
            - ./data:/data
            - /var/run/docker.sock:/var/run/docker.sock
            - ${TRUSTED_CA_STORE}:/etc/ssl/certs/ca-certificates.crt:ro
        environment:
            - TZ=Europe/Berlin
            - LOG_LEVEL=info
            - LOG_JSON=false
            - DIUN_WATCH_WORKERS=20
            - DIUN_WATCH_SCHEDULE=0 */6 * * *
            - DIUN_WATCH_JITTER=30s
            - DIUN_PROVIDERS_DOCKER=true
            - DIUN_PROVIDERS_DOCKER_WATCHBYDEFAULT=true
        networks:
            - default


networks:
    default:
        driver: bridge
        ipam:
            driver: default
            config:
                - subnet: 172.16.3.0/24
                  gateway: 172.16.3.1

Logs

diun  | Mon, 27 Jan 2025 18:54:31 CET DBG [containers/image]  No signature storage configuration found for docker.io/crazymax/diun:latest, using built-in default file:///var/lib/containers/sigstore
diun  | Mon, 27 Jan 2025 18:54:31 CET DBG [containers/image] Looking for TLS certificates and private keys in /etc/docker/certs.d/docker.io
diun  | Mon, 27 Jan 2025 18:54:31 CET DBG [containers/image] GET https://registry-1.docker.io/v2/
diun  | Mon, 27 Jan 2025 18:54:31 CET DBG [containers/image] Ping https://registry-1.docker.io/v2/ status 401
diun  | Mon, 27 Jan 2025 18:54:31 CET DBG [containers/image] GET https://auth.docker.io/token?scope=repository%3Acrazymax%2Fdiun%3Apull&service=registry.docker.io
diun  | Mon, 27 Jan 2025 18:54:31 CET DBG [containers/image] HEAD https://registry-1.docker.io/v2/crazymax/diun/manifests/latest
diun  | Mon, 27 Jan 2025 18:54:32 CET DBG No changes image=docker.io/crazymax/diun:latest provider=docker
diun  | Mon, 27 Jan 2025 18:54:32 CET DBG Manifest saved to database image=docker.io/crazymax/diun:latest provider=docker
diun  | Mon, 27 Jan 2025 18:54:32 CET INF Jobs completed added=0 failed=0 skipped=0 unchanged=1 updated=0
diun  | Mon, 27 Jan 2025 18:54:32 CET INF Cron initialized with schedule 0 */12 * * *
diun  | Mon, 27 Jan 2025 18:54:32 CET INF Next run in 5 hours 5 minutes (2025-01-28 00:00:22.830048396 +0100 CET)

test notification prints no log output

Additional info

No response

@cheggerdev cheggerdev changed the title email notification with empty message id email notification with empty message id causes failure Jan 27, 2025
@cheggerdev cheggerdev changed the title email notification with empty message id causes failure email notification with empty message id causes delivery failure Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant