Single-URL attributes removed ASCII whitespace and control characters
before looking for a scheme, the list-valued, meta content, style and
comment checks did not, so values="java	script:..." and a tab-split
meta refresh passed. The stripping is factored out as stripURLSpace and
used by every scheme check.
The tokenizer-only walk read noscript, title, textarea, style, xmp and the
other raw-text elements as one text token and never looked inside, so an
unencoded javascript: link in <noscript> or <svg><title> passed the check
and was sent. A mail client renders with scripting off and parses svg
children as markup, so the raw content of those elements, and comment
data (Outlook conditional comments), is now checked again as markup;
nesting deeper than eight levels is refused.
- CR-01 rows for the send path, the decoded scheme check and the admin side;
WR-01 and WR-05 rows with their go test commands
- CR-01 status replaces the open item on the Branding site name
- Manual-Only row for the Branding refusal on sm-demo-app; Wave 0 lists the
three new test files
- the workspace-modfile case copies the planted consumer's go.mod before the
modfile run and compares it after with cmp -s (IN-03)
- drops the git status check on the dirty-sibling fixture, which asserted
against the wrong repository; the replace-line grep stays
- TestMailSiteNameSafety: a javascript: site name is a 422 on site_name in en
and pl and stores nothing; Big Data: Summit and Metadata: Weekly save; the
Branding preview drops an unsafe draft name; a name stored before the check
never refuses a template or layout save or stops a send; a mail.from display
name with a colon shows on the default and system layouts
- the mail screens env reads mail.from from its configuration (default
unchanged), so a mutate hook can set the sender
- check-phase35.sh DOCKER_TESTS requires TestMailSiteNameSafety
- TestURLSchemeCheck: prose and scheme words in titles or queries pass; every
URL-bearing attribute, CSS, meta refresh and each entity-encoded or
whitespace-split script URL is refused with a snippet at the markup; a layout
override with javascript: falls back to the file version with inlining on
and off; the editor refuses it on content_html and CSS URLs on content_css
- TestInlineUnsafeOutput: a failing inlined result sends the style-block
version with one warning per layout
- TestFooterSiteNameLiteral: the footer prints the site name escaped and
literally on the default and system layouts; body stays Markdown
- check-phase35.sh GO_TESTS requires the three tests
- TestSiteNameSend: mail.from "Metadata: Weekly" and Branding "Big Data: Summit"
show in header, footer and text on the default and system layouts, on the
file-version, override and override-failure fallback paths
- TestUnsafeSiteNameDropped: unsafe names are left out on every path with one
value-free warning per source; editor saves and previews are not refused
- TestUnsafeText pins the safe and unsafe texts
- check-phase35.sh GO_TESTS requires them and TestMailSafetySmoke
- the footer partial gains a text argument, printed as a paragraph
through html/template and verbatim in the text part; body stays
Markdown for callers that pass Markdown on purpose
- the default and system layouts pass the copyright line as text, so
*Acme*, Acme <Studio> and [x](url) appear as typed, as in the header
(WR-01)
- README partial table, layouts and Branding paragraphs; docs partials
table and built-in layouts paragraph
- TestMailSafetySmoke/literal_footer
- inlineHTML treats a failing post-inline check like an inliner error:
the un-inlined HTML, which already passed validateHTML, is sent with
its style block and the rate-limited inline:<layout> warning
- mail is never stopped by the inliner, as the docs promise (WR-05)
- README and docs/services/mail.md describe the check before inlining
- TestMailSafetySmoke/inline_unsafe_output
- postcard.UnsafeText: a text a layout prints is unsafe when, escaped,
it fails the rendered-HTML checks or holds a script or data URL at a
scheme boundary ("Big Data: Summit" is safe)
- siteNameFrom/layoutSiteName: an unsafe Branding name falls back to the
mail.from display name, an unsafe one of those gives no name; one
rate-limited warning per source (site_name:branding, site_name:mail.from),
never the value; file version, override, fallback and editor alike
- the Branding preview of an unsafe draft name renders without it
- MailBrandSetting.BeforeValidate: 422 on site_name with
backend::lang.mail.brand.site_name_unsafe (en/pl)
- settings Put localizes a BeforeValidate refusal's phrase keys, as a
controller save does
- TestMailSafetySmoke/unsafe_site_name, TestMailBrandSiteName/unsafe_name_refused
- validateHTML keeps the raw tag and handler regexes and reads the rest
through unsafeMarkup: x/net/html tokenizer, decoded attribute values,
prefix check on URL attributes, whole-value check on CSS, list
attributes, meta content and comments; any on* attribute is refused
- text is not a URL: "Metadata: Weekly" or "Big Data: Summit" as a site
name or body text no longer stops a send (CR-01)
- entity-encoded javascript: is refused whether or not the layout
opts out of inlining (WR-05)
- draft layout CSS is checked as a style element
- fixtures that pinned prose as unsafe now carry markup-level URLs;
the 35-07 subtest pinning an unsafe stored name is removed
- TestMailSafetySmoke prose_site_name and encoded_scheme
Two gap-closure plans confirmed by the user:
- 35-08: URL-scheme check on decoded attribute values instead of the whole
document, unsafe site names dropped at render with a warning and refused
on the Branding form (postcard.UnsafeText), the inlined result never
stops mail, literal site name in the footer (CR-01, WR-01, WR-05)
- 35-09: regression and unit tests, new names required by
check-phase35.sh, IN-03 self-test fix, validation map
- 35-VALIDATION.md: G-35-1 and G-35-8 rows (postcard unit and Postgres,
cabana Postgres, SPA, consumers through scratch modfiles); D-05 and the
default-layout byte-identity rows superseded by the 35-05/35-06 notes;
manual re-runs of UAT tests 1 and 8 (test 8 scoped to the built-in
layouts), a real-inbox check and the deferred plugin follow-up check;
open item: site name not checked for a URL scheme at save time
- 35-UAT.md: closure_note and rerun_scope on G-35-8 (framework part closed,
plugin part deferred); status and results unchanged
- LocaleVariantSwitcher: current flag, option values and locales, the label
through the control id, the query kept on navigation, no navigation for the
open version, selection restored when a guard throws, props updates
- FormView: no switcher with one variant; with unsaved edits switching asks
the unsaved-changes confirm, stays on cancel and opens the sibling on confirm
- check-phase35.sh requires LocaleVariantSwitcher.test.ts (ADMIN_FILES)
- TestMailLocaleGroups: one list row per template, customized locales,
grouped badges and status filter, localeVariants order, labels, states and
current flag, the default version on a fallback row, save then send, reset,
drift through the base file, the file version against the base file,
out-of-group ids, the permission split and locales enabled at run time
- TestMailBrandSiteName: saved trimmed, 255-character limit, preview and send
header, no header row without a name or a logo, current handling of a name
holding a URL scheme
- TestMailLayoutInlineOptOut: the switch on a file layout, reset to the file
value, a custom layout created with the switch off
- check-phase35.sh requires the three names (DOCKER_TESTS)
- TestTemplateBase, TestTemplateFor and TestSendLocaleFallback pin the
<template>-<locale> resolution and the order the override source is asked
- TestEnsureLocaleRows (Postgres): rows only for non-default locales without
files, idempotent, customized content kept while file_hash follows the
base, base_code from SyncIndex, reset of a fallback row, migrations roll back
- TestBuiltinLayoutsLogo, TestHeaderFooterPartials, TestButtonPartial and
TestSiteName cover the finished default, system and minimal layouts
- TestInlineCSS, TestInlineCSSOptOut and TestInlineFailure cover inlining,
the per-layout opt-out and the fallback when the inliner fails
- check-phase35.sh requires the new names (GO_TESTS, DOCKER_TESTS)
- consumers stage runs each core plugin with GOWORK=off, GOPROXY=off and
-mod=mod -modfile=<scratch>/go.mod (its go.sum merged with the framework's),
so the go-premailer requirement resolves without writing the sibling tree
- workspace_check takes the modfile flags; a sibling whose git status
--porcelain prints anything before or after the runs is refused
- self-test: planted dirty repository and a modfile resolving the framework
elsewhere
- C5: the disable_auto_inline_css switch on the CSS tab with its copy;
the CSS comment's inlining is now true
- C12: the site_name row after the logo, the changed logo comment and a
note on the built-in layouts' header and footer, referencing the
decision note that supersedes D-10's inlining claim
- system.htm: the header partial (logo or site name) above the card and
the copyright footer below it; its text wrapper ends with the footer
- brand CSS: the system layout's content cell keeps WinterCMS's 35px
side padding (the 35px 0 override is gone)
- minimal.htm: the logo above the message when logoUrl is set
- TestMailPartialsSmoke/built_in_layouts covers the three layouts and the
inlined brand colour on the button in each
- 35-06 Task 3 (G-35-8)
- github.com/vanng822/go-premailer v1.38.0 (default options) inlines the
rendered HTML after the safety checks; the result is checked again,
HTML without a style element is left as it is, an inliner error sends
the style block only and warns (key inline:<layout>)
- opt-out: layout header key disable_auto_inline_css, the layouts column
of the same name (migration 202611130003), LayoutFile/LayoutOverride/
Draft.DisableAutoInlineCSS; SyncIndex mirrors and ResetOverride restores
the file's value
- cabana layout form switch on the CSS tab, mapped into the layout draft
and the save validation; en/pl copy
- tests: TestMailPartialsSmoke/inline, TestMailEditorSmoke/inline_flag,
the layouts switch in TestMailScreensSmoke; CSS-slot tests read the
style block through a no-op inliner
- 35-06 Task 2 (G-35-8)
- go-premailer pinned at v1.38.0, facts checked, MVS changes and the
indirect modules tidy adds, rejected alternatives
- supersedes D-10's inlining claim and lifts 35-01's default.htm gate;
Branding gains a site name with the mail.from fallback
- STACK.md Supporting Libraries row
- default.htm ports WinterCMS's default layout: wrapper, header row with
the Branding logo (or the site name), the inner-body card and a
copyright footer; its text wrapper ends with the footer
- built-in header and footer partials (logo/body/url, body)
- layouts get siteName (Branding site name, else the display name of
mail.from) and year; Brand.SiteName and migration
202611130002_mail_brand_site_name
- cabana Branding form gets site_name (trimmed, max 255), mapped into the
Branding preview draft; en/pl copy; img.logo brand CSS
- 35-06 Task 1 (G-35-8)
Gap G-35-1 (supersedes D-05; D-06 reset and D-07 drift per locale):
- the templates list keeps one row per template (the base row, or the
lowest variant when only variants ship) with a Customized locales
column (Default, then locale codes, at most three then +N);
- row states and the status filter aggregate over the template's
locale versions; the locale filter is removed;
- a not-customized locale without a file shows the base row's current
subject, body and layout; its info partial says so, its file version
compares with the base file, and Reset returns it to the base file
(postcard.ResetOverride accepts a fallback-locale code);
- copy: mail.template.customized_locales, mail.info_locale_default,
mail.info_locale_fallback (en/pl);
- tests: TestMailScreensSmoke/locales_list, templates and drift updated,
TestMailDrift on the grouped row, TestMailTemplateFilterScopes.
Gap G-35-1 (supersedes D-05), tracer slice:
- postcard: migration 202611130001_mail_template_base_code (base_code
column and index); SyncIndex writes base_code; EnsureLocaleRows creates
the <template>-<locale> rows of locales that ship no file; TemplateBase
and Catalog.TemplateFor; send, preview and validation resolve a missing
<template>-<locale> to the locale's customization, else the base's
customization, else the base file. Names with their own file send as
before.
- cabana: mail locales are the translator's plus the TranslationWriter's
enabled locales; sync ensures the locale rows and re-syncs when the
locale set changes; record lookups admit fallback-locale rows; the
record title is the base code; RecordMeta.LocaleVariants
(RecordLocaleVariant) on the show and update responses.
- admin: LocaleVariantSwitcher in the update form header, from
meta.localeVariants, behind the unsaved-changes confirm.
- tests: TestMailOverrideSmoke/locale_fallback,
TestMailScreensSmoke/locales, LocaleVariantSwitcher.test.ts.
- 35-07: record G-35-8 as framework-closed with the plugin part deferred
(35-VALIDATION.md and a closure note in 35-UAT.md); scope the UAT test 8
re-run to the built-in layouts; deferred plugin follow-up check
- 35-07: TestInlineCSS dangerous-URL fixture injected past save validation
- 35-06: examples/hello go.mod/go.sum in files_modified
- 35-05: T-35-31 wording matches the locale tag rule (pt-BR)
- 35-05/35-06: tracer tasks may land as green sub-commits
Three gap-closure plans confirmed by the user:
- 35-05: one admin record per mail template with a locale switcher (supersedes D-05)
- 35-06: finished built-in layouts, Branding site name, CSS inlining via go-premailer (supersedes D-10's inlining claim)
- 35-07: unit tests for both gaps and a read-only scratch-modfile consumers stage