/** * Org default inbound policy: every email domain accepts inbound mail via * catch-all store with bounded retention, so replies to platform-sent mail * are never bounced by omission. Explicit SmartMTA routes always outrank * this no-route fallback; explicit per-domain policies are preserved. */ export interface IInboundPolicyLike { defaultAction: 'store' | 'reject'; retentionDays: number; } export const DEFAULT_INBOUND_POLICY: IInboundPolicyLike = Object.freeze({ defaultAction: 'store', retentionDays: 30, }); export function applyDefaultInboundPolicy( domainsArg: T[] | undefined, ): T[] { return (domainsArg || []).map((domain) => ({ ...domain, inboundPolicy: domain.inboundPolicy ?? { ...DEFAULT_INBOUND_POLICY }, })); }