- resolveLayoutLocked: after the plugin's own alias and the built-in
aliases, a full layout name already in the catalog resolves to itself;
an unregistered full name fails with a require-the-owner hint
- another plugin's short alias and the short-alias error are unchanged
- TestCrossPluginLayout covers register, send, errors and precedence
- postcard README and docs/services/mail.md describe the rule
- unsafeMarkupAt runs the existing HTML reading, then a tag reading in
which attribute quoting alone decides where a tag ends
(NextIsNotRawText after raw-text start tags, comment openers blanked)
- both readings share unsafeAttrs; existing refusals keep their message
and snippet
- svg/style end tag inside a quoted attribute is refused at check, save
and send; README and docs/services/mail.md describe the second reading
scriptURLText took data: followed by any non-space character as a data
URL, so names such as Data:Lab, Big Data:Summit and data:Science were
refused on the Branding form and dropped from mail, contrary to the docs.
A data URL now needs its optional MIME type and the ; or , every data URL
has. javascript: and vbscript: keep matching with whitespace after the
colon, since such a URL still runs.
validateHTML ran (?i)\son[a-z]+\s*= over the rendered document, text
included, so a variable such as "buy one = get one free" stopped its own
message, and it is what made Online=Shop in the footer a send failure.
The tokenizer walk refuses every on* attribute, and since CR-02 it also
reads raw-text element and comment content as markup, so the regex is
dropped. Text shaped like a handler is now sent; such site names are shown
and saved, and the Branding refusal copy no longer mentions onclick=.
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.
- 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
- 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)
- 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.
- Layouts and partials controllers with catalog scoping, reset action and File version diff
- Custom layout create/delete with in-use refusal; meta.deletable and customized/outdated row states
- List schema golden fixtures updated for the two new row-state message keys
Co-authored-by: Cursor <cursoragent@cursor.com>
- Settings -> Mail -> Mail templates in the internal pseudo-plugin when
postcard's Mailer is published; system.manage_mail_templates and
system.manage_mail_layouts registered with no role grants
- MailTemplate/MailLayout models, catalog-scoped list and form, layout
relation over file and custom layouts, no create or delete
- save stamps is_custom, base_hash and customized_at and validates the
override through postcard.Editor inside the save transaction
- serve-start postcard.SyncIndex through lagoon.OnDatabase, retried on
the first mail list request
- copy en/pl, README and docs; TestMailScreensSmoke/templates
Plan 35-02, task 1
- Brand, DefaultBrand and CompileBrandCSS: thirteen colours, each checked
as a six-digit hex colour, compiled into CSS for plain elements and the
built-in layouts and partials
- once the branding row exists its compiled CSS replaces mail.brandCss;
mail.css still follows, and the file version sent after a failing
override keeps the Branding
- layouts get logoUrl, built per send from storage.uploads.public_url or
app.url through attach.AbsolutePublicURL; a logo that cannot be shown is
left out with a rate-limited warning
- Editor previews and validates a Branding draft (rule colour)
Plan 35-01, task 5.
- sample.<path> header keys and a parse-tree walker that fills every other
variable with a visible [path] placeholder, nested fields and range
targets included
- every file entry carries the sha256 of its CRLF-normalized text; the
catalog lists its files (Templates, Layouts, Partials) for admin code
- SyncIndex upserts one index row per file and never touches the override
columns of a customized row; ResetOverride returns a row to its file
- Editor validates, previews and test-sends a template, layout or partial
draft through the render path of Send and reports field and rule
- pact.RowStateCustomized and pact.RowStateOutdated
Plan 35-01, task 4.
- pact.HasMailPartials: plugins declare <plugin>::mail.partials.<name>,
loaded from views/mail/partials/<name>.htm; HasMailTemplates is unchanged
- bodies and layouts call {{ partial "name" "key" value ... }}; a call in a
Markdown body leaves a per-render random token swapped after goldmark, so
raw HTML stays disabled for bodies
- built-in partials button, panel, table and subcopy, built-in layouts
system and minimal next to the unchanged default, reachable by alias
after a plugin's own aliases
- NewDBSource also reads customized and database-only layouts and
customized partials; a layout's CSS goes before mail.css
Plan 35-01, task 3.
- postcard owns the system_mail_* tables (postcard.Migrations), run by lagoon
as the framework set summercms.postcard after system_files
- Send asks an OverrideSource once per message; NewDBSource reads the
customized template row through the *gorm.DB published on the app
- a failed lookup, missing tables or an override that does not render or
fails the safety checks sends the file version and is logged
- the caller's Message.Subject still wins; Mailer, Message, NewMailer,
Catalog.Register and BootPlugin keep their signatures
Plan 35-01, task 2 (tracer).
- docs/database: models, migrations, queries and pagination, relations,
casts and validation, attachments and transactions (lagoon.Transaction,
lagoon.AfterCommit, nested savepoints, lagoon.OnDatabase)
- docs/services: configuration, events, routing with auth groups, rate
limiting, authentication, the OAuth server, mail and localization
- runnable Examples for lagoon, attach, compass, surf, wire, bouncer,
wristband, postcard, phrasebook and festival; lagoon TestDocs* regions
run on the package's Postgres harness through DocsDB
- 15 new required pages