1
1
mirror of https://github.com/docker-mailserver/docker-mailserver synced 2024-10-18 10:18:07 +02:00
Commit Graph

333 Commits

Author SHA1 Message Date
pitilux
34eb54ac39
fix: Avoid alias being used as regex during dovecot dummy account userdb detection (#4222)
Applies alternative approach previously suggested by @polarathene and adds test cases to prevent future regressions
2024-10-12 11:34:20 +13:00
Georg Lauterbach
3937e1e719
scripts: improve DKIM path scanning in Rspamd setup (#4201) 2024-09-29 12:18:43 +02:00
Brennan Kinney
025a38d736
chore: Add maintenance note for LMTP (#4199) 2024-09-26 20:01:35 +12:00
Georg Lauterbach
94751e00c9
dependency: update jaq from 1.3.0 to 1.6.0 (#4190) 2024-09-21 21:04:06 +02:00
Casper
ab2127ba67
chore: Add comments to start-mailserver.sh and stop using inherit_errexit (#4161) 2024-08-19 00:51:44 +02:00
Casper
b2978fd760
breaking: Refactor getmail support (#4156)
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2024-08-17 12:14:59 +02:00
Brennan Kinney
526fd64d11
fix: Ensure main log file is tailed from the start (#4146)
Co-authored-by: Casper <casperklein@users.noreply.github.com>
2024-08-03 12:04:21 +12:00
Brennan Kinney
2f8ad142ec
fix: Prevent stderr being written to /etc/postfix/main.cf (#4147)
`stderr` is filtered by `grep` to discard unwanted (expected) log noise when appending the override `postfix-main.cf` content (_updated settings did not replace earlier defined instances_).

That `grep` filter introduced a regression into DMS v14 release, since any other `stderr` content not being excluded was now blended into `stdout` and redirected with the original `stdout` output for the `postconf -n` command.

The fix is to ensure the `grep` output is redirect to `stderr` to avoid that mishap.
2024-08-02 09:42:39 +12:00
Brennan Kinney
9175424d0f
fix: Update dovecot-fts-xapian to 1.7.13 (#4095)
* fix: Update `dovecot-fts-xapian` to `1.7.13`

Contains a fix to a regression introduced that broke indexing

---------

Co-authored-by: casperklein <casperklein@users.noreply.github.com>
2024-07-03 22:16:02 +12:00
Casper
e370c0c96a
fail2ban install: remove -k (--insecure) from curl options (#4080) 2024-06-19 18:34:18 +02:00
Casper
d7dab2d20d
feat: Add password confirmation (#4072)
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2024-06-19 06:10:00 +00:00
Casper
18d9d1adcc
Fail2ban 1.1.0 (#4045) 2024-06-08 13:43:25 +02:00
Georg Lauterbach
f8b3f40276
scripts: update log format (#4035)
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2024-05-29 12:28:51 +12:00
Georg Lauterbach
b222035112
scripts: perform additional checks when updating/adding/deletting accounts (#4033)
* normalize accounts to lowercase
* update CHANGELOG
* add test to verify bug fix works correctly
2024-05-25 17:56:19 +00:00
Georg Lauterbach
4119849284
update: Dovecot FTS Xapian from 1.5.5 to 1.7.12 (#4034)
* update `compile.sh` and Dovecot FTS Xapian to 1.7.12
  - I updated from 1.5.5. Moreover, I adjusted the script to have what I
consider better style.
* update Dockerfile to use recent updates
* update CHANGELOG
2024-05-25 19:49:45 +02:00
Jiří Štefka
993c7b044f
breaking: Drop Dovecot support for Solr (#4025) 2024-05-21 16:49:39 +02:00
Brennan Kinney
ed669bd314
fix: /var/mail-state should not symlink non-existing directories (#4018)
Fixes an issue with the Getmail service, view PR thread for additional details.
- Log an error when the expected service state directory doesn't exist.
- The location `/var/lib/getmail/` doesn't seem like it should have been introduced. Drop it in favor of `/tmp/docker-mailserver/getmail`. It appears to be for storing remote mail that was retrieved if not configured to send to Dovecot like our docs advise. This location was never valid anyway (_as referenced issue covers_).
2024-05-19 22:32:53 +12:00
Brennan Kinney
e2c2a22dcf
fix: postfix-main.cf may depend upon postfix-master.cf (#3880)
Custom parameters must be referenced to be retained when `postconf -n` is run. If those parameters are referenced by `postfix-master.cf` this needs to update `master.cf` before updating `main.cf`.
2024-05-03 11:12:34 +12:00
Brennan Kinney
7dcbbd7173
fix(accounts.sh): Sync user home location for alias workaround (#3997) 2024-05-02 19:41:25 +12:00
Casper
3125cad45a
Enable spamassassin only, when amavis is enabled too. (#3943) 2024-03-21 00:53:04 +01:00
Casper
066773e79f
Better support regular container restarts (#3929)
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2024-03-17 16:31:55 +01:00
Casper
267fc552d2
getmail: remove temp file usage (#3920) 2024-03-09 14:21:02 +01:00
Kirill Kirilenko
3649699197
fix: Move spam to mailbox associated to the \Junk special-use attribute (#3925)
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2024-03-07 11:13:22 +13:00
Georg Lauterbach
e21e5e0490
Rspamd: update history key in Redis configuration (#3927) 2024-03-06 08:44:34 +01:00
Casper
83a48e8958
Fail2ban logrotate interval/count: substitute only when necessary (#3919) 2024-03-03 22:48:42 +01:00
Casper
736f2e44bc
Fail2Ban: Align logrotate count & interval (#3915) 2024-03-01 01:00:23 +01:00
Dominic Germain
512f39c7eb
feat: Configurable number of rotated log files (#3907) 2024-02-28 15:34:30 +01:00
Brennan Kinney
d86c3cb159
chore: packages.sh - Remove redundant comment (#3900) 2024-02-20 21:21:22 +13:00
Robbert Klarenbeek
a815bf5ab4
fix: Apply SELinux security context after moving to mail-state (#3890)
* fix: Apply SELinux security context after moving to mail-state
* fix: Ignore failing chcon on non-SELinux systems
2024-02-16 20:24:39 +13:00
Georg Lauterbach
4f222fe256
Rspamd: improve DKIM key generation (#3876)
* correct removal of old files with `--force`

`rm` would fail when one of the files is not present, which is quite
undesirable log (not harmful until `set -e` is introduced).

* use tmp log file

ref: https://github.com/docker-mailserver/docker-mailserver/issues/3873#issuecomment-1926736020

* correct indentation
2024-02-06 00:30:22 +01:00
Hans-Cees Speel
45935f5fb8
rspamd: add neural module config (#3833)
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2024-02-01 17:34:33 +01:00
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
Casper
23705e6712
fix: abort when (jaq) curl fails (#3853) 2024-01-30 19:34:26 +13:00
Brennan Kinney
244c455ca1
fix: packages.sh - Download jaq via release tag not latest (#3852)
As the filename includes the version / tag, we cannot rely on the latest URL to be stable.
2024-01-30 11:11:45 +13:00
Georg Lauterbach
4162d608e4
Rspamd scripts: only correct permissions when directory exists (#3849) 2024-01-30 10:10:03 +13:00
Georg Lauterbach
afb0093939
spam: use Sieve for rewriting subject with Rspamd & SA/Amavis (#3820) 2024-01-29 13:38:01 +01:00
Brennan Kinney
3b11a8305e
docs: Remove ENV ONE_DIR (#3840)
* docs: Better document DMS volumes

* docs: Remove any mention of `ONE_DIR` ENV

* chore: Remove `ONE_DIR` ENV from scripts

Only `ONE_DIR=0` has any effect. As the actual feature is now dependent upon the `/var/mail-state` location existing.

It is advised not mounting anything there instead if wanting to avoid runtime state consolidation.

* docs: Adjust link ref convention

This is more search friendly / organized to find references to all DMS volumes.

* lint: Ensure final newline is present

VSCode by default excludes this if the last line rendered is removed (rendered as a separate blank line).

A separate setting can enforce adding the final newline upon save regardless.
2024-01-29 10:35:19 +13:00
Andreas Perhab
9ac11021e1
setup-stack: fix error when RSPAMD_DMS_DKIM_D is not set (#3827)
* setup-stack: fix error when RSPAMD_DMS_DKIM_D is not set

prevent messages like this
  chown: cannot access '': No such file or directory
when RSPAMD_DMS_DKIM_D has no value

* Update target/scripts/startup/setup-stack.sh

---------

Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2024-01-26 14:40:29 +01:00
Georg Lauterbach
ba27edc801
Rspamd: only declare Rspamd variables when not already declared (#3837)
* only declare Rspamd vars when not already declared

* update CHANGELOG

* Update CHANGELOG.md

---------

Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2024-01-26 14:07:46 +01:00
Brennan Kinney
47f8d50beb
fix: Ensure configs are sanitized for parsing (#3819)
* chore: Detect missing final newline in configs read

These lines will be not be processed by `read`, emit a warning to raise awareness.

* fix: Ensure parsed config has final newline appended (when possible)

This functionality was handled in `accounts.sh` via a similar sed command (that the linked references also offer).

`printf` is better for this, no shellcheck comment required either.

We additionally don't attempt to modify files that are read-only.

* fix: Ensure parsed configs have CRLF to LF corrected (where possible)

Likewise, this runtime fix was only covering two config files. It now applies to all callers of this method.

* fix: Sanitize `postfix-master.cf` via helper

This feature should have been using the helper to avoid user error from their config updates accidentally introducing subtle breakage implicitly (due to CRLF or missing final newline).

* tests: Add test cases for new helpers

* tests:  `rm` is redundant when using `BATS_TEST_TMPDIR`

This temporary directory is created and removed implicitly. Even after a test failure.

* chore: Remove old `postfix-virtual.cf` migration logic

This was introduced in 2018, there should be no one needing to rely on this anymore?

* tests: Remove comment on sed failure concern

* chore: Add entry to `CHANGELOG.md`

* Apply suggestions from code review

Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>

---------

Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2024-01-26 10:28:26 +13:00
Brennan Kinney
22c6daee32
chore: Revise improper restart message (#3826)
Improved guidance.
2024-01-25 12:21:24 +00:00
Georg Lauterbach
00018e7e2b
general: update base image to Debian 12 ("Bookworm") (#3403)
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
Co-authored-by: Casper <casperklein@users.noreply.github.com>
2024-01-24 17:05:55 +01:00
Brennan Kinney
d40a17f7e0
fix: Ensure correct ownership for the Rspamd DKIM directory (#3813)
The UID / GID shifted during a new release. Until DKIM handling is refactored in a new major release, this fix ensures the content maintains the expected `_rspamd` ownership.
2024-01-23 11:51:10 +01:00
Brennan Kinney
2d59aac5a1
chore: Add maintenance comment for sed usage (#3789)
This is a more explicit reminder for any future contributors that get thrown off by the usage of `sed` here and may be inclined to change it.

Add a link to reference a comment where it's already been explored what the alternative `sed` invocations available are.
2024-01-17 20:54:27 +13:00
Brennan Kinney
265440b2bb
fix: Ensure .svbin files are newer than .sieve source files (#3779) 2024-01-15 10:34:15 +01:00
Joerg Sonnenberger
e3331b0f44
feat: Add MTA-STS support for outbound mail (#3592)
* feat: add support for MTA-STS for outgoing mails

* Hook-up mta-sts-daemon into basic process handling test

* fix: Call python script directly

The python3 shebang will run it, which will now meet the expectations of the process testing via pgrep. fail2ban has the same approach.

---------

Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2024-01-13 21:37:20 +13:00
Casper
71e1102749
Tiny #3480 follow up: Add missing ENABLE_OAUTH2 var (#3775) 2024-01-12 23:48:14 +01:00
Keval Kapdee
52c4582f7b
feat: Auth - OAuth2 (Dovecot PassDB) (#3480)
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2024-01-13 09:45:14 +13:00
Georg Lauterbach
06fab3f129
tests: streamline tests and helpers further (#3747)
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2024-01-11 10:34:08 +01:00
Casper
aba218e6d7
Fix jaq: Download platform specific binary (#3766)
* choose architecture dynamically
2024-01-10 12:31:30 +13:00