Go to file
Brennan Kinney 5bada0a83b
tests: Refactor LDAP tests to current conventions (#3483)
* tests: Switch to setup helper and conventions

* tests: Adapt run command to new conventions

- We have two helper methods with implicit `CONTAINER_NAME` reference, which is a bit more DRY and improves readability.
- `wc -l` + `assert_output 1` converted to use helper `_should_output_number_of_lines 1`
- `DOMAIN` var changed from `my-domain.com` to local testing domain `example.test`.

* tests: Refactor `setup_file()`

- Test wide ENV defined at the top
- OpenLDAP build and run logic grouped together. Added notes, network alias and tty not required.
- Extracted out special LDAP Postfix/Dovecot ENV into separate array. LDAP specific provisioning / auth ENV also included, with comments + linebreak to better group related ENV.
- Likewise additional ENV to support test cases has been extracted to a separate array with additional comments for context.
- Those two arrays are expanded back into the main `CUSTOM_SETUP_ARGUMENTS` that configure hostname and network for the DMS container.

* tests: Refactor the LDAP account table query testcase

- Covers 3 accounts to test from LDAP.
  - 2 are the same query against users/aliases/groups tables in Postfix, only differing by account queried (and expected as returned result).
  - 1 separate test to ensure a difference in config is supported correctly.
- Extracted repeated test logic into a helper method.
- Added additional context in comments about the creation source of these LDAP accounts and their related Postfix config / interaction. Direct reference to special case PR (since `git blame` will be less useful).

* tests: Use iteration for `grep` setting checks

More DRY approach. With a bit more helpful failure context via `assert_output` (_and only grepping the key_). Simpler to grok what's being covered.

* tests: DRY test email delivery

A bit more verbose with the new helper method. `test-email.txt` template is only used by the LDAP test, as is the `sendmail` command.

Helper will take two args to support the testcases, but at a later date should be refactored to be consistent with the `_send_email()` helper (_which presently uses `nc` that is required for plain-text mail/auth, otherwise we'd have used `openssl`, bigger refactor required_).

* tests: Slight revisions and relocating testcases

- Dovecot quota plugin testcase revised to check files exist instead of rely on `ls` failure.
- Moved Postfix quota plugin testcase into prior dovecot testcase for quota plugin check. Better error output by only querying the `smtpd_recipient_restrictions` setting (_which should be the only one configured for the service_).
- Moved the saslauthd and pflogsumm testcases (_no changes beyond revised comments_) above the `ATTENTION` comment, and one testcase below the comment that belonged to that group.

* tests: Simplify openldap `docker build` command

- `--no-cache` was creating a new image on the Docker host each time the test is run. Shouldn't be any need to build without cache.
- No need to use `pushd` + `popd`, can just provide the path context directly, and the `./Dockerfile` is an implicit default thus `-f` not required either.

Additionally removed the old `checking` prefix from testcase names.

* tests: Move LDAP specific config into `test/config/ldap/`

- No changes to any of these config files, just better isolation as not relevant to any other tests.
- Section heading in `setup_file()` added to distinguish the remainder of the function is dedicated to the DMS container setup.
- Comment providing some context about the `mv` to maintainers, this should be done after defaults are initialized but before starting up the container.

* chore: Appease the lint gods

* Apply suggestions from code review
2023-08-17 14:33:34 +12:00
.github chore: Discourage latest in bug report version field (#3435) 2023-07-20 22:45:33 +02:00
config-examples docs: Fix typos (#3443) 2023-07-27 12:24:36 +12:00
docs rspamd: disable checks for authenticated users (#3440) 2023-08-08 10:43:21 +02:00
target rspamd: disable checks for authenticated users (#3440) 2023-08-08 10:43:21 +02:00
test tests: Refactor LDAP tests to current conventions (#3483) 2023-08-17 14:33:34 +12:00
.all-contributorsrc Update contributors (#2143) 2021-08-28 15:23:11 +02:00
.dockerignore Update check (#1951) 2021-05-19 21:18:06 +02:00
.editorconfig removal: configomat (submodule) (#3045) 2023-02-05 12:39:05 +01:00
.gitignore chore: Remove the Makefile backup target (#3000) 2023-01-13 10:13:42 +13:00
.gitmodules removal: configomat (submodule) (#3045) 2023-02-05 12:39:05 +01:00
CHANGELOG.md release: v12.1.0 (#3305) 2023-05-10 10:20:46 +02:00
CODE_OF_CONDUCT.md docs(fix): Update wiki references to the new docs url 2021-03-25 11:49:24 +13:00
compose.yaml compose.yaml: Add comment about disabled authentication on port 25 (#3464) 2023-08-14 01:58:54 +02:00
CONTRIBUTORS.md docs(CONTRIBUTORS): update contributors (#3210) 2023-04-01 16:23:55 +13:00
Dockerfile Dovecot: compile fts_xapian from source to match Dovecot ABI (#3373) 2023-06-01 10:50:31 +02:00
LICENSE Final Migration Step (#6) 2021-01-16 10:16:05 +01:00
mailserver.env rspamd: disable checks for authenticated users (#3440) 2023-08-08 10:43:21 +02:00
Makefile Add BASH syntax check to linter (#3369) 2023-05-27 22:12:24 +02:00
README.md feature: adding getmail as an alternative to fetchmail (#2803) 2023-05-23 17:25:08 +02:00
SECURITY.md ci/docs: add vulnerability scanning workflow & security policy (#3106) 2023-02-23 08:53:12 +01:00
setup.sh Change 'while' style (#3365) 2023-05-26 01:39:39 +02:00
VERSION release: v12.1.0 (#3305) 2023-05-10 10:20:46 +02:00

Docker Mailserver

ci::status docker::pulls documentation::badge

📃 About

A production-ready fullstack but simple containerized mail server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.). Only configuration files, no SQL database. Keep it simple and versioned. Easy to deploy and upgrade. Originally created by @tomav, this project is now maintained by volunteers since January 2021.

💡 Documentation

We provide a dedicated documentation hosted on GitHub Pages. Make sure to read it as it contains all the information necessary to set up and configure your mail server. The documentation is crafted with Markdown & MkDocs Material.

💥 Issues

If you have issues, please search through the documentation for your version before opening an issue. The issue tracker is for issues, not for personal support. Make sure the version of the documentation matches the image version you're using!

  1. FAQ
  2. Usage
  3. Examples
  4. Issues and Contributing
  5. Release Notes
  6. Environment Variables
  7. Updating

📦 Included Services