Mail relay: review round 2 — the store is keyed by host, a copied database does not enrol by itself
- Q-1 one entry per host (iapl:mail-relay:site:<host>); a read never deletes or writes; another host's
entry is neither used nor touched (a developer's process on the live database, www and apex, a copy)
- a database that holds another host's connection and none of this site's does not enrol by itself:
"Connect again" does, once; mail.relay.otherHosts ('wait' | 'enrol' | the site's own other hosts);
panel text and doctor finding; a site with an empty store enrols by itself as before
- Q-2 the file limit answers from what is stored and never asks the service
- Q-3 a file whose mail was not confirmed is not reported as a wrong file, and no notice mail follows
- Q-4 its own text when the access-key field is off
- D-1 docs for open enrolment; staging, copies and several hosts
Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
edee3a321f
commit
85ed92bb89
@@ -13,6 +13,7 @@ export const NOTIFICATION_FALLBACK: NotificationTexts = {
|
||||
consent: 'Accept the privacy policy to send the form.',
|
||||
error: 'The form could not be sent. Please try again in a moment.',
|
||||
fileCount: 'Too many files in "{field}". Remove some: the limit is {max}.',
|
||||
fileNotConfirmed: 'We have your message, but we could not confirm that the file "{file}" was delivered. Please do not send it again: we will ask you for it if needed.',
|
||||
fileNotSent: 'We could not send the file "{file}". Choose a smaller file or another format and try again.',
|
||||
fileOptional: 'You can also send the form without the file.',
|
||||
fileRefused: 'The file "{file}" was refused: it is a program or an archive, it holds macros, or its content does not match its type. Choose another file ({types}).',
|
||||
@@ -37,6 +38,7 @@ export const NOTIFICATION_FALLBACK_PL: NotificationTexts = {
|
||||
consent: 'Zaakceptuj politykę prywatności, aby wysłać formularz.',
|
||||
error: 'Nie udało się wysłać formularza. Spróbuj ponownie za chwilę.',
|
||||
fileCount: 'Za dużo plików w polu „{field}”. Usuń część: limit to {max}.',
|
||||
fileNotConfirmed: 'Mamy Twoją wiadomość, ale nie udało się potwierdzić dostarczenia pliku „{file}”. Nie wysyłaj go ponownie: w razie potrzeby poprosimy o niego.',
|
||||
fileNotSent: 'Nie udało się wysłać pliku „{file}”. Wybierz mniejszy plik lub inny format i spróbuj ponownie.',
|
||||
fileOptional: 'Możesz też wysłać formularz bez pliku.',
|
||||
fileRefused: 'Plik „{file}” został odrzucony: to program lub archiwum, zawiera makra albo jego zawartość nie odpowiada typowi. Wybierz inny plik ({types}).',
|
||||
|
||||
@@ -33,6 +33,7 @@ export async function getNotificationTexts({
|
||||
consent: f.consent || fb.consent,
|
||||
error: f.error || fb.error,
|
||||
fileCount: f.fileCount || fb.fileCount,
|
||||
fileNotConfirmed: fb.fileNotConfirmed,
|
||||
fileNotSent: f.fileNotSent || fb.fileNotSent,
|
||||
fileOptional: f.fileOptional || fb.fileOptional,
|
||||
fileRefused: f.fileRefused || fb.fileRefused,
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { FormNotificationTexts } from './types.js'
|
||||
* The texts resolveFormMessage needs. The File-field texts are optional, so an
|
||||
* object written before they existed still fits (the field or general text is used).
|
||||
*/
|
||||
type FileTextKey = 'fileCount' | 'fileNotSent' | 'fileOptional' | 'fileRefused' | 'fileRemove' | 'fileTooLarge' | 'fileType'
|
||||
type FileTextKey = 'fileCount' | 'fileNotConfirmed' | 'fileNotSent' | 'fileOptional' | 'fileRefused' | 'fileRemove' | 'fileTooLarge' | 'fileType'
|
||||
export type FormMessageTexts = { [K in FileTextKey]?: string } & Omit<FormNotificationTexts, FileTextKey>
|
||||
|
||||
/** The texts of the File field problems, by result code. */
|
||||
@@ -34,6 +34,8 @@ export function resolveFormMessage(result: SubmitFormResult, texts: FormMessageT
|
||||
case 'consent':
|
||||
return texts.consent
|
||||
case 'delivery': {
|
||||
// The mail service did not answer: the file may be out, and the submission is stored — never "try again".
|
||||
if (result.unconfirmed && texts.fileNotConfirmed) {return texts.fileNotConfirmed.replace('{file}', result.file ?? '')}
|
||||
// The file could not be e-mailed: say it is the file (at its field), never the mail server's own words.
|
||||
if (!texts.fileNotSent) {return texts.error}
|
||||
return withoutFile(texts.fileNotSent.replace('{file}', result.file ?? ''), result.optional, texts)
|
||||
|
||||
@@ -12,6 +12,12 @@ export type FormNotificationTexts = {
|
||||
error: string
|
||||
/** File field: too many files, with {field} and {max}. */
|
||||
fileCount: string
|
||||
/**
|
||||
* File field: the mail service gave no answer, so the file may or may not have been delivered — the
|
||||
* submission itself is stored. Must not ask the visitor to send again. Not a panel field (no schema
|
||||
* change): the plugin's text per language; a project overrides it in the texts it passes on.
|
||||
*/
|
||||
fileNotConfirmed: string
|
||||
/** File field: the e-mail with the file could not be sent — with {file}; the visitor has to send it again. */
|
||||
fileNotSent: string
|
||||
/** File field: added to a file message when the field is not required ("…send the form without the file"). */
|
||||
|
||||
Reference in New Issue
Block a user