mirror of
https://github.com/chatmail/relay.git
synced 2026-09-27 17:50:10 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c8d66561b |
@@ -75,6 +75,7 @@ http {
|
||||
server_name {{ config.mail_domain }} mta-sts.{{ config.mail_domain }};
|
||||
|
||||
location /mxdeliv {
|
||||
client_max_body_size {{ config.max_message_size }};
|
||||
proxy_pass http://127.0.0.1:{{ config.filtermail_http_port_incoming }};
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import subprocess
|
||||
import time
|
||||
|
||||
import pytest
|
||||
import requests
|
||||
from chatmaild.config import is_valid_ipv4
|
||||
|
||||
from cmdeploy import remote
|
||||
@@ -326,3 +327,14 @@ def test_nginx_access_log_only_defined_once(sshdomain):
|
||||
assert len(access_logs) == 1, (
|
||||
f"expected 1 access_log, found {len(access_logs)}: {access_logs}"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.filterwarnings("ignore::urllib3.exceptions.InsecureRequestWarning")
|
||||
def test_mxdeliv_respects_max_message_size(maildomain, chatmail_config):
|
||||
url = f"https://{maildomain}/mxdeliv"
|
||||
verify = chatmail_config.tls_cert_mode == "acme"
|
||||
size = chatmail_config.max_message_size
|
||||
res = requests.post(url, data=b"x" * size, verify=verify)
|
||||
assert res.text == "500 Invalid DATA"
|
||||
res = requests.post(url, data=b"x" * (size + 1), verify=verify)
|
||||
assert res.status_code == 413
|
||||
|
||||
Reference in New Issue
Block a user