refactor(email): use _remember_processed_uid in SPF/DKIM reject paths

Replaces inline dedup logic with the existing helper to match the
style of _is_self_address and other reject branches, and to keep the
_processed_uids eviction logic in one place.
This commit is contained in:
chengyongru 2026-04-20 14:50:44 +08:00 committed by Xubin Ren
parent ffac8d3b0a
commit ecfbb0ed4f

View File

@ -395,10 +395,7 @@ class EmailChannel(BaseChannel):
"(no 'spf=pass' in Authentication-Results header)", "(no 'spf=pass' in Authentication-Results header)",
sender, sender,
) )
if uid: self._remember_processed_uid(uid, dedupe, cycle_uids)
cycle_uids.add(uid)
if dedupe:
self._processed_uids.add(uid)
continue continue
if self.config.verify_dkim and not dkim_pass: if self.config.verify_dkim and not dkim_pass:
logger.warning( logger.warning(
@ -406,10 +403,7 @@ class EmailChannel(BaseChannel):
"(no 'dkim=pass' in Authentication-Results header)", "(no 'dkim=pass' in Authentication-Results header)",
sender, sender,
) )
if uid: self._remember_processed_uid(uid, dedupe, cycle_uids)
cycle_uids.add(uid)
if dedupe:
self._processed_uids.add(uid)
continue continue
subject = self._decode_header_value(parsed.get("Subject", "")) subject = self._decode_header_value(parsed.get("Subject", ""))