From 3f64f8caeffd4ad02ce97741fe3545d4c832f577 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Wed, 13 May 2026 22:47:40 +0200 Subject: [PATCH] try stripping subject from stored messages --- .../src/cmdeploy/postfix/lmtp_header_cleanup | 1 - .../src/cmdeploy/tests/online/test_1_basic.py | 20 ------------------- 2 files changed, 21 deletions(-) diff --git a/cmdeploy/src/cmdeploy/postfix/lmtp_header_cleanup b/cmdeploy/src/cmdeploy/postfix/lmtp_header_cleanup index 626ba45f..6c36a2a9 100644 --- a/cmdeploy/src/cmdeploy/postfix/lmtp_header_cleanup +++ b/cmdeploy/src/cmdeploy/postfix/lmtp_header_cleanup @@ -2,5 +2,4 @@ /^Message-Id:/ DUNNO /^Chat-Is-Post-Message:/ DUNNO /^Content-Type:/ DUNNO -/^Subject:/ DUNNO /.*/ IGNORE diff --git a/cmdeploy/src/cmdeploy/tests/online/test_1_basic.py b/cmdeploy/src/cmdeploy/tests/online/test_1_basic.py index 9a32ef7a..fe2a2c85 100644 --- a/cmdeploy/src/cmdeploy/tests/online/test_1_basic.py +++ b/cmdeploy/src/cmdeploy/tests/online/test_1_basic.py @@ -232,26 +232,6 @@ def try_n_times(n, f): return f() -def test_rewrite_subject(cmsetup, maildata): - """Test that subject gets replaced with [...].""" - user1, user2 = cmsetup.gen_users(2) - - sent_msg = maildata( - "encrypted.eml", - from_addr=user1.addr, - to_addr=user2.addr, - subject="Unencrypted subject", - ).as_string() - user1.smtp.sendmail(from_addr=user1.addr, to_addrs=[user2.addr], msg=sent_msg) - - # The message may need some time to get delivered by postfix. - messages = try_n_times(5, user2.imap.fetch_all_messages) - assert len(messages) == 1 - rcvd_msg = messages[0] - assert "Subject: [...]" not in sent_msg - assert "Subject: [...]" in rcvd_msg - assert "Subject: Unencrypted subject" in sent_msg - assert "Subject: Unencrypted subject" not in rcvd_msg def test_exceed_rate_limit(cmsetup, gencreds, maildata, chatmail_config):