Skip to content

Reject replies that add recipients who weren't participants of the parent #51

Open

Description

@markmnl

Problem

A reply (a message with pid) can list addresses in to that were never participants of the message it replies to. In practice the receiving host can never deliver it to those recipients:

  • Per the spec ("Protocol Steps" 1.4.6.2.1), a host must hold the parent before it accepts a reply, otherwise it rejects with code 6 (parent not found). A domain the parent was never sent to doesn't hold it.
  • The spec's way to bring someone new into a thread is add-to (POST /fmsg/:id/add-to), which doesn't need the recipient's host to hold the parent.

So such a reply is a client error, and should be refused when it's created, updated or sent, not left for fmsgd to fail on.

Observed

On a deployment, a reply from @mark to the parent's participants plus a new @markmnl@fmsg.org was sent without error. The new recipient's domain has no fmsg.<domain> host at all, so fmsgd keeps retrying it and never delivers.

Send already has a per-domain check (undeliverableReplyDomains, added in #36). It refuses a reply to a remote domain the parent "was never addressed to". It looks like it should have refused this reply, but didn't. Find out why before or as part of this fix. It may be that the parent did have a participant on that domain, or that the check is skipped somehow.

Proposed

Reject a reply whose recipients aren't all participants of the referenced parent:

  • Participants: the parent's from and to. When the reply references an add-to batch by psha256, also that batch's add_to_from and add_to.
  • Where: check on POST /fmsg and PUT /fmsg/:id (drafts) as well as POST /fmsg/:id/send.
  • Response: 400 or 409, listing the offending addresses and pointing to add-to.

This is stricter than the per-domain check. A new address on a domain that does hold the parent would be accepted by its host (that host only checks the sender was a participant). That would still bring someone into the thread outside add-to, so the rule should be per address, not per domain.

Open question

Should the spec itself say this, i.e. a reply's to MUST be a subset of the parent's participants? Today it only requires the reply's from to have been a participant.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions