Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace subject with [...] for outgoing mail #481

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
- improve secure-join message detection
([#473](https://github.com/deltachat/chatmail/pull/473))

- replace `Subject` with `[...]` for all outgoing mails.
([#481](https://github.com/deltachat/chatmail/pull/481))

## 1.5.0 2024-12-20

- cmdeploy dns: always show recommended DNS records
Expand Down
59 changes: 0 additions & 59 deletions chatmaild/src/chatmaild/common_encrypted_subjects.py

This file was deleted.

3 changes: 0 additions & 3 deletions chatmaild/src/chatmaild/filtermail.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

from aiosmtpd.controller import Controller

from .common_encrypted_subjects import common_encrypted_subjects
from .config import read_config


Expand Down Expand Up @@ -128,8 +127,6 @@ def check_encrypted(message):
"""
if not message.is_multipart():
return False
if message.get("subject") not in common_encrypted_subjects:
return False
if message.get_content_type() != "multipart/encrypted":
return False
parts_count = 0
Expand Down
20 changes: 7 additions & 13 deletions chatmaild/src/chatmaild/tests/test_filtermail.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
SendRateLimiter,
check_armored_payload,
check_encrypted,
common_encrypted_subjects,
is_securejoin,
)

Expand Down Expand Up @@ -71,18 +70,13 @@ def test_filtermail_securejoin_detection(maildata):


def test_filtermail_encryption_detection(maildata):
for subject in common_encrypted_subjects:
msg = maildata(
"encrypted.eml",
from_addr="[email protected]",
to_addr="[email protected]",
subject=subject,
)
assert check_encrypted(msg)

# if the subject is not a known encrypted subject value, it is not considered ac-encrypted
msg.replace_header("Subject", "Click this link")
assert not check_encrypted(msg)
msg = maildata(
"encrypted.eml",
from_addr="[email protected]",
to_addr="[email protected]",
subject="Subject does not matter, will be replaced anyway",
)
assert check_encrypted(msg)


def test_filtermail_no_literal_packets(maildata):
Expand Down
1 change: 1 addition & 0 deletions cmdeploy/src/cmdeploy/postfix/submission_header_cleanup
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/^X-Originating-IP:/ IGNORE
/^X-Mailer:/ IGNORE
/^User-Agent:/ IGNORE
/^Subject:/ REPLACE Subject: [...]