Release a generated logistics report only when the evidence binds the authenticated account, the intended recipient, and the approved attachment revision. Choose SMS OTP versus email OTP by the assurance required for that login and by measured completion in the intended US and EU populations. A delivery event alone should never authorize an attachment.
TL;DR: For SaaS two-factor login, compare SMS and email codes at the verification boundary, then keep report authorization separate. Neither a valid email signature nor a recorded email open establishes that the right person authenticated or received the attachment. That distinction is the useful starting point for a compliance evidence trail; the channel alone cannot settle security, conversion, or legal suitability.
What can SMS or email OTP prove about a two-factor login?
For this logistics workflow, define completion narrowly: a trusted verifier accepted a challenge for an account and an intended action before its deadline. Treat the resulting record as an input to authorization. An ordinary login challenge should not silently become permission to send a newly generated shipment report to a different address. The release decision needs its own scope.
Keep evidence separate.
A proposed data flow is straightforward: generate a report, assign an immutable revision identifier, approve its destination, and request authentication for that release. The verifier returns a short-lived result bound to the account and release intent. An authorization service compares that result with the approved release, records its decision, and hands an allowed release to the email worker. Subsequent transport events attach to the release record without changing what the authentication evidence means.
DKIM provides a useful boundary here. RFC 6376 describes a signing domain taking responsibility for a message through a verifiable signature. That is evidence about the signed message and signing domain. It does not establish who completed the application's challenge. Email opens have a separate limitation: Mail Privacy Protection can download remote content in the background regardless of engagement. An open therefore cannot serve as an attachment receipt or a successful login. Both distinctions matter when someone later asks why a particular report left the system.
Make the release decision executable
The following TypeScript example runs the decision logic against synthetic logistics data. It deliberately starts after challenge verification; it neither creates an OTP nor sends a message. In deployment, accept verification records only from the trusted verifier, load approvals from authoritative storage, and execute this decision inside the transaction that records the release intent. A caller-supplied object is not authentication evidence.
type Channel = 'sms' | 'email'; type Approval = { releaseId: string; subject: string; recipient: string; reportRevision: string; }; type VerifiedChallenge = { challengeId: string; subject: string; releaseId: string; channel: Channel; expiresAtMs: number; }; type ReleaseRequest = Approval; type Decision = | { allowed: false; reason: string } | { allowed: true; releaseId: string; challengeId: string; channel: Channel; }; function decideRelease( request: ReleaseRequest, approval: Approval, proof: VerifiedChallenge, nowMs: number, ): Decision { if (!Number.isFinite(nowMs) || !Number.isFinite(proof.expiresAtMs) || nowMs >= proof.expiresAtMs) { return { allowed: false, reason: 'expired verification' }; } const sameApproval = request.releaseId === approval.releaseId && request.subject === approval.subject && request.recipient === approval.recipient && request.reportRevision === approval.reportRevision; const sameIntent = proof.subject === approval.subject && proof.releaseId === approval.releaseId; if (!sameApproval || !sameIntent) { return { allowed: false, reason: 'release binding mismatch' }; } return { allowed: true, releaseId: approval.releaseId, challengeId: proof.challengeId, channel: proof.channel, }; } const approved: Approval = { releaseId: 'release-demo-42', subject: 'dispatcher-demo-7', recipient: 'receiving@example.com', reportRevision: 'shipment-report-demo-rev-3', }; const verified: VerifiedChallenge = { challengeId: 'challenge-demo-9', subject: approved.subject, releaseId: approved.releaseId, channel: 'sms', expiresAtMs: 61_000, }; console.log(decideRelease(approved, approved, verified, 1_000)); console.log(decideRelease( { ...approved, reportRevision: 'shipment-report-demo-rev-4' }, approved, verified, 1_000, )); The first call allows the approved revision. The second denies the changed attachment. The timestamps are synthetic milliseconds, and the 60-second interval is an example policy, not a recommended universal lifetime. The revision identifier must resolve to immutable bytes in the real system. Otherwise the identifiers can match while the attachment changes underneath them.
This function is intentionally small. It makes the policy reviewable, but persistence must supply properties that a pure function cannot: challenge consumption, uniqueness of the release intent, and atomic recording of authorization. Without those controls, two workers can both receive an allowed decision and enqueue duplicate sends.
Compare channels at the login boundary
For SMS OTP versus email OTP, start by asking what security property the second step must add to the existing login. Do not assume that two screens constitute two independent factors. Document the enrollment, recovery, and account-access assumptions for each candidate flow, then have the security owner assess the complete flow. The references below do not establish a universal assurance ranking between SMS and email, so an unqualified claim that either is safer would outrun the evidence.
Measure the journey.
For a proposed US and EU trial, record challenge requested, dispatch accepted, verification succeeded, challenge expired, and recovery started. Define conversion as successful verification divided by eligible challenge attempts, with the denominator and retry policy fixed before comparison. Keep country, channel, and flow version available for analysis where the approved privacy policy permits them. Separate user-visible completion time from dispatch latency; an accepted send is only an intermediate event in this measurement plan.
An email open should not enter that conversion numerator. Mail Privacy Protection makes that especially clear, but the architectural rule is broader: only the verifier should emit a verification success. Do not promote an analytics event into authentication evidence merely because it arrives first.
For a small team shipping an LLM-generated report feature, this boundary also controls cost. Generate and approve one immutable artifact for a release; a code retry should not trigger another model invocation. Track generation work, verification attempts, support effort, and attachment dispatch separately. That accounting reveals whether a troublesome flow is consuming tokens or repeated delivery work without turning volatile per-message prices into the selection criterion. No cheapest-channel conclusion is justified without the workload and observed completion data.
Preserve evidence across retries and revisions
The difficult case is an ambiguous send result. A worker can lose its connection after handing off a message, leaving the application uncertain about the outcome. Design the release ledger to retain the original intent and subsequent observations. Mark uncertainty explicitly; do not rewrite it into a confirmed receipt or automatically create a new authorized release. Where the transport supports deduplication, carry the stable release identifier through that boundary and document its scope. Otherwise, define how an operator resolves uncertain outcomes before allowing another attempt.
Consider a synthetic replay test with 2 workers and the approved revision from the example. The first worker records its dispatch attempt, sends the attachment, and loses the response. The second worker finds the same release intent while the first attempt is still unresolved. It must not treat the missing response as a fresh approval, reuse a consumed challenge, or regenerate the report to make progress. Instead, have it append an observation to the existing intent and leave the attachment revision pinned while the designated operator reconciles the transport evidence. If that operator authorizes another attempt, record the decision and connect the new attempt to the original release. This costs some operational effort, but it preserves the distinction between authorization and knowledge of delivery. The test should also inspect the stored attachment reference: if a background generation job has replaced the bytes behind that reference, matching revision strings are meaningless. Pinning immutable bytes is part of the evidence contract, even when the visible report title and shipment identifier haven't changed. None of these test events represents a real customer incident.
A changed report is a different decision. In this design, regenerating the attachment or changing its recipient invalidates the old approval and requires a new release intent. That adds friction, especially if a user corrects a minor report detail just before sending. The trade-off is deliberate: the audit record can identify exactly which approved artifact was eligible for dispatch, rather than associating an authentication event with an evolving document.
Keep the evidence economical. Store the challenge identifier, subject reference, channel, policy version, decision, release identifier, and relevant timestamps under an explicit retention policy. Avoid putting raw codes, report contents, or full email addresses into general application logs. A restricted release record can resolve the recipient when needed; broad operational logs usually need only a correlation identifier. These are proposed minimization controls, not a claim that a particular retention period satisfies every US or EU obligation. Establish those periods with the responsible compliance owner.
DKIM verification results belong alongside message evidence with their actual meaning preserved. Likewise, a successful challenge belongs alongside authentication evidence. Keeping those meanings intact is more valuable than a dashboard that labels every event “delivered.”
Rehearse the release before deployment
Before shipping, exercise the allowed release and the changed-revision rejection from the example. Add cases for an expired verification, a different subject, a changed recipient, and two workers claiming the same intent. At the transport boundary, inject an uncertain outcome and inspect the ledger: it should explain what was authorized, what was attempted, and what remains unknown. Also confirm that application authorization still applies after authentication; a verified account must have permission to access and release the report.
Deploy the policy with a version identifier and keep that version on every decision. Review completion and expiry trends by channel and intended population, inspect duplicate attempts, and sample the evidence chain without copying sensitive attachments into monitoring tools. Assign ownership for recovery and ambiguous sends before enabling automated release. For generated reports, include content approval in that rehearsal so a successful login cannot make an unreviewed artifact eligible for dispatch.
Choose the login channel once its assurance assumptions and measured completion are acceptable. Release the attachment only when its own authorization and evidence chain are complete. That gives a logistics team a defensible account of the action, while leaving delivery observations honest about what they can prove.
References
- RFC 6376: DomainKeys Identified Mail (DKIM). https://datatracker.ietf.org/doc/html/rfc6376
- Mail Privacy Protection guide. https://support.apple.com/guide/iphone/use-mail-privacy-protection-iphf084865c7/ios
