diff --git a/backend/routers/emails.py b/backend/routers/emails.py index 45dff23..3b96d8c 100644 --- a/backend/routers/emails.py +++ b/backend/routers/emails.py @@ -73,7 +73,7 @@ TRACKERS = re.compile(r"^https?://[\w-]+\.email\.openai\.com/", re.I) INVOICE_ANCHOR = re.compile(r']*href="([^"]+)"[^>]*>(?:(?!).){0,300}?(?:invoice|rechnung|receipt)', re.I | re.S) PORTAL_HINT = re.compile( r"in ihrem (kunden)?(konto|portal)|im (kunden)?portal|your account|sign in|log ?in|anmelden|einloggen|" - r"view (your )?(invoice|receipt|bill)|rechnung (ist )?(verfügbar|bereit)|invoice is available|zahlungsbeleg", + r"view (your )?(invoice|receipt|bill)|rechnung (ist )?(verfügbar|bereit)|invoice is available|zahlungsbeleg|das ist keine rechnung", # Meta: Beleg ohne PDF, Rechnung nur im Billing Hub re.I, ) diff --git a/backend/tests/test_classify.py b/backend/tests/test_classify.py index 3629fc1..85b2ee1 100644 --- a/backend/tests/test_classify.py +++ b/backend/tests/test_classify.py @@ -18,6 +18,7 @@ def test_classify(): aws = "Content-Type: text/plain\n\nYour bill: https://console.aws.amazon.com/billing/home#/bills" assert classify_mail(_m(aws)) == ("portal", None) assert classify_mail(_m("Content-Type: text/plain\n\nIhr Zahlungsbeleg liegt bereit."))[0] == "portal" + assert classify_mail(_m("Content-Type: text/html\n\n

Das ist keine Rechnung

Transaktions-ID 1"))[0] == "portal" # Meta # http (kein TLS) wird nie direkt geladen assert classify_mail(_m("Content-Type: text/plain\n\nRechnung http://x.example/r.pdf"))[0] == "portal" # HTML-Entities im Link werden aufgelöst