-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace subject with [...] for outgoing mail
`authclean` cleanup server is used by reinjecting smtpd running on localhost:10025 by default. It runs after filtermail and currently removes `Received` header to avoid leaking IP address. Can as well be used to replace `Subject` lines with `Subject: [...]`. If there are multiple `Subject` lines, all of them should be replaced. This allows us to avoid dealing with localized subjects, including SecureJoin messages `vc-request` and `vg-request` which can have Subject lines like Subject: =?utf-8?q?Nachricht_von_nrn178fi4=40nine=2Etestrun=2Eorg?=
- Loading branch information
Showing
5 changed files
with
11 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
SendRateLimiter, | ||
check_armored_payload, | ||
check_encrypted, | ||
common_encrypted_subjects, | ||
is_securejoin, | ||
) | ||
|
||
|
@@ -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): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
/^X-Originating-IP:/ IGNORE | ||
/^X-Mailer:/ IGNORE | ||
/^User-Agent:/ IGNORE | ||
/^Subject:/ REPLACE Subject: [...] |