Go to file
Brennan Kinney 5b54d1d32e
refactor: `relay.sh` (#3845)
* chore: `relay.sh` helper - Reference user config paths via variables

* chore: Better document postfix helper `_vhost_collect_postfix_domains()`

The functionality is effectively the same for the two configs for the most part when it comes to parsing out a domain from the target value.

Virtual aliases is more flexible in value, which may not have a domain-part present (manual user edit).

* chore: `check-for-change.sh` - Support VHOST change visibility

- Moves the "handle changes" logic into it's own scoped function, out of the main change detection loop logic.
- This will be benefit a future commit change that will rely on `VHOST_UPDATED=1`.

* chore: `relay.sh` - Minor revisions to minimize diff noise

- Better phrasing of the current logic comments.
- Regex patterns assigned to variables (easier to grok intention)
- Bulk of the logic for generating `/etc/postfix/relayhost_map` wrapped into a separate function with Postfix config setting handled separately.

* refactor: `relay.sh` opt-out logic

- Split the two distinct features that configure `/etc/postfix/relayhost_map` into separate functions (_`MATCH_VALID` var no longer needed for legacy support_).
- Instead of extracting domains from `postfix-accounts.cf` + `postfix-virtual.cf`, this has already been handled at `/etc/postfix/vhost`, sourcing from there is far less complicated.
- Rename loop var `DOMAIN_PART`to `SENDER_DOMAIN` for better context of what it represents when appended to the config file.
- Revised maintenance notes + guidance towards a future refactor of this relayhost feature support.

* docs: `relay.sh` - Additional comment revisions

* feat: `DEFAULT_RELAY_HOST` can now also use relay credentials ENV

- Remove comment regarding `smtp_sasl_password_maps = static:${RELAY_USER}:${RELAY_PASSWORD}`, it could be used but `main.cf` presently has `644` permissions vs the `sasl_passwd` file permissions of `600`, less secure at preventing leaking of secrets (ignoring the ENV exposure itself).
- Move the `main.cf` settings specific to relayhost credentials support / security into to the relevant function scope instead. This also allows for the configuration to be applied by a change detection event without container restart requirement.
- Outer functions for setup and change detection to call have a clearer config dependency guard, as does the `_legacy_support()`.
- These changes now support `DEFAULT_RELAY_HOST` to leverage the relay credentials ENV as well.
- `DATABASE_RELAYHOSTS` is available in scope to the functions called here that reference it.

* docs: Revised ENV docs on relay host config

Better quality guidance on configuring relay hosts.

* chore: Add entry to `CHANGELOG.md`

* fix: `relay.sh` - `grep` regex compatibility with `+` requires `-E`

* chore: `postfix.sh` - `FIRST_FIELD` => More descriptive field name
2024-01-31 10:24:43 +13:00
.github chore(deps): Bump anchore/scan-action from 3.6.0 to 3.6.1 (#3848) 2024-01-29 14:08:59 +01:00
config-examples docs: Fix typos (#3443) 2023-07-27 12:24:36 +12:00
docs refactor: `relay.sh` (#3845) 2024-01-31 10:24:43 +13:00
target refactor: `relay.sh` (#3845) 2024-01-31 10:24:43 +13:00
test spam: use Sieve for rewriting subject with Rspamd & SA/Amavis (#3820) 2024-01-29 13:38:01 +01: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 ci(fix): Normalize for `.gitattributes` + improve `eclint` coverage (#3566) 2023-10-04 12:53:32 +02:00
.gitattributes ci: `.gitattributes` - Ensure `eol=lf` for shell scripts (#3755) 2024-01-08 09:34:24 +13:00
.gitignore feat: Auth - OAuth2 (Dovecot PassDB) (#3480) 2024-01-13 09:45:14 +13:00
.gitmodules removal: configomat (submodule) (#3045) 2023-02-05 12:39:05 +01:00
CHANGELOG.md refactor: `relay.sh` (#3845) 2024-01-31 10:24:43 +13:00
CODE_OF_CONDUCT.md docs(fix): Update wiki references to the new docs url 2021-03-25 11:49:24 +13:00
CONTRIBUTORS.md docs: update `CONTRIBUTORS.md` (#3844) 2024-01-28 11:15:47 +00:00
Dockerfile general: update base image to Debian 12 ("Bookworm") (#3403) 2024-01-24 17:05:55 +01:00
LICENSE Final Migration Step (#6) 2021-01-16 10:16:05 +01:00
Makefile ci: add `run-local-instance` target to `Makefile` (#3663) 2023-12-04 10:28:40 +13:00
README.md docs: Minor revisions to `README.md` (#3839) 2024-01-28 01:51:37 +13:00
SECURITY.md ci/docs: add vulnerability scanning workflow & security policy (#3106) 2023-02-23 08:53:12 +01:00
VERSION release: v13.3.1 (#3817) 2024-01-24 14:25:13 +01:00
compose.yaml compose.yaml: Add comment about disabled authentication on port 25 (#3464) 2023-08-14 01:58:54 +02:00
mailserver.env refactor: `relay.sh` (#3845) 2024-01-31 10:24:43 +13:00
setup.sh Change 'while' style (#3365) 2023-05-26 01:39:39 +02:00

README.md

Docker Mailserver

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

📃 About

A production-ready fullstack but simple containerized mail server (SMTP, IMAP, LDAP, Anti-spam, Anti-virus, 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.

[!TIP] Be sure to read our documentation. It provides guidance on initial setup of your mail server.

[!IMPORTANT] 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