Open gwire opened 2 years ago
I would love this as well, I was about to email @jetmore to see if it was possible, until I found this issue
Chiming in here as one of the core maintainers of docker-mailserver/docker-mailserver
.
I am currently refactoring our test suite to move away from nc
to swaks
. For our DSN tests, this is required. Support for DSN would be awesome.
Is --dsn-notify
sufficient? Or is the request to only support a portion of the DSN extension? (NOTIFY
parameter, which is what everyone here is interested in?)
lettre
(Rust) handles the RCPT command with support for multiple RCPT parameters.NOTIFY
parameter for implementing the DSN extension.Chiming in here as one of the core maintainers of docker-mailserver/docker-mailserver.
We now use swaks
where possible. Thanks for such a great project, it really helped simplify our tests! 😁
For reference here is our test for DSN support (PR that introduced it) in docker-mailserver
/ DMS.
This is not necessary to know, but provides information/links regarding the test for better grokking what we're doing under the hood through convenience methods.
You seem to have your own test-suite but if it helps implement this feature more easily, DMS can quickly / easily provide a mail server for testing (Postfix, Dovecot, etc):
# Run DMS:
# PERMIT_DOCKER=container relaxes some security checks (eg: DNS related)
docker run --rm -it -d \
--hostname mail.example.test \
--name dms \
--env PERMIT_DOCKER=container \
mailserver/docker-mailserver
# Add a user account:
docker exec -it dms setup email add hello@example.test bad-password
# For convenience, add your WIP swaks release into the running container:
docker cp /path/to/local/swaks dms:/path/in/container/swaks
# Run that copied over swaks within the container:
# NOTE: DMS defaults only enable DSN on submission(s) ports for authenticated users.
docker exec -it dms /path/in/container/swaks \
--dsn-notify=success,failure \
--protocol SSMTPA \
--auth-user hello@example.test \
--auth-password bad-password
--server 0.0.0.0
# If you need shell access within the container just use:
docker exec -it dms bash
# When you're done bring the container down (--rm from `docker run` will handle cleanup):
docker stop dms
We'll soon be adding a feature that would allow for testing https://github.com/jetmore/swaks/pull/44 too if that interests you (SMTP Auth through Postfix delegates to Dovecot which handles XOAUTH
support).
I would be good if swaks could generate test DSN (RFC 3461) notification responses.
As a minimal feature, it would be useful to be able to request a response based on one or more of failure, delay, or success. eg
Then, if DSN is advertised after EHLO
the
RCPT TO:
command has aNOTIFY=
option appended to it.