Repository navigation
fix(mails): use spam-safe characters for email preview padding - #14111
Conversation
🟢 Tier S · Ready to mergeThe Mails and Notifications workers use zero-width non-joiner and non-breaking-space pairs to pad email previews toward 150 characters, measured with Latest changes: The newest commit replaces the regex-based direction-mark check with separate case-insensitive absence assertions for U+200E and U+200F entities.
📂 Walkthrough · 3
Reviewed the commits since |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Each padding unit is two characters, so repeating it once per missing character doubled the hidden run. Count characters with mb_strlen so non-ASCII previews are measured correctly.
…b.com/appwrite/appwrite into fix/email-preview-padding-hidden-text
… marks The delivered recovery email must pad its preview with zero-width non-joiner and no-break space pairs, never U+200E/U+200F.
Security rulesNo new WARNING or ERROR findings from security rules. 6 existing findings tracked in
|
…ding-hidden-text fix(mails): use spam-safe characters for email preview padding (cherry picked from commit 6093453)
The Mails and Notifications workers pad the hidden preview with a 7-character group that includes U+200E/U+200F. rspamd ignores whitespace, NBSP and U+200B-U+200D/U+FEFF as preview padding, but counts the direction marks as hidden text. The group was also repeated once per missing character, so a 42-character preview got 756 invisible characters instead of padding to 150. That's over 200 counted characters, so
HIDDEN_TEXT(+2.51) andMANY_INVISIBLE_PARTSfire on every auth email.This changes the padding unit to
‌ , a common preheader pattern, and repeats it only enough to reach 150 characters, counted withmb_strlenso non-ASCII previews are measured correctly. The{{previewWhitespace}}placeholder stays, so custom base templates keep working.Verification: I rendered the recovery email through the real
Mailsworker action into a local SMTP sink, then scored it withrspamc(rspamd 4.2.1 image).email-base: 4.32 with HIDDEN_TEXT 2.51 before, 1.48 with no HIDDEN_TEXT after the character changeemail-base-styled: 3.23 before, 0.29 afterR_PARTS_DIFFERfrom 0.57 to 0.31 (styled: 0.38 to 0.07).Fixes #14089