mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-16 09:45:24 -04:00
fix: signature learning never skips support@/info@/admin@ senders (#1773)
This commit is contained in:
+12
-6
@@ -956,6 +956,17 @@ async def action_mark_email_boundaries(owner: str, **kwargs) -> Tuple[str, bool]
|
||||
return str(e), False
|
||||
|
||||
|
||||
# Sender local-parts (matched exactly or by prefix) whose mail never carries a
|
||||
# personal signature worth learning. These compare against the local-part
|
||||
# (before "@"), so role names must NOT include a trailing "@" — "support@" etc.
|
||||
# could never match a local-part of "support" and were silently dead.
|
||||
_SIG_SKIP_PREFIXES = (
|
||||
"noreply", "no-reply", "donotreply", "do-not-reply",
|
||||
"mailer-daemon", "notifications", "notification", "bounce",
|
||||
"newsletter", "support", "info", "admin",
|
||||
)
|
||||
|
||||
|
||||
async def action_learn_sender_signatures(owner: str, **kwargs) -> Tuple[str, bool]:
|
||||
"""For each sender with ≥3 recent inbox emails, ask the LLM to extract
|
||||
the common signature block across their messages. The cached sig is
|
||||
@@ -1013,16 +1024,11 @@ async def action_learn_sender_signatures(owner: str, **kwargs) -> Tuple[str, boo
|
||||
return "No emails to scan", True
|
||||
|
||||
# 2. Group by sender; drop addresses that don't carry useful sigs.
|
||||
SKIP_PREFIXES = (
|
||||
"noreply", "no-reply", "donotreply", "do-not-reply",
|
||||
"mailer-daemon", "notifications", "notification", "bounce",
|
||||
"newsletter", "support@", "info@", "admin@",
|
||||
)
|
||||
by_sender: dict[str, list[dict]] = {}
|
||||
for m in mails:
|
||||
addr = m["from_address"]
|
||||
local = addr.split("@", 1)[0]
|
||||
if any(local == p or local.startswith(p) for p in SKIP_PREFIXES):
|
||||
if any(local == p or local.startswith(p) for p in _SIG_SKIP_PREFIXES):
|
||||
continue
|
||||
# Skip plus-aliases / list-style addresses too.
|
||||
if "+" in local or "-noreply" in addr or "-bounces" in addr:
|
||||
|
||||
Reference in New Issue
Block a user