mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
Add additional known obscured subjects from k-9/thunderbird-android.
These additional subjects were extracted from the thunderbird-android source (which is inherited from k-9). The extraction was done with: ``` git clone https://github.com/thunderbird/thunderbird-android/ cd thunderbird-android/legacy/ui/legacy/src/main/res grep string\ name=\"encrypted_subject values-*/strings.xml | cut -f2 -d'>' | cut -f1 -d'<' | sort -u | sed -e 's/^/ "/' -e 's/$/",/' ``` (i did need to clean up one line's escaping to pass the linter's expectations) See also https://github.com/thunderbird/thunderbird-android/issues/8011
This commit is contained in:
committed by
holger krekel
parent
24843abed3
commit
5b05e0194f
@@ -14,6 +14,64 @@ from aiosmtpd.controller import Controller
|
|||||||
|
|
||||||
from .config import read_config
|
from .config import read_config
|
||||||
|
|
||||||
|
"""Generated from deltachat, draft-ietf-lamps-header-protection, and
|
||||||
|
encrypted_subject localizations in
|
||||||
|
https://github.com/thunderbird/thunderbird-android/
|
||||||
|
"""
|
||||||
|
common_encrypted_subjects = {
|
||||||
|
"...",
|
||||||
|
"[...]",
|
||||||
|
"암호화된 메시지",
|
||||||
|
"Ĉifrita mesaĝo",
|
||||||
|
"Courriel chiffré",
|
||||||
|
"Dulrituð skilaboð",
|
||||||
|
"Encrypted Message",
|
||||||
|
"Fersifere berjocht",
|
||||||
|
"Kemennadenn enrineget",
|
||||||
|
"Krüptitud kiri",
|
||||||
|
"Krypterat meddelande",
|
||||||
|
"Krypteret besked",
|
||||||
|
"Kryptert melding",
|
||||||
|
"Mensagem criptografada",
|
||||||
|
"Mensagem encriptada",
|
||||||
|
"Mensaje cifrado",
|
||||||
|
"Mensaxe cifrada",
|
||||||
|
"Mesaj Criptat",
|
||||||
|
"Mesazh i Fshehtëzuar",
|
||||||
|
"Messaggio criptato",
|
||||||
|
"Messaghju cifratu",
|
||||||
|
"Missatge encriptat",
|
||||||
|
"Neges wedi'i Hamgryptio",
|
||||||
|
"Pesan terenkripsi",
|
||||||
|
"Salattu viesti",
|
||||||
|
"Şifreli İleti",
|
||||||
|
"Šifrēta ziņa",
|
||||||
|
"Šifrirana poruka",
|
||||||
|
"Šifrirano sporočilo",
|
||||||
|
"Šifruotas laiškas",
|
||||||
|
"Tin nhắn được mã hóa",
|
||||||
|
"Titkosított üzenet",
|
||||||
|
"Verschlüsselte Nachricht",
|
||||||
|
"Versleuteld bericht",
|
||||||
|
"Zašifrovaná zpráva",
|
||||||
|
"Zaszyfrowana wiadomość",
|
||||||
|
"Zifratu mezua",
|
||||||
|
"Κρυπτογραφημένο μήνυμα",
|
||||||
|
"Зашифроване повідомлення",
|
||||||
|
"Зашифрованное сообщение",
|
||||||
|
"Зашыфраваны ліст",
|
||||||
|
"Криптирано съобщение",
|
||||||
|
"Шифрована порука",
|
||||||
|
"დაშიფრული წერილი",
|
||||||
|
"הודעה מוצפנת",
|
||||||
|
"پیام رمزنگاریشده",
|
||||||
|
"رسالة مشفّرة",
|
||||||
|
"എൻക്രിപ്റ്റുചെയ്ത സന്ദേശം",
|
||||||
|
"加密邮件",
|
||||||
|
"已加密的訊息",
|
||||||
|
"暗号化されたメッセージ",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def check_openpgp_payload(payload: bytes):
|
def check_openpgp_payload(payload: bytes):
|
||||||
"""Checks the OpenPGP payload.
|
"""Checks the OpenPGP payload.
|
||||||
@@ -111,7 +169,7 @@ def check_encrypted(message):
|
|||||||
"""
|
"""
|
||||||
if not message.is_multipart():
|
if not message.is_multipart():
|
||||||
return False
|
return False
|
||||||
if message.get("subject") not in {"...", "[...]"}:
|
if message.get("subject") not in common_encrypted_subjects:
|
||||||
return False
|
return False
|
||||||
if message.get_content_type() != "multipart/encrypted":
|
if message.get_content_type() != "multipart/encrypted":
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ from chatmaild.filtermail import (
|
|||||||
SendRateLimiter,
|
SendRateLimiter,
|
||||||
check_armored_payload,
|
check_armored_payload,
|
||||||
check_encrypted,
|
check_encrypted,
|
||||||
|
common_encrypted_subjects,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -54,7 +55,7 @@ def test_filtermail_no_encryption_detection(maildata):
|
|||||||
|
|
||||||
|
|
||||||
def test_filtermail_encryption_detection(maildata):
|
def test_filtermail_encryption_detection(maildata):
|
||||||
for subject in ("...", "[...]"):
|
for subject in common_encrypted_subjects:
|
||||||
msg = maildata(
|
msg = maildata(
|
||||||
"encrypted.eml",
|
"encrypted.eml",
|
||||||
from_addr="1@example.org",
|
from_addr="1@example.org",
|
||||||
|
|||||||
Reference in New Issue
Block a user