Skip to content

SMTP notifier does not await submission completion #4005

@dannykopping

Description

@dannykopping

I'd like to backport a fix from coder/coder#14495. We took heavy inspiration from notify/email/email.go for our SMTP dispatch implementation, but we discovered a fairly nasty bug which is also present in this code.

tl;dr: the email notifier does not correctly close an SMTP submission, which may lead to unsuccessful dispatches being marked as successful.

The details are documented in the above PR.

I'll raise a PR to fix this, but I wanted to first check if the maintainers would accept a new approach towards SMTP testing. In coder/coder I introduced emersion/go-smtp to enable SMTP server mocking (see here). I'd like to do the same here because it'll simplify the tests and does not require maildev+docker.

If there's a way to provoke this behaviour with maildev, please let me know as that would be simpler - but from my cursory scan of the docs it did not seem possible.

PS miss you folks at Grafana Labs ❤️

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions