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

New Container: Mailpit #626

Closed
oliverlambson opened this issue Jun 30, 2024 · 0 comments · Fixed by #625
Closed

New Container: Mailpit #626

oliverlambson opened this issue Jun 30, 2024 · 0 comments · Fixed by #625

Comments

@oliverlambson
Copy link
Contributor

oliverlambson commented Jun 30, 2024

What is the new container you'd like to have?

axllent/mailpit is a full-featured SMTP mock server that's ideal for integration testing.

It allows for simple configs that accept any auth, and can be configured to (1) support STARTTLS and SSL; (2) accept only specific user/password combinations for auth. This covers most ways you would connect to a real SMTP server and is particularly useful for avoiding having to create a specific insecure SMTP handler for testing only—moving the mocking out of application code.

Why not just use a generic container for this?

The SSL support config is non-trivial, as it requires generating a private key and a self-signed certificate, and mounting them to the container. Configuring specific user/pass auth also requires setting multiple env vars in the container in a single string with a specific format.

For an end-user, having an SMTP server that can just be spun up that supports TLS and specific user/pass auth without understanding the internals seems ideal. If nothing else, it means you don't have to repeat the same config over and over again whenever you want to use a mailpit testcontainer.

Other references:

N/A

Tranquility2 pushed a commit to Tranquility2/testcontainers-python that referenced this issue Jun 30, 2024
Fixes testcontainers#626

- [x] Your PR title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) syntax
  as we make use of this for detecting Semantic Versioning changes.
- [x] Your PR allows maintainers to edit your branch, this will speed up
resolving minor issues!
- [x] The new container is implemented under `modules/*`
- Your module follows [PEP 420](https://peps.python.org/pep-0420/) with
implicit namespace packages
    (if unsure, look at other existing community modules)
  - Your package namespacing follows `testcontainers.<modulename>.*`
    and you DO NOT have an `__init__.py` above your module's level.
  - Your module has it's own tests under `modules/*/tests`
- Your module has a `README.rst` and hooks in the `.. auto-class` and
`.. title` of your container
- Implement the new feature (typically in `__init__.py`) and
corresponding tests.
- [x] Your module is added in `pyproject.toml`
- it is declared under `tool.poetry.packages` - see other community
modules
- it is declared under `tool.poetry.extras` with the same name as your
module name,
we still prefer adding _NO EXTRA DEPENDENCIES_, meaning `mymodule = []`
is the preferred addition
    (see the notes at the bottom)
- [x] (seems to not be needed anymore) The `INDEX.rst` at the project
root includes your module under the `.. toctree` directive
- [x] Your branch is up to date (or we'll use GH's "update branch"
function through the UI)

---------

Co-authored-by: Dave Ankin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant