1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-08-10 22:31:47 +02:00
Commit Graph

4912 Commits

Author SHA1 Message Date
Florent Daigniere
adc8ef9aba Add the mariadb connector as per 3449 2024-12-30 16:06:56 +01:00
bors-mailu[bot]
694bf91ca0 Merge #3696
3696: Include sensible error messages for LMTP protocol r=mergify[bot] a=fmos

Running into the rate limit yields difficult to debug log messages by the smtp container. Specifically the `Temporary user lookup failure` message by the smtp container is misleading.

## Example

Although this is running on Podman, the bugs are in the Python code and almost certainly are not influenced by the host infrastructure. (Leaving aside that I likely have a configuration problem, because the client IP address is not passed along correctly. But the present fix applies nevertheless and is not related to any specific cause of the rate limit triggering.) 

### smtp logs

```shell
> podman logs --since "2024-12-25T07:33:31" --until "2024-12-25T07:33:33" systemd-mail-smtp
Dec 25 08:33:31 example postfix/smtpd[398]: connect from front[10.115.0.96]
INFO:root:Connect
Dec 25 08:33:31 example postfix/smtpd[398]: 6774324DE71C1: client=systemd-mail-front[10.115.0.96]
INFO:root:Connect
Dec 25 08:33:31 example postfix/cleanup[428]: 6774324DE71C1: message-id=<CAPhkJv+GTxVtwn6eNbBzPscohn6fgkhrYd2gEpUm2prr-5_7bg@mail.gmail.com>
Dec 25 08:33:32 example postfix/qmgr[376]: 6774324DE71C1: from=<SRS0=O1up=TS=gmail.com=fabiamos@example.com>, size=3968, nrcpt=1 (queue active)
Dec 25 08:33:32 example postfix/lmtp[429]: 6774324DE71C1: host front[10.115.0.96] said: 451 4.3.0 <fabian@example.com> Temporary user lookup failure (in reply to RCPT TO command)
Dec 25 08:33:32 example postfix/lmtp[429]: connect to front[10.115.0.9]:2525: Connection refused
Dec 25 08:33:32 example postfix/lmtp[429]: 6774324DE71C1: to=<fabian@example.com>, orig_to=<me+fancy@example.com>, relay=none, delay=0.63, delays=0.61/0.01/0.01/0, dsn=4.4.1, status=deferred (connect to front[10.115.0.9]:2525: Connection refused)
```

### admin logs

```shell
> podman logs --since "2024-12-25T07:33:31" --until "2024-12-25T07:33:33" systemd-mail-admin
10.115.0.96 - - [25/Dec/2024:08:33:31 +0100] "GET /internal/auth/email HTTP/1.0" 200 0 "-" "-"
[2024-12-25 08:33:32,030] WARNING in limiter: Authentication attempt from 10.115.0.99 has been rate-limited.
[2024-12-25 08:33:32,030] ERROR in app: Exception on /internal/auth/email [GET]
Traceback (most recent call last):
  File "/app/venv/lib/python3.12/site-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/mailu/internal/views/auth.py", line 27, in nginx_authentication
    status, code = nginx.get_status(flask.request.headers['Auth-Protocol'], 'ratelimit')
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/mailu/internal/nginx.py", line 140, in get_status
    return status, codes[protocol]
                   ~~~~~^^^^^^^^^^
KeyError: 'lmtp'
10.115.0.96 - - [25/Dec/2024:08:33:32 +0100] "GET /internal/auth/email HTTP/1.0" 200 0 "-" "-"
```

## What type of PR?

bug-fix

## What does this PR do?

### Related issue(s)
None

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [x] In case of feature or enhancement: documentation updated accordingly - not an enhancement
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file. - is a minor change


Co-authored-by: Fabian Stanke <me+github@fmos.at>
2024-12-27 09:45:13 +00:00
Fabian Stanke
8a13316a0d Adds towncrier entry for PR #3696 as requested 2024-12-27 07:20:58 +01:00
Fabian Stanke
ec1e49d137 Include error messages for LMTP
These are difficult to debug log messages, when instead of an error message one gets a stack trace with `KeyError: 'lmtp'`
2024-12-25 10:00:02 +01:00
bors-mailu[bot]
af017047c4 Merge #3691
3691: Ensure mobileconfig has the right content-type r=mergify[bot] a=nextgens

## What type of PR?

bug-fix

## What does this PR do?

Ensure Apple mobileconfig is served using the right Content-Type

### Related issue(s)
- #3684

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
2024-12-22 19:08:52 +00:00
Florent Daigniere
64d0bb603d Ensure mobileconfig has the right content-type 2024-12-22 16:40:44 +01:00
bors-mailu[bot]
6145e6ef72 Merge #3678
3678: alpine3.21.0 r=mergify[bot] a=nextgens

## What type of PR?

enhancement

## What does this PR do?

Upgrade to alpine-3.21.0

### Related issue(s)
- #3677

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [ ] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
2024-12-10 15:46:22 +00:00
Florent Daigniere
d13eae7587 alpine3.21.0 2024-12-08 14:53:16 +01:00
bors-mailu[bot]
92b6a050fc Merge #3650
3650: Don't check empty passwords against HIBP r=mergify[bot] a=nextgens

## What type of PR?

bug-fix

## What does this PR do?

Don't check empty passwords against HIBP; Apparently some password managers will trigger a race condition otherwise

### Related issue(s)
- closes #3633

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
2024-11-17 14:41:50 +00:00
Florent Daigniere
f1c5ac5b14 Don't check empty passwords against HIBP 2024-11-17 14:42:23 +01:00
bors-mailu[bot]
e713fb6723 Merge #3647
3647: upgrade to snuffleupagus v0.11 r=mergify[bot] a=nextgens

## What type of PR?

enhancement

## What does this PR do?

- upgrade snuffleupagus to v0.11
- filter php:// wrapper types and only allow those we currently require (hardening)

### Related issue(s)

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
2024-11-17 12:33:35 +00:00
bors-mailu[bot]
5391692fd9 Merge #3648
3648: Upgrade snappymail to v2.38.2 r=mergify[bot] a=nextgens

## What type of PR?

bug-fix

## What does this PR do?

Upgrade snappymail to v2.38.2. This is a security fix for [GHSA-2rq7-79vp-ffxm](https://github.com/the-djmaze/snappymail/security/advisories/GHSA-2rq7-79vp-ffxm) (mXSS)

### Related issue(s)

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
2024-11-17 12:27:46 +00:00
Florent Daigniere
6f3257f3b2 doh; v2.38.2 2024-11-16 22:48:04 +01:00
Florent Daigniere
d4a3d5aeae Upgrade snappymail to v2.38.2 2024-11-16 22:24:26 +01:00
Florent Daigniere
9a928f8c7b snuffleupagus 11 2024-11-16 22:18:22 +01:00
bors-mailu[bot]
aa52bbb731 Merge #3622
3622: alpine 3.20.3 r=mergify[bot] a=nextgens

## What type of PR?

bug-fix

## What does this PR do?

Upgrade from alpine 3.20.0 to alpine 3.20.3 ; We need a fix for [CVE-2024-5535](https://security.alpinelinux.org/vuln/CVE-2024-5535)

### Related issue(s)


## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
2024-10-21 10:24:20 +00:00
Florent Daigniere
152b45a0e9 alpine 3.20.3 2024-10-21 11:05:01 +02:00
bors-mailu[bot]
e9570020aa Merge #3618
3618: Filter logs line based and in binary mode without decoding utf-8 r=mergify[bot] a=ghostwheel42

## What type of PR?

bug-fix

## What does this PR do?

try at fixing decoding errors when filtering logs

### Related issue(s)
- closes #3398



Co-authored-by: Alexander Graf <ghostwheel42@users.noreply.github.com>
2024-10-17 15:28:54 +00:00
Alexander Graf
f16467b984 Flush buffer on flush() and flush explicitely after subprocess has ended 2024-10-17 16:59:55 +02:00
Alexander Graf
70e28df9c7 Add newsfragment 2024-10-17 16:57:54 +02:00
Alexander Graf
4a49234afa Filter logs line based and in binary mode without decoding utf-8 2024-10-17 15:26:32 +02:00
bors-mailu[bot]
05175b5a3c Merge #3608
3608: Ensure healthchecks timeout r=mergify[bot] a=nextgens

## What type of PR?

bug-fix

## What does this PR do?

Ensure healthchecks timeout

### Related issue(s)
- close #3398
- close #3602

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
2024-10-17 12:48:44 +00:00
bors-mailu[bot]
4ca111964b Merge #3613
3613: Fix http2 r=mergify[bot] a=nextgens

## What type of PR?

bug-fix

## What does this PR do?

Fix http2; it does not require IPv6 nor certificates

### Related issue(s)

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
2024-10-15 19:25:00 +00:00
Florent Daigniere
fb49ef9057 Fix http2 2024-10-15 17:14:22 +02:00
Florent Daigniere
7aaf7ec17b Ensure healthchecks timeout 2024-10-05 18:59:29 +02:00
bors-mailu[bot]
5e7d4edc9d Merge #3558
3558: Only enable HARDENED_MALLOC with kernel 6.1+ r=mergify[bot] a=nextgens

## What type of PR?

enhancement

## What does this PR do?

Disable HARDENED_MALLOC unless the requirements are met

### Related issue(s)
- #3398

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
2024-09-23 09:04:08 +00:00
Florent Daigniere
e3b1b9c1c3 As per #3398 2024-09-22 15:20:09 +02:00
bors-mailu[bot]
a246edf33c Merge #3557
3557: Fix #3531 r=mergify[bot] a=nextgens

## What type of PR?

bug-fix

## What does this PR do?

Ensure we have both RSA and ECDSA certs when using letsencrypt now that the default behaviour from certbot has changed.
This is only important for new installs, not those renewing existing certs.

### Related issue(s)
- closes #3531

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
2024-09-22 13:17:47 +00:00
Florent Daigniere
8e4af5ad05 Fix #3531 2024-09-22 13:14:33 +02:00
bors-mailu[bot]
3e673f9f6b Merge #3465
3465: Maybe fix #3402 r=mergify[bot] a=nextgens

## What type of PR?

bug-fix

## What does this PR do?

Fix a potential problem with SO_REUSEADDR that may prevent admin from starting up

### Related issue(s)
- close #3402 

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
2024-09-13 07:20:12 +00:00
bors-mailu[bot]
520ae56e76 Merge #3468
3468: Need sleep. r=nextgens a=nextgens

## What type of PR?

bug-fix

## What does this PR do?

Fix broken overrides introduced in 2024.06.17

### Related issue(s)
- closes #3467

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
2024-09-12 21:19:53 +00:00
Florent Daigniere
07f0ec3d0b Need sleep. 2024-09-12 23:17:48 +02:00
Florent Daigniere
c11815b3a0 Add delay 2024-09-12 22:48:20 +02:00
bors-mailu[bot]
d54a8044d0 Merge #3466
3466: Improve as per @ghostwheel42's suggestion r=mergify[bot] a=nextgens

Improve #3425 as per review

Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
2024-09-12 20:22:27 +00:00
Florent Daigniere
6745450526 Improve as per @ghostwheel42's suggestion 2024-09-12 19:32:08 +02:00
Florent Daigniere
8b34fbe881 Maybe fix #3402 2024-09-12 19:21:18 +02:00
bors-mailu[bot]
d671abde51 Merge #3463
3463: Fix #3450 r=mergify[bot] a=nextgens

## What type of PR?

bug-fix

## What does this PR do?

Ensure we can do more than 100 parallel sessions.
This will use more RAM.

### Related issue(s)
- close #3450

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
Co-authored-by: Florent Daigniere <nextgens@users.noreply.github.com>
Co-authored-by: Dimitri Huisman <diman@huisman.xyz>
2024-09-12 15:21:29 +00:00
Dimitri Huisman
14a75a101d Fix rst syntax 2024-09-12 14:21:48 +00:00
Florent Daigniere
12e94b7616 As per review 2024-09-12 15:45:58 +02:00
Florent Daigniere
f4ab22edbc play it safe 2024-09-12 12:34:31 +02:00
Florent Daigniere
cdf8ee8820 Apply suggestions from code review
Co-authored-by: Alexander Graf <ghostwheel42@users.noreply.github.com>
2024-09-12 12:30:04 +02:00
Florent Daigniere
c6c4c09f08 doh 2024-09-12 11:08:58 +02:00
Florent Daigniere
a875d7fe6a Fix #3450 2024-09-12 10:43:49 +02:00
bors-mailu[bot]
341afeb57d Merge #3441
3441: Update Czech translation r=mergify[bot] a=kunago

## What type of PR?

Czech translation update

## What does this PR do?

### Related issue(s)
- None

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [x] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: kunago <miris@kunago.com>
2024-09-11 07:36:12 +00:00
kunago
307353107d Update Czech translation 2024-09-10 22:03:37 +02:00
bors-mailu[bot]
ba6d69fbea Merge #3434
3434: Fix #3425 r=mergify[bot] a=nextgens

## What type of PR?

enhancement

## What does this PR do?

Warn if passwords set from the UI contain leading or trailing whitespaces.

Not sure if it's worth backporting it.

### Related issue(s)
-  close #3425

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
2024-09-10 16:42:49 +00:00
Florent Daigniere
fbaf75936a doh 2024-09-10 14:42:35 +02:00
Florent Daigniere
c9e8eeb69a Fix #3425 2024-09-10 11:27:10 +02:00
bors-mailu[bot]
0db6e41c28 Merge #3423
3423: Fix #3411 r=mergify[bot] a=nextgens

## What type of PR?

bug-fix

## What does this PR do?

Ensure we don't nuke all web-sessions when a password is changed.
This was reported with the command line but I suspect the API is affected too.

### Related issue(s)
- close #3411 

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
2024-09-09 17:57:35 +00:00
Florent Daigniere
63769c73cf Fix #3411 2024-09-09 19:25:33 +02:00