--- spec: openflange.org/pipe/v0.1 id: validate-email version: 0.1.0 title: Validate email description: Splits records into valid and rejected by their `email` member; optionally reports counts. A multi-port Go executable. license: Apache-2.0 keywords: [go, email, validation, multi-port, executable, example] maturity: experimental scope: record deterministic: true inputs: records: kind: records description: 'Records with an `email` member, e.g. {"id": 1, "email": "alice@example.com"}.' outputs: valid: kind: records description: Records whose `email` is a plausible address, unchanged and in order. rejected: kind: records description: 'The other records, as {"record", "reason"}. Required: connect it or discard it explicitly.' schema: format: json-schema definition: type: object required: [record, reason] properties: reason: {type: string} stats: kind: records required: false description: 'One record at the end of the stream: {"total", "valid", "rejected"}.' schema: format: json-schema definition: type: object required: [total, valid, rejected] implementation: type: executable command: ["./bin/validate-email"] stdin: records stdout: valid permissions: subprocess: true --- # Validate email Implements the [OpenFlange](https://openflange.org/) specification. A pipe with **one input and three outputs**, implemented as a small Go program ([`main.go`](main.go), standard library only) that speaks the CLI protocol: `records` on stdin, `valid` on stdout, and `rejected` and `stats` POSTed to authenticated loopback endpoints named in the `OPENFLANGE_CONFIG` file. See [README.md](README.md) for input → command → output. - An address is valid when it is a string with exactly one `@`, a non-empty local part, a non-empty domain and no whitespace. This is a plausibility check, not proof that the mailbox exists. - Valid records are passed through byte for byte (numbers keep every digit). - A line that is not JSON fails the run (the runner reports `E_FORMAT`): that is a broken stream, not a bad record. - `rejected` is a **required** output; `stats` is optional and costs nothing when it is not connected. - Build the binary first: `go build -o examples/go-multiport-validate/bin/validate-email ./examples/go-multiport-validate`. Permissions: `subprocess`. No network beyond the runner's own loopback endpoints, no files, no secrets. A subprocess is not a sandbox.