diff --git a/.build/Dockerfile b/.build/Dockerfile new file mode 100644 index 0000000..194a3c6 --- /dev/null +++ b/.build/Dockerfile @@ -0,0 +1,21 @@ +# Copyright 2026 Beacon Contributors +# SPDX-License-Identifier: AGPL-3.0-or-later + +FROM golang:1.26-alpine AS builder +ARG VERSION=dev +WORKDIR /app +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +RUN CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=${VERSION}" -o beacon-push ./cmd/beacon-push + +FROM alpine:3.24 +RUN apk add --no-cache ca-certificates tzdata \ + && addgroup -S -g 10001 push && adduser -S -D -H -u 10001 -G push push \ + && mkdir -p /data && chown push:push /data +COPY --from=builder /app/beacon-push /usr/local/bin/beacon-push +USER push +VOLUME /data +EXPOSE 8080 +HEALTHCHECK --interval=30s --timeout=5s --start-period=10s CMD ["beacon-push", "healthcheck"] +CMD ["beacon-push"] diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e098b03 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +.git +.github +.claude +docs/superpowers +*.db +*.db-* +.env +.env.* +*.p8 diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..1866a30 --- /dev/null +++ b/.env.example @@ -0,0 +1,35 @@ +# beacon-push settings. Copy to .env next to the compose file; never commit the real one. + +# Where operators and the app reach the relay. Every mailed link is built from it. +PUSH_PUBLIC_URL=https://push.meshcorebeacon.ca + +# Listen address inside the container, and the SQLite file (keep /data on a volume and back it up). +# PUSH_LISTEN_ADDR=:8080 +# PUSH_DATABASE_PATH=/data/beacon-push.db + +# In-container path of the Firebase service-account key file, for Android (mount it read-only). +PUSH_FIREBASE_CREDENTIALS=/run/secrets/firebase.json + +# APNs auth key for iOS: in-container path of the .p8 file (mount it read-only), its 10-character key ID, +# the Apple team ID and the app's bundle ID. +PUSH_APNS_KEY=/run/secrets/apns.p8 +PUSH_APNS_KEY_ID= +PUSH_APNS_TEAM_ID= +PUSH_APNS_TOPIC=meshcorebeacon.app + +# Outgoing mail for registration links and admin notices. +PUSH_SMTP_HOST= +# PUSH_SMTP_PORT=587 +PUSH_SMTP_USERNAME= +PUSH_SMTP_PASSWORD= +PUSH_SMTP_FROM="Beacon Push " +# PUSH_SMTP_STARTTLS=true + +# Gets a mail for every new server, automatic suspensions and lost domain verifications. Empty sends none. +PUSH_ADMIN_EMAIL=abuse@meshcorebeacon.ca + +# True behind Caddy: the client address is taken from the last X-Forwarded-For entry. +PUSH_TRUST_PROXY=true + +# Logs mail and pushes instead of sending them, and lets the domain check reach local addresses. Never in production. +# PUSH_DEV_MODE=false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e067f21 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +# Copyright 2026 Beacon Contributors +# SPDX-License-Identifier: AGPL-3.0-or-later +name: CI + +on: + push: + branches: [main, dev] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + + - name: Build + run: go build ./... + + - name: Format check + run: | + if [ -n "$(gofmt -l .)" ]; then + echo "The following files are not formatted:" + gofmt -l . + exit 1 + fi + + - name: Vet + run: go vet ./... + + - name: Test + run: go test -race ./... diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..53e7c2a --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,61 @@ +# Copyright 2026 Beacon Contributors +# SPDX-License-Identifier: AGPL-3.0-or-later + +name: Build and Publish Docker Image + +on: + push: + branches: [main, dev] + tags: ["v*"] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + labels: | + org.opencontainers.image.title=beacon-push + org.opencontainers.image.description=Beacon push relay: delivers alerts from self-hosted Beacon servers to the Beacon app + org.opencontainers.image.licenses=AGPL-3.0-or-later + flavor: | + latest=false + tags: | + type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} + type=raw,value=dev,enable=${{ github.ref == 'refs/heads/dev' }} + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=sha + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + file: .build/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + VERSION=${{ github.ref_name }} diff --git a/.gitignore b/.gitignore index 2eeb55a..1cf3855 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ build/ dist/ /beacon-push -# Environment and local config (Firebase key, SMTP and instance credentials) +# Environment and local config (Firebase and APNs keys, SMTP and instance credentials) .env .env.* !.env.example @@ -11,6 +11,7 @@ config.yaml config.local.* *-firebase-adminsdk-*.json service-account*.json +*.p8 # Data *.db diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fe01772..a23d99d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,8 @@ write conventional commit messages, and open the PR against `dev`. ## What the relay does beacon-push accepts notifications from registered beacon-server instances and -forwards them to the Beacon app through Firebase Cloud Messaging. It handles +forwards them to the Beacon app through APNs (iOS) and Firebase Cloud +Messaging (Android). It handles server registration, device handles, rate limits and abuse reports. Rule matching and notification content belong in [beacon-server](https://github.com/MeshCore-Beacon/beacon-server), not here. @@ -32,7 +33,7 @@ Keep in mind when contributing: - **The relay must not read content.** Payloads are encrypted between beacon-server and the app. Do not add logging, parsing or storage of payload bodies. -- **Credentials are secrets.** The Firebase key, SMTP password and instance +- **Credentials are secrets.** The Firebase and APNs keys, SMTP password and instance secrets come from the environment, never from source, logs or responses. Instance secrets are stored hashed. - **Keep usage records minimal.** Log what abuse tracking needs (server, time, diff --git a/README.md b/README.md index 2f03231..e2f09f8 100644 --- a/README.md +++ b/README.md @@ -4,41 +4,272 @@ Push notification relay for self-hosted Beacon servers. Apple and Google only let an app's publisher send it push notifications, so a self-hosted [beacon-server](https://github.com/MeshCore-Beacon/beacon-server) cannot reach the Beacon mobile app directly. beacon-push is the small service the Beacon -project runs at `push.meshcorebeacon.ca` that does it for them. - -> Early development. Nothing here is ready to deploy yet. +project runs at `https://push.meshcorebeacon.ca` that does it for them. Every +server, the project's own included, sends its push alerts through it. ## How it fits ``` -beacon-server ──HTTPS──> beacon-push ──FCM──> phone (iOS and Android) +beacon-server ──HTTPS──> beacon-push ──APNs──> iPhone + └──FCM───> Android phone ``` -1. A server operator registers their server with the relay and gets an - instance ID and secret. -2. The operator turns push on in their beacon-server config. It is off by - default. -3. The Beacon app gets a device handle from the relay that only works for the - server it registered with, and gives that handle to the server. -4. When an event matches a user's alert rules, beacon-server sends an - encrypted notification to the relay, which forwards it through Firebase - Cloud Messaging. +1. A server operator registers at `https://push.meshcorebeacon.ca/register` + and gets a **Push ID** and a **Push secret**. +2. The operator turns push on in beacon-server's config + (`alerts.push.enabled`, `alerts.push.id`, and `BEACON_PUSH_SECRET`). +3. The Beacon app gets a device handle from the relay that only works for that + server, and gives the handle to the server. +4. When an alert fires, beacon-server encrypts it for that device and sends + it to the relay, which forwards it straight to Apple's push service (APNs) + for an iPhone, or through Firebase Cloud Messaging (FCM) for Android. ## What the relay sees -The relay attributes every notification to the server that sent it, -rate-limits each server and device, and keeps usage records (server, time, -device handle, size) to detect and act on abuse. Notification contents are -end-to-end encrypted between beacon-server and the app; the relay cannot read -them unless a user reports a notification from the app. +The relay attributes every notification to the server that sent it, puts the +server's registered name on it, rate-limits each server and device, and keeps +usage records (server, time, device handle, size, a hash of the ciphertext) +for 30 days to catch abuse. Notification contents are end-to-end encrypted +between beacon-server and the app; the relay cannot read them. + +Apple sees the notifications that go to iPhones and Google sees the ones that +go to Android phones, each with its device token and the encrypted payload. +Neither sees the other platform's traffic. ## Registering a server -Registration needs a verified email address, and a server with a public URL -can verify its domain for a higher quota. Each email can register up to two -servers. Details will be published here and in -[beacon-docs](https://github.com/MeshCore-Beacon/beacon-docs) once the relay -is live. +- A verified email address is always required. Each email can register up to + two servers. Disposable email domains are refused. +- A public URL is optional. If given, the relay checks it daily (see + [Domain check](#domain-check)); a server that passes gets the higher tier. + +| Tier | Requires | Per minute | Per day | +|---|---|---|---| +| email | verified email | 30 | 500 | +| verified | email and a passing domain check | 300 | 10,000 | +| custom | set by an admin | as set | as set | + +Every device also has its own limits: 10 notifications a minute and 200 a day. + +### Lost secret or a slot back + +`/manage` takes the registered email and mails a link that works for an hour. +It lists that email's servers with their usage (registered phones, sent today +against the daily limit, and the last 7 days) for 15 minutes and one action: get a new Push +secret (the old one stops working at once; the Push ID, devices and limits +stay) or remove a server with its devices and history, which frees its slot. +Every change mails a notice to the operator and the admin address. Banned +servers and banned emails get nothing. + +## API + +All bodies are JSON, at most 512 KiB (a bigger one gets `413 too_large`). +Errors look like `{"error": {"code": "...", "message": "..."}}`. A `429` +carries `Retry-After` in seconds. + +### For beacon-server + +Authenticate with `Authorization: Bearer .`. + +**`POST /v1/hello`**, at startup and then hourly: + +```json +{ "pushId": "inst_7f3k2m9qxa", "name": "Ottawa Mesh", "status": "active", "tier": "email", + "limits": { "perMinute": 30, "perDay": 500, "perDevicePerDay": 200 }, + "url": "https://beacon.example.org", "domainVerified": false, "termsOutdated": false, "devices": 12 } +``` + +`status` is `active` or `suspended`. A banned server gets `403 banned`. + +**`POST /v1/send`**, with 1 to 100 messages: + +```json +{ "messages": [ { "handle": "h_…", "ciphertext": "", "collapseKey": "4711", "ttlSeconds": 86400, + "id": "1234:9b2c…" } ] } +``` + +- `ciphertext` is standard base64, at most 2,048 bytes once decoded. +- `collapseKey` is optional, up to 40 of `A-Z a-z 0-9 _ - . :`. The relay + prefixes it with the Push ID, so a server only ever collapses its own + notifications. +- `ttlSeconds` defaults to one day and can be at most 28 days (2,419,200). +- `id` is optional, up to 64 of `A-Z a-z 0-9 _ - . :`, and makes a retry safe. + It is scoped to the sending server, and the relay remembers each id's + outcome for at least 24 hours (30 days in practice). Repeating an id that + was sent answers `ok` with the earlier `messageId` and sends and counts + nothing, even if the handle has gone or the relay is paused since. Repeating an id whose send is still under way, or whose outcome + is unknown because the relay stopped mid-send, answers `rate_limited` with + `retryAfterSeconds: 30`; after 2 minutes such a send counts as failed, its + quota is given back (with or without an id) and the next repeat sends again. Repeating an id whose send failed sends again. + beacon-server uses `:`. + +The relay sends up to 8 messages of a batch at once and starts no new one +after 10 seconds; each message's whole send to APNs or FCM, token refresh +included, is limited to 10 seconds, so the answer comes within about 20 seconds. Items not started in time answer `rate_limited` with +`retryAfterSeconds: 5`. + +The answer has one result per message, in order: +`{"results": [{"messageId": "m_…", "status": "ok"}, {"status": "rate_limited", "retryAfterSeconds": 42}]}`. +`retryAfterSeconds` (whole seconds, at least 1) comes with every +`rate_limited` result and with a `failed` one caused by an APNs or FCM outage. The +response's `Retry-After` header carries the largest wait in the batch, for +servers that do not read the field. + +| status | Meaning | What the server does | +|---|---|---| +| `ok` | Handed to APNs or FCM | Mark delivered | +| `rate_limited` | Not sent: over a limit, the device's push service is paused after an outage, not started before the batch deadline, or an `id` still in flight | Hold until `retryAfterSeconds` (else `Retry-After`); not an attempt | +| `invalid_handle` | Unknown, revoked, another server's, or the push service no longer knows the handle's current token (APNs 410, `BadDeviceToken` or `DeviceTokenNotForTopic`; FCM UNREGISTERED) | Delete the device | +| `too_large`, `invalid` | Refused: a bad item, a payload over APNs' 4 KB, or the push service refused the message (APNs 400, FCM 400 INVALID_ARGUMENT) | Done for this notice, never resend | +| `failed` | Transient: the push service unreachable or another error from it (such as APNs `IdleTimeout`), the relay's own APNs or FCM credentials refused, the app refreshed or registered the device again while it was being sent, or the relay could not record a send the push service accepted | Retry later; counts an attempt | + +APNs and FCM are paused separately: an outage of one never holds back the +other. When APNs answers 5xx or FCM answers 500 or 503, the relay stops +sending through that service for its `Retry-After`, at most a day. Without +one it pauses a minute, doubling with each new outage up to an hour, until a +send through it succeeds after the pause has ended. That item is `failed` and +every later item for the same service is `rate_limited` until the pause ends. +A 429 for a device makes that item `rate_limited`, for the `Retry-After` the +service gave (a minute if it gives none, at most a day), and later items for +the same device wait, without reaching the service, until the longest wait +asked for that device ends. A message counts against the daily quotas while +it is being sent and stays counted only if the push service accepts it. + +When APNs refuses the relay's provider token as expired or invalid, the relay +signs a new one and tries once more. If that fails too, the item is `failed` +and the relay logs an error: its APNs key needs attention. + +A suspended server gets `403 suspended` for the whole batch, and a banned one +`403 banned`. A batch waiting behind another from the same server checks the +server's status and quotas again before it starts, and each message checks +them again before it goes out. + +**`POST /v1/verify-domain`** runs the domain check now: +`{"domainVerified": true}` or `{"domainVerified": false, "reason": "..."}`. + +### For the app + +**`POST /v1/handles`** with +`{"pushId", "platform": "ios"|"android", "token", "apnsEnvironment"}` +answers `200` with `{"handle", "handleSecret"}`. + +- On iOS, `token` is the APNs device token in hex (64 to 200 characters, + either case; stored lower-case), and `apnsEnvironment` is `sandbox` for a + development build or `production` for TestFlight and App Store builds. +- On Android, `token` is the FCM registration token, up to 4,096 of + `A-Z a-z 0-9 _ - :`, and `apnsEnvironment` must be left out. + +The same token on the same server keeps its handle and gets a new secret. +Errors: + +- `400 bad_platform`: `platform` is not `ios` or `android`. +- `400 bad_apns_environment`: iOS without `sandbox` or `production`, or + Android with an `apnsEnvironment`. +- `400 bad_token`: `token` is missing or malformed for the platform. +- `404 unknown_server`: no server has that Push ID. +- `403 server_unavailable`: the server is suspended or banned. + +**`PUT /v1/handles/{handle}`** with `{"handleSecret", "token", "apnsEnvironment"}` +moves the handle to a refreshed token, and on iOS to the given environment, +which is required there as on `POST`. It answers `204`, `400 bad_token` or +`400 bad_apns_environment`. + +**`DELETE /v1/handles/{handle}`** with `{"handleSecret"}` stops the handle. It +answers `204`. + +On `PUT` and `DELETE`, an unknown or revoked handle or a wrong secret gets +`404 unknown_handle`. Each address may create 20 handles an hour and make 60 +updates and deletes an hour; past that it gets `429 rate_limited` with +`Retry-After`. + +### What reaches the phone + +The same fields on both platforms: + +```json +{ "v": "1", "pushId": "inst_…", "serverName": "Ottawa Mesh", "messageId": "m_…", "ct": "" } +``` + +Android gets them as the data of a data-only, high-priority FCM message. iOS +gets them as top-level keys of the APNs payload, next to a placeholder alert +(title: the server name, body: "New alert") with `mutable-content: 1`, so the +Notification Service Extension decrypts the message and replaces the text. +The APNs request has `apns-push-type: alert`, `apns-priority: 10`, an +`apns-expiration` from `ttlSeconds`, and the collapse key as +`apns-collapse-id` (hashed when the prefixed key is over 64 bytes). + +### Domain check + +The relay requests +`GET /.well-known/beacon-push?challenge=` over +https, from a public address only, with no redirects, and gives up after a few +seconds. beacon-server answers: + +```json +{ "pushId": "inst_…", "mac": "" } +``` + +A match proves that the host at that URL holds the Push secret. +beacon-server answers by itself while push is on; there is nothing to set up. +If a reverse proxy sits in front of it, route `/.well-known/beacon-push` to +beacon-server, with no redirects. + +## Running the relay + +The project runs the official instance, and the Beacon app only accepts +notifications from it. Forks that ship their own app, Apple team and Firebase +project can run their own; there's no support for that beyond this README. + +The image is `ghcr.io/meshcore-beacon/beacon-push`. Configuration comes from +the environment: see [`.env.example`](.env.example). It needs: + +- a Firebase service-account key file, mounted read-only, for Android; +- an APNs auth key (`.p8`) from the Apple Developer account, mounted + read-only, with its key ID, the team ID and the app's bundle ID + (`PUSH_APNS_KEY`, `PUSH_APNS_KEY_ID`, `PUSH_APNS_TEAM_ID`, + `PUSH_APNS_TOPIC`), for iOS. The key works for both the sandbox and + production environments; each handle says which one its device uses. A key + that cannot be read stops the relay at startup; +- an SMTP account for registration mail; +- a volume at `/data` for the SQLite database. Back it up daily with + `beacon-push admin backup /data/backup-$(date +%F).db` (from cron through `docker exec`) and copy the file off + the box. + +Put it behind a TLS proxy such as Caddy, with `PUSH_TRUST_PROXY=true`. + +### Admin commands + +``` +docker exec beacon-push beacon-push admin list +docker exec beacon-push beacon-push admin show +docker exec beacon-push beacon-push admin suspend +docker exec beacon-push beacon-push admin unsuspend +docker exec beacon-push beacon-push admin ban +docker exec beacon-push beacon-push admin set-quota +docker exec beacon-push beacon-push admin delete +docker exec beacon-push beacon-push admin backup /data/backup.db +``` + +`delete` removes a server for good, with its devices, send log and usage. Its +email is not banned and can register a server again. + +A server that addresses too many live device handles that aren't its own +(50 in an hour, or more than 20% of at least 100 live handles in an hour) is +suspended automatically, and the admin address gets a mail. Handles that +don't exist or are revoked don't count either way. So does every new registration, a lost domain +verification, and an email-tier server reaching 1,000 devices. + +### Local development + +``` +PUSH_DEV_MODE=true PUSH_PUBLIC_URL=http://localhost:8080 PUSH_DATABASE_PATH=./dev.db go run ./cmd/beacon-push +``` + +Dev mode logs mail (including registration links) and pushes instead of +sending them. + +Checks before pushing: `go build ./... && go vet ./... && go test ./...` and +`gofmt -l .`. ## Contributing diff --git a/SECURITY.md b/SECURITY.md index 8140097..fd2998d 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -17,11 +17,12 @@ Once a fix is released we will publish a security advisory on the repository. ## Scope beacon-push is the relay that forwards notifications from self-hosted -beacon-server instances to the Beacon app through Firebase Cloud Messaging. +beacon-server instances to the Beacon app, through Apple's push service (APNs) +for iOS and Firebase Cloud Messaging for Android. Relevant findings include ways to send notifications without valid instance credentials, to reach devices registered with another server, to get around rate limits or registration limits, to read notification contents, leaks of -the Firebase key, SMTP credentials or instance secrets, weaknesses in email or +the Firebase key, the APNs key, SMTP credentials or instance secrets, weaknesses in email or domain verification, dependency vulnerabilities, and issues in the container image or build pipeline. Vulnerabilities in rule matching or payload encryption on the server side belong in the diff --git a/SHOULDERS.md b/SHOULDERS.md index 0967873..d2524d6 100644 --- a/SHOULDERS.md +++ b/SHOULDERS.md @@ -7,3 +7,25 @@ projects that make this possible. Add new dependencies here in the PR that intro - [MeshCore](https://github.com/meshcore-dev/MeshCore): the mesh whose events these notifications report on + +## Libraries + +- [Go](https://go.dev/): the language and its standard library, including the SMTP, TLS, HTTP/2 and crypto packages +- [chi](https://github.com/go-chi/chi): HTTP routing +- [modernc.org/sqlite](https://gitlab.com/cznic/sqlite): SQLite without cgo +- [disposable-email-domains](https://github.com/disposable-email-domains/disposable-email-domains): the CC0 + blocklist of throwaway email domains, vendored in `internal/disposable/list.txt` + +## Fonts + +Self-hosted latin subsets from [Fontsource](https://fontsource.org/), under the SIL Open Font License 1.1. The +license texts sit next to the files in `internal/relay/static/fonts/`. + +- [Inter](https://github.com/rsms/inter): the text on the relay's web pages +- [JetBrains Mono](https://github.com/JetBrains/JetBrainsMono): IDs and config snippets +- [Chakra Petch](https://github.com/m4rc1e/Chakra-Petch): the Beacon wordmark + +## Services + +- [Apple Push Notification service](https://developer.apple.com/documentation/usernotifications): delivery to iOS +- [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging): delivery to Android diff --git a/cmd/beacon-push/admin.go b/cmd/beacon-push/admin.go new file mode 100644 index 0000000..a0b5eca --- /dev/null +++ b/cmd/beacon-push/admin.go @@ -0,0 +1,203 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package main + +import ( + "context" + "errors" + "fmt" + "io" + "os" + "strconv" + "text/tabwriter" + "time" + + "github.com/MeshCore-Beacon/beacon-push/internal/relay" + "github.com/MeshCore-Beacon/beacon-push/internal/store" +) + +const adminUsage = `usage: beacon-push admin + + list every registered server + show one server, its devices and its last 14 days + suspend stop it sending until unsuspended + unsuspend let it send again + ban stop it for good and refuse its email + set-quota override its limits; 0 0 restores its tier + delete remove it, its devices and its history for good; its email is not banned + backup write a consistent copy of the database to a new file + +The database is PUSH_DATABASE_PATH (default /data/beacon-push.db).` + +func admin(args []string, out io.Writer) error { + if len(args) == 0 || args[0] == "help" || args[0] == "-h" || args[0] == "--help" { + fmt.Fprintln(out, adminUsage) + return nil + } + path := os.Getenv("PUSH_DATABASE_PATH") + if path == "" { + path = "/data/beacon-push.db" + } + ctx := context.Background() + st, err := store.Open(ctx, path) + if err != nil { + return fmt.Errorf("open database: %w", err) + } + defer st.Close() + return runAdmin(ctx, st, args, out, time.Now()) +} + +func runAdmin(ctx context.Context, st *store.Store, args []string, out io.Writer, now time.Time) error { + need := func(n int) error { + if len(args) != n+1 { + return errors.New(adminUsage) + } + return nil + } + switch args[0] { + case "list": + list, err := st.Instances(ctx) + if err != nil { + return err + } + tw := tabwriter.NewWriter(out, 0, 2, 2, ' ', 0) + fmt.Fprintln(tw, "PUSH ID\tSTATUS\tTIER\tNAME\tEMAIL\tURL\tCREATED") + for _, i := range list { + fmt.Fprintf(tw, "%s\t%s\t%s\t%s\t%s\t%s\t%s\n", i.ID, i.Status, relay.TierFor(i).Name, i.Name, i.Email, dash(i.URL), + time.UnixMilli(i.CreatedAt).UTC().Format("2006-01-02")) + } + return tw.Flush() + case "show": + if err := need(1); err != nil { + return err + } + i, err := lookup(ctx, st, args[1]) + if err != nil { + return err + } + devices, err := st.CountHandles(ctx, i.ID) + if err != nil { + return err + } + usage, err := st.UsageFor(ctx, i.ID, 14) + if err != nil { + return err + } + t := relay.TierFor(i) + fmt.Fprintf(out, "Push ID: %s\nName: %s\nEmail: %s\nURL: %s\nStatus: %s\nTier: %s (%d/min, %d/day)\n", + i.ID, i.Name, i.Email, dash(i.URL), i.Status, t.Name, t.PerMinute, t.PerDay) + fmt.Fprintf(out, "Domain: %s\nDevices: %d\nCreated: %s from %s\nTerms: version %d\n", + domainState(i), devices, stamp(i.CreatedAt), dash(i.CreatedIP), i.TermsVersion) + if len(usage) > 0 { + fmt.Fprintln(out, "\nDAY SENT RATE LIMITED INVALID HANDLES") + for _, u := range usage { + fmt.Fprintf(out, "%s %5d %12d %15d\n", u.Day, u.Sent, u.RateLimited, u.InvalidHandles) + } + } + return nil + case "suspend", "unsuspend", "ban": + if err := need(1); err != nil { + return err + } + i, err := lookup(ctx, st, args[1]) + if err != nil { + return err + } + status := map[string]string{"suspend": store.StatusSuspended, "unsuspend": store.StatusActive, "ban": store.StatusBanned}[args[0]] + if i.Status == store.StatusBanned && status != store.StatusBanned { + return fmt.Errorf("%s is banned; bans are not lifted from here", i.ID) + } + var eh []byte + if status == store.StatusBanned { + eh = relay.EmailHash(i.Email) + } + if err := st.SetStatus(ctx, i.ID, status, eh, now); err != nil { + return err + } + fmt.Fprintf(out, "%s is now %s\n", i.ID, status) + return nil + case "delete": + if err := need(1); err != nil { + return err + } + i, err := lookup(ctx, st, args[1]) + if err != nil { + return err + } + if err := st.DeleteInstance(ctx, i.ID); err != nil { + if errors.Is(err, store.ErrNotFound) { + return fmt.Errorf("no server %s", i.ID) + } + return err + } + fmt.Fprintf(out, "deleted %s (%s, %s)\n", i.ID, i.Name, i.Email) + return nil + case "backup": + if err := need(1); err != nil { + return err + } + if err := st.Backup(ctx, args[1]); err != nil { + return fmt.Errorf("backup: %w", err) + } + fmt.Fprintf(out, "wrote %s\n", args[1]) + return nil + case "set-quota": + if err := need(3); err != nil { + return err + } + perMin, err1 := strconv.Atoi(args[2]) + perDay, err2 := strconv.Atoi(args[3]) + if err1 != nil || err2 != nil || perMin < 0 || perDay < 0 { + return errors.New("set-quota takes two whole numbers, 0 or more") + } + if err := st.SetQuota(ctx, args[1], perMin, perDay); err != nil { + if errors.Is(err, store.ErrNotFound) { + return fmt.Errorf("no server %s", args[1]) + } + return err + } + i, err := lookup(ctx, st, args[1]) + if err != nil { + return err + } + t := relay.TierFor(i) + fmt.Fprintf(out, "%s: %s tier, %d/min, %d/day\n", i.ID, t.Name, t.PerMinute, t.PerDay) + return nil + } + return fmt.Errorf("unknown admin command %q\n\n%s", args[0], adminUsage) +} + +func lookup(ctx context.Context, st *store.Store, id string) (store.Instance, error) { + i, err := st.Instance(ctx, id) + if errors.Is(err, store.ErrNotFound) { + return i, fmt.Errorf("no server %s", id) + } + return i, err +} + +func dash(s string) string { + if s == "" { + return "-" + } + return s +} + +func stamp(ms int64) string { + if ms == 0 { + return "never" + } + return time.UnixMilli(ms).UTC().Format("2006-01-02 15:04 UTC") +} + +func domainState(i store.Instance) string { + switch { + case i.URL == "": + return "no URL" + case i.DomainVerifiedAt != 0: + return "verified since " + stamp(i.DomainVerifiedAt) + ", checked " + stamp(i.DomainCheckedAt) + case i.DomainCheckedAt != 0: + return "not verified, checked " + stamp(i.DomainCheckedAt) + } + return "not checked yet" +} diff --git a/cmd/beacon-push/admin_test.go b/cmd/beacon-push/admin_test.go new file mode 100644 index 0000000..279f43e --- /dev/null +++ b/cmd/beacon-push/admin_test.go @@ -0,0 +1,96 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package main + +import ( + "bytes" + "context" + "path/filepath" + "strings" + "testing" + "time" + + "github.com/MeshCore-Beacon/beacon-push/internal/relay" + "github.com/MeshCore-Beacon/beacon-push/internal/store" +) + +func TestAdminCommands(t *testing.T) { + ctx := context.Background() + st, err := store.Open(ctx, filepath.Join(t.TempDir(), "a.db")) + if err != nil { + t.Fatal(err) + } + defer st.Close() + now := time.Date(2026, 11, 17, 12, 0, 0, 0, time.UTC) + if err := st.CreateInstance(ctx, store.Instance{ID: "inst_abc", Name: "Ottawa Mesh", Email: "Op@Example.org", SecretHash: []byte("h"), + TermsVersion: 1, CreatedAt: store.Ms(now)}, 2); err != nil { + t.Fatal(err) + } + run := func(args ...string) (string, error) { + var out bytes.Buffer + err := runAdmin(ctx, st, args, &out, now) + return out.String(), err + } + + if out, err := run("list"); err != nil || !strings.Contains(out, "inst_abc") || !strings.Contains(out, "Ottawa Mesh") { + t.Fatalf("list: %v\n%s", err, out) + } + if out, err := run("show", "inst_abc"); err != nil || !strings.Contains(out, "email (30/min, 500/day)") || !strings.Contains(out, "no URL") { + t.Fatalf("show: %v\n%s", err, out) + } + if out, err := run("set-quota", "inst_abc", "60", "2000"); err != nil || !strings.Contains(out, "custom tier, 60/min, 2000/day") { + t.Fatalf("set-quota: %v\n%s", err, out) + } + if _, err := run("suspend", "inst_abc"); err != nil { + t.Fatal(err) + } + if i, _ := st.Instance(ctx, "inst_abc"); i.Status != store.StatusSuspended { + t.Fatalf("status %s", i.Status) + } + if _, err := run("ban", "inst_abc"); err != nil { + t.Fatal(err) + } + if banned, _ := st.EmailBanned(ctx, relay.EmailHash("op@example.org")); !banned { + t.Fatal("ban must remember the email") + } + if _, err := run("unsuspend", "inst_abc"); err == nil { + t.Fatal("unsuspend must not lift a ban") + } + copyPath := filepath.Join(t.TempDir(), "copy.db") + if out, err := run("backup", copyPath); err != nil || !strings.Contains(out, "wrote") { + t.Fatalf("backup: %v %s", err, out) + } + cp, err := store.Open(ctx, copyPath) + if err != nil { + t.Fatal(err) + } + defer cp.Close() + if _, err := cp.Instance(ctx, "inst_abc"); err != nil { + t.Fatalf("backup copy: %v", err) + } + if _, err := run("backup", copyPath); err == nil { + t.Fatal("backup must not overwrite a file") + } + if err := st.CreateInstance(ctx, store.Instance{ID: "inst_del", Name: "Gone", Email: "gone@example.org", SecretHash: []byte("h"), + TermsVersion: 1, CreatedAt: store.Ms(now)}, 2); err != nil { + t.Fatal(err) + } + if out, err := run("delete", "inst_del"); err != nil || !strings.Contains(out, "deleted inst_del") { + t.Fatalf("delete: %v\n%s", err, out) + } + if _, err := st.Instance(ctx, "inst_del"); err == nil { + t.Fatal("delete left the server") + } + if banned, _ := st.EmailBanned(ctx, relay.EmailHash("gone@example.org")); banned { + t.Fatal("delete must not ban the email") + } + if _, err := run("delete", "inst_del"); err == nil || !strings.Contains(err.Error(), "no server inst_del") { + t.Fatalf("delete of unknown id: %v", err) + } + for _, bad := range [][]string{{"show"}, {"show", "inst_nope"}, {"set-quota", "inst_abc", "x", "1"}, {"delete"}, {"frobnicate"}} { + if _, err := run(bad...); err == nil { + t.Errorf("%v accepted", bad) + } + } +} diff --git a/cmd/beacon-push/main.go b/cmd/beacon-push/main.go new file mode 100644 index 0000000..9700bda --- /dev/null +++ b/cmd/beacon-push/main.go @@ -0,0 +1,129 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +// Command beacon-push is the MeshCore Beacon push relay. +// +// beacon-push serve +// beacon-push admin ... manage registered servers (see beacon-push admin help) +// beacon-push healthcheck exit 0 when the local relay answers /healthz +package main + +import ( + "context" + "errors" + "fmt" + "log/slog" + "net" + "net/http" + "os" + "os/signal" + "syscall" + "time" + + "github.com/MeshCore-Beacon/beacon-push/internal/apns" + "github.com/MeshCore-Beacon/beacon-push/internal/config" + "github.com/MeshCore-Beacon/beacon-push/internal/fcm" + "github.com/MeshCore-Beacon/beacon-push/internal/mail" + "github.com/MeshCore-Beacon/beacon-push/internal/push" + "github.com/MeshCore-Beacon/beacon-push/internal/relay" + "github.com/MeshCore-Beacon/beacon-push/internal/store" +) + +// version is set at build time via -ldflags "-X main.version=vX.Y.Z". +var version = "dev" + +func main() { + slog.SetDefault(slog.New(slog.NewTextHandler(os.Stderr, nil))) + args := os.Args[1:] + var err error + switch { + case len(args) == 0: + err = serve() + case args[0] == "admin": + err = admin(args[1:], os.Stdout) + case args[0] == "healthcheck": + err = healthcheck() + case args[0] == "version": + fmt.Println(version) + default: + err = fmt.Errorf("unknown command %q: run with no arguments to serve, or use admin, healthcheck or version", args[0]) + } + if err != nil { + fmt.Fprintln(os.Stderr, "beacon-push:", err) + os.Exit(1) + } +} + +func serve() error { + cfg, err := config.Load(os.Getenv) + if err != nil { + return err + } + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) + defer stop() + + st, err := store.Open(ctx, cfg.DatabasePath) + if err != nil { + return fmt.Errorf("open database: %w", err) + } + defer st.Close() + + var sender push.Sender = push.Log{} + var mailer mail.Sender = mail.Log{} + if cfg.DevMode { + slog.Warn("dev mode: mail and pushes are logged, not sent, and the domain check may reach private addresses", "component", "startup") + } else { + f, err := fcm.Load(cfg.FirebaseCredentials) + if err != nil { + return err + } + a, err := apns.Load(cfg.APNsKey, cfg.APNsKeyID, cfg.APNsTeamID, cfg.APNsTopic) + if err != nil { + return err + } + sender = push.Router{IOS: a, Android: f} + mailer = mail.NewSMTP(cfg.SMTPHost, cfg.SMTPPort, cfg.SMTPUsername, cfg.SMTPPassword, cfg.SMTPFrom, cfg.SMTPStartTLS) + } + + srv := relay.New(relay.Options{Config: cfg, Store: st, Push: sender, Mail: mailer}) + go srv.RunMaintenance(ctx) + + hs := &http.Server{Addr: cfg.ListenAddr, Handler: srv.Handler(), ReadHeaderTimeout: 10 * time.Second, + ReadTimeout: 30 * time.Second, WriteTimeout: 60 * time.Second, IdleTimeout: 120 * time.Second, MaxHeaderBytes: 16 << 10} + errc := make(chan error, 1) + go func() { errc <- hs.ListenAndServe() }() + slog.Info("beacon-push listening", "component", "startup", "version", version, "addr", cfg.ListenAddr, + "public_url", cfg.PublicURL.String(), "admin_notices", cfg.AdminEmail != "") + + select { + case err := <-errc: + if !errors.Is(err, http.ErrServerClosed) { + return err + } + case <-ctx.Done(): + } + shutdown, cancel := context.WithTimeout(context.Background(), 15*time.Second) + defer cancel() + return hs.Shutdown(shutdown) +} + +func healthcheck() error { + addr := os.Getenv("PUSH_LISTEN_ADDR") + if addr == "" { + addr = ":8080" + } + _, port, err := net.SplitHostPort(addr) + if err != nil { + return fmt.Errorf("PUSH_LISTEN_ADDR %q: %w", addr, err) + } + c := &http.Client{Timeout: 3 * time.Second} + resp, err := c.Get("http://127.0.0.1:" + port + "/healthz") + if err != nil { + return err + } + resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("healthz answered %d", resp.StatusCode) + } + return nil +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..ffa35cd --- /dev/null +++ b/go.mod @@ -0,0 +1,20 @@ +module github.com/MeshCore-Beacon/beacon-push + +go 1.26.11 + +require ( + github.com/go-chi/chi/v5 v5.4.0 + modernc.org/sqlite v1.62.0 +) + +require ( + github.com/dustin/go-humanize v1.1.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/mattn/go-isatty v0.0.24 // indirect + github.com/ncruces/go-strftime v1.1.0 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect + golang.org/x/sys v0.49.0 // indirect + modernc.org/libc v1.80.1 // indirect + modernc.org/mathutil v1.7.1 // indirect + modernc.org/memory v1.12.1 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..ce87fa3 --- /dev/null +++ b/go.sum @@ -0,0 +1,52 @@ +github.com/dustin/go-humanize v1.1.0 h1:dbKTrvD0klcbBV/h4AWJdMuZogJACoMlvWIWZ5b2xWg= +github.com/dustin/go-humanize v1.1.0/go.mod h1:hc1CvRkJMsgxqjmjMQF3QNRAZBwY8AXBAzKYoSX9sFI= +github.com/go-chi/chi/v5 v5.4.0 h1:+ufzvFTGKyin26Or5DLrlIDq4ygIDBVcj7oVNeeaYFE= +github.com/go-chi/chi/v5 v5.4.0/go.mod h1:d1IG7GtKPSjPyBP365PH8sAGVHk3qfB/IhjFNRH1wWM= +github.com/google/pprof v0.0.0-20261016150608-1facf8f91b50 h1:PlNWJRxu5APSV0pWqfIsZ0qt9OOGHSWfZQ4zvx+WgWs= +github.com/google/pprof v0.0.0-20261016150608-1facf8f91b50/go.mod h1:yUo1AMMpsPIDFGuwDK8nLcf8+vvAd5l2O6JDZ6hpwrM= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI= +github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A= +github.com/ncruces/go-strftime v1.1.0 h1:vtPmPWMkb539RGV9WpWT9EwJGvrOCKvMNI4obWL47Hk= +github.com/ncruces/go-strftime v1.1.0/go.mod h1:yVaq7iwCN09vHRrKBrrflXT0M9tTMG2KmZ9Fj7xeG/g= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +golang.org/x/mod v0.42.0 h1:ICeL3t2L30ljSPHHxDnR4fqVcBt/zR2zJAb9juavmQg= +golang.org/x/mod v0.42.0/go.mod h1:u5fzIrRInkL8MaO1cbRkUHT64v303YIT5KEqpNr7jRs= +golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA= +golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA= +golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs= +golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs= +modernc.org/cc/v4 v4.30.6-0.20261101114202-1b9d1a076f6b h1:WE5SLOURcNd8s6uPR/n4WV4weQxxYKi5OpEZkfNVvdE= +modernc.org/cc/v4 v4.30.6-0.20261101114202-1b9d1a076f6b/go.mod h1:OnovgIhbbMXMu1aISnJ0wvVD1KnW+cAUJkIrAWh+kVI= +modernc.org/ccgo/v4 v4.38.1 h1:wdxJVBuFT8JufZnnQyS6Bbz3NOWhViD0xJOGR96Bpd4= +modernc.org/ccgo/v4 v4.38.1/go.mod h1:kOpEkJRbFwBvjUWwn4j1j9B7iFHbl1+orhgTMCDkDBk= +modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM= +modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU= +modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI= +modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito= +modernc.org/gc/v3 v3.2.0 h1:/Y3LGDMQaoYf55PebP1qsZ5FDGgAZyG1RYKEHeQzh1o= +modernc.org/gc/v3 v3.2.0/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY= +modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks= +modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI= +modernc.org/libc v1.80.1 h1:ejn7HtTV3GknNKbklqWQ1nvUrfX8mTxs1D+xp/JQwy4= +modernc.org/libc v1.80.1/go.mod h1:pvo25Rs3OJEbDqhUV9jdEGevxeLJrJeDmNid/AcQV1g= +modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU= +modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg= +modernc.org/memory v1.12.1 h1:nFMiWrpStgZczNl6XI9GnIk/rWhYIyHGUaR04pGbp9g= +modernc.org/memory v1.12.1/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw= +modernc.org/opt v0.2.0 h1:tGyef5ApycA7FSEOMraay9SaTk5zmbx7Tu+cJs4QKZg= +modernc.org/opt v0.2.0/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns= +modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w= +modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE= +modernc.org/sqlite v1.62.0 h1:gMaCjSM1qpl+iOjiWhR1LYP3zqrYDI+5GYLGt6veP2g= +modernc.org/sqlite v1.62.0/go.mod h1:Jzjh1mt4s0HuQ0KvtB1LIuHiGRmU2D5pgj8dUhW7/SE= +modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0= +modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A= +modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= +modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= diff --git a/internal/apns/apns.go b/internal/apns/apns.go new file mode 100644 index 0000000..40dd4f1 --- /dev/null +++ b/internal/apns/apns.go @@ -0,0 +1,258 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +// Package apns sends notifications to iOS devices through Apple's HTTP/2 provider API, signed with a token-based +// (.p8) key. +package apns + +import ( + "bytes" + "context" + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "crypto/sha256" + "crypto/x509" + "encoding/base64" + "encoding/json" + "encoding/pem" + "errors" + "io" + "net/http" + "net/url" + "os" + "strconv" + "strings" + "sync" + "time" + + "github.com/MeshCore-Beacon/beacon-push/internal/push" +) + +const ( + ProductionBase = "https://api.push.apple.com" + SandboxBase = "https://api.sandbox.push.apple.com" + + callLimit = 10 * time.Second + sendLimit = 10 * time.Second // a whole Send: the token retry included + tokenLifetime = 45 * time.Minute // Apple refuses tokens older than an hour and refreshes more often than every 20 minutes + maxPayload = 4096 + maxCollapseID = 64 + maxReply = 4 << 10 +) + +// APNs signs a provider token with the team's key and reuses it for tokenLifetime. Nothing it holds (key, provider +// token, device tokens) is ever logged or put in an error. +type APNs struct { + keyID, teamID, topic string + key *ecdsa.PrivateKey + prodBase, sandboxBase string + client *http.Client + now func() time.Time + sendLimit time.Duration + + mu sync.Mutex + token string + issued time.Time +} + +// Load reads the .p8 key file. Errors never include the file's content. +func Load(path, keyID, teamID, topic string) (*APNs, error) { + raw, err := os.ReadFile(path) + if err != nil { + return nil, errors.New("apns key file cannot be read") + } + key, err := ParseKey(raw) + if err != nil { + return nil, err + } + return New(keyID, teamID, topic, key, ProductionBase, SandboxBase, nil, nil), nil +} + +// ParseKey reads a PKCS #8 P-256 key, the format of Apple's .p8 files. +func ParseKey(raw []byte) (*ecdsa.PrivateKey, error) { + block, _ := pem.Decode(raw) + if block == nil { + return nil, errors.New("apns key is not PEM") + } + k, err := x509.ParsePKCS8PrivateKey(block.Bytes) + if err != nil { + return nil, errors.New("apns key cannot be parsed") + } + key, ok := k.(*ecdsa.PrivateKey) + if !ok || key.Curve != elliptic.P256() { + return nil, errors.New("apns key is not a P-256 key") + } + return key, nil +} + +// New builds the sender from its parts; tests point the bases at a local server. +func New(keyID, teamID, topic string, key *ecdsa.PrivateKey, prodBase, sandboxBase string, client *http.Client, now func() time.Time) *APNs { + if client == nil { + tr := http.DefaultTransport.(*http.Transport).Clone() // keeps HTTP/2, which APNs requires + client = &http.Client{Transport: tr, Timeout: callLimit, CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }} + } + if now == nil { + now = time.Now + } + return &APNs{keyID: keyID, teamID: teamID, topic: topic, key: key, prodBase: strings.TrimRight(prodBase, "/"), + sandboxBase: strings.TrimRight(sandboxBase, "/"), client: client, now: now, sendLimit: sendLimit} +} + +func b64(b []byte) string { return base64.RawURLEncoding.EncodeToString(b) } + +// providerToken is the cached ES256 JWT, signed anew once it is tokenLifetime old. +func (a *APNs) providerToken() (string, error) { + a.mu.Lock() + defer a.mu.Unlock() + now := a.now() + if a.token != "" && now.Sub(a.issued) < tokenLifetime && !now.Before(a.issued) { + return a.token, nil + } + hdr, _ := json.Marshal(map[string]string{"alg": "ES256", "kid": a.keyID}) + claims, _ := json.Marshal(map[string]any{"iss": a.teamID, "iat": now.Unix()}) + signing := b64(hdr) + "." + b64(claims) + sum := sha256.Sum256([]byte(signing)) + r, s, err := ecdsa.Sign(rand.Reader, a.key, sum[:]) + if err != nil { + return "", errors.New("apns provider token could not be signed") + } + sig := make([]byte, 64) // JWS wants r and s as two fixed 32-byte halves, not ASN.1 + r.FillBytes(sig[:32]) + s.FillBytes(sig[32:]) + a.token, a.issued = signing+"."+b64(sig), now + return a.token, nil +} + +// renew drops the token Apple refused, unless another send already replaced it. +func (a *APNs) renew(stale string) { + a.mu.Lock() + if a.token == stale { + a.token = "" + } + a.mu.Unlock() +} + +// CollapseID is the key as APNs takes it: as is up to 64 bytes, else a hash that always comes out the same. +func CollapseID(key string) string { + if len(key) <= maxCollapseID { + return key + } + sum := sha256.Sum256([]byte(key)) + return b64(sum[:]) +} + +// payload is a placeholder alert with mutable-content, so the Notification Service Extension runs and replaces it +// with the decrypted text, and the data as top-level keys, where the extension reads them. +func payload(m push.Message) []byte { + p := make(map[string]any, len(m.Data)+1) + for k, v := range m.Data { + p[k] = v + } + p["aps"] = map[string]any{ + "alert": map[string]string{"title": m.AlertTitle, "body": m.AlertBody}, + "mutable-content": 1, + } + b, _ := json.Marshal(p) + return b +} + +// Send posts one message to the APNs environment the device token belongs to. The errors are *push.Error values +// whose kinds the relay acts on, or a plain error when Apple could not be reached. +func (a *APNs) Send(ctx context.Context, m push.Message) error { + var base string + switch m.APNsEnv { + case push.Production: + base = a.prodBase + case push.Sandbox: + base = a.sandboxBase + default: + return push.ErrInvalid + } + body := payload(m) + if len(body) > maxPayload { + return push.ErrTooLarge + } + ctx, cancel := context.WithTimeout(ctx, a.sendLimit) + defer cancel() + for attempt := 0; ; attempt++ { + tok, err := a.providerToken() + if err != nil { + return err + } + cctx, ccancel := context.WithTimeout(ctx, callLimit) + req, err := http.NewRequestWithContext(cctx, http.MethodPost, base+"/3/device/"+url.PathEscape(m.Token), bytes.NewReader(body)) + if err != nil { + ccancel() + return errors.New("apns request failed") + } + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Authorization", "bearer "+tok) + req.Header.Set("apns-topic", a.topic) + req.Header.Set("apns-push-type", "alert") + req.Header.Set("apns-priority", "10") + exp := int64(0) + if m.TTL > 0 { + exp = a.now().Add(m.TTL).Unix() + } + req.Header.Set("apns-expiration", strconv.FormatInt(exp, 10)) + if m.CollapseKey != "" { + req.Header.Set("apns-collapse-id", CollapseID(m.CollapseKey)) + } + resp, err := a.client.Do(req) + if err != nil { + ccancel() + return errors.New("apns unreachable") + } + reply, _ := io.ReadAll(io.LimitReader(resp.Body, maxReply)) + resp.Body.Close() + ccancel() + if resp.StatusCode == http.StatusOK { + return nil + } + reason := reasonOf(reply) + if resp.StatusCode == http.StatusForbidden && attempt == 0 && (reason == "ExpiredProviderToken" || reason == "InvalidProviderToken") { + a.renew(tok) // sign a fresh token once + continue + } + return &push.Error{Provider: push.APNs, Status: resp.StatusCode, Code: reason, + RetryAfter: push.RetryAfter(resp.Header.Get("Retry-After"), a.now()), Kind: kindOf(resp.StatusCode, reason)} + } +} + +// kindOf maps Apple's answer to what the relay does about it. +func kindOf(status int, reason string) error { + switch { + case status == http.StatusGone, status == http.StatusBadRequest && (reason == "BadDeviceToken" || reason == "DeviceTokenNotForTopic"): + return push.ErrUnregistered + case status == http.StatusBadRequest && reason == "IdleTimeout": + return nil // Apple closed an idle connection: a plain failure, retried later + case status == http.StatusRequestEntityTooLarge: + return push.ErrTooLarge + case status == http.StatusBadRequest: + return push.ErrInvalid + case status == http.StatusForbidden, reason == "TooManyProviderTokenUpdates": + return push.ErrAuth // the relay's key or token, not this device + case status == http.StatusTooManyRequests: + return push.ErrThrottled + case status >= 500: + return push.ErrUnavailable + } + return nil +} + +// reasonOf reads Apple's {"reason": "..."} reply. Only short letter-only words, so nothing odd reaches a log line. +func reasonOf(reply []byte) string { + var e struct { + Reason string `json:"reason"` + } + if json.Unmarshal(reply, &e) != nil || len(e.Reason) > 40 { + return "" + } + for _, c := range e.Reason { + if (c < 'A' || c > 'Z') && (c < 'a' || c > 'z') { + return "" + } + } + return e.Reason +} diff --git a/internal/apns/apns_test.go b/internal/apns/apns_test.go new file mode 100644 index 0000000..1f946db --- /dev/null +++ b/internal/apns/apns_test.go @@ -0,0 +1,365 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package apns + +import ( + "context" + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "crypto/rsa" + "crypto/sha256" + "crypto/x509" + "encoding/base64" + "encoding/json" + "encoding/pem" + "errors" + "io" + "math/big" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strings" + "sync" + "testing" + "time" + + "github.com/MeshCore-Beacon/beacon-push/internal/push" +) + +const deviceToken = "0a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f9" + +type apnsServer struct { + t *testing.T + key *ecdsa.PrivateKey + srv *httptest.Server + mu sync.Mutex + hits int + reqs []*http.Request + auths []string + body map[string]any + reply func(w http.ResponseWriter, hit int) +} + +func newAPNsServer(t *testing.T) *apnsServer { + t.Helper() + key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + if err != nil { + t.Fatal(err) + } + a := &apnsServer{t: t, key: key} + a.srv = httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + a.mu.Lock() + defer a.mu.Unlock() + a.hits++ + if r.ProtoMajor != 2 { + t.Errorf("APNs spoken over %s", r.Proto) + } + a.reqs = append(a.reqs, r) + a.auths = append(a.auths, r.Header.Get("Authorization")) + b, _ := io.ReadAll(r.Body) + a.body = map[string]any{} + _ = json.Unmarshal(b, &a.body) + if a.reply != nil { + a.reply(w, a.hits) + return + } + w.Header().Set("apns-id", "id") + })) + a.srv.EnableHTTP2 = true + a.srv.StartTLS() + t.Cleanup(a.srv.Close) + return a +} + +// sender points both environments at the test server, sandbox under /sandbox. +func (a *apnsServer) sender(now func() time.Time) *APNs { + return New("KEY1234567", "TEAM123456", "meshcorebeacon.app", a.key, a.srv.URL, a.srv.URL+"/sandbox", a.srv.Client(), now) +} + +func (a *apnsServer) last() *http.Request { + a.mu.Lock() + defer a.mu.Unlock() + return a.reqs[len(a.reqs)-1] +} + +// verify checks a provider token's header, claims and signature against the public key. +func (a *apnsServer) verify(auth string, iat int64) { + a.t.Helper() + jwt, ok := strings.CutPrefix(auth, "bearer ") + parts := strings.Split(jwt, ".") + if !ok || len(parts) != 3 { + a.t.Fatalf("authorization %q", auth) + } + hdr, _ := base64.RawURLEncoding.DecodeString(parts[0]) + claims, _ := base64.RawURLEncoding.DecodeString(parts[1]) + var h map[string]string + var c map[string]any + _ = json.Unmarshal(hdr, &h) + _ = json.Unmarshal(claims, &c) + if len(h) != 2 || h["alg"] != "ES256" || h["kid"] != "KEY1234567" || len(c) != 2 || c["iss"] != "TEAM123456" || c["iat"] != float64(iat) { + a.t.Errorf("header %s claims %s", hdr, claims) + } + sig, _ := base64.RawURLEncoding.DecodeString(parts[2]) + sum := sha256.Sum256([]byte(parts[0] + "." + parts[1])) + if len(sig) != 64 || !ecdsa.Verify(&a.key.PublicKey, sum[:], new(big.Int).SetBytes(sig[:32]), new(big.Int).SetBytes(sig[32:])) { + a.t.Error("provider token signature does not verify") + } +} + +var sample = push.Message{Platform: push.IOS, Token: deviceToken, APNsEnv: push.Production, + Data: map[string]string{"v": "1", "pushId": "inst_a", "serverName": "Ottawa Mesh", "messageId": "m_1", "ct": "c2VjcmV0"}, + CollapseKey: "inst_a:42", TTL: time.Hour, AlertTitle: "Ottawa Mesh", AlertBody: "New alert"} + +func TestSendsTheAlertToAPNs(t *testing.T) { + a := newAPNsServer(t) + clock := time.Date(2026, 11, 17, 12, 0, 0, 0, time.UTC) + if err := a.sender(func() time.Time { return clock }).Send(context.Background(), sample); err != nil { + t.Fatal(err) + } + r := a.last() + if r.Method != "POST" || r.URL.Path != "/3/device/"+deviceToken || r.Header.Get("apns-topic") != "meshcorebeacon.app" || + r.Header.Get("apns-push-type") != "alert" || r.Header.Get("apns-priority") != "10" || + r.Header.Get("apns-expiration") != "1794920400" || r.Header.Get("apns-collapse-id") != "inst_a:42" { + t.Fatalf("%s %s %v", r.Method, r.URL.Path, r.Header) + } + a.verify(r.Header.Get("Authorization"), clock.Unix()) + // The keys the app's Notification Service Extension reads sit at the top level, next to aps. + aps := a.body["aps"].(map[string]any) + alert := aps["alert"].(map[string]any) + if aps["mutable-content"] != float64(1) || alert["title"] != "Ottawa Mesh" || alert["body"] != "New alert" || len(a.body) != 6 { + t.Fatalf("%+v", a.body) + } + for k, v := range sample.Data { + if a.body[k] != v { + t.Errorf("%s = %v", k, a.body[k]) + } + } +} + +func TestPicksTheEnvironmentPerMessage(t *testing.T) { + a := newAPNsServer(t) + s := a.sender(nil) + m := sample + m.APNsEnv = push.Sandbox + m.CollapseKey = "" + if err := s.Send(context.Background(), m); err != nil { + t.Fatal(err) + } + if r := a.last(); r.URL.Path != "/sandbox/3/device/"+deviceToken || r.Header.Get("apns-collapse-id") != "" { + t.Fatalf("%s %v", r.URL.Path, r.Header) + } + if err := s.Send(context.Background(), sample); err != nil || a.last().URL.Path != "/3/device/"+deviceToken { + t.Fatalf("%v %s", err, a.last().URL.Path) + } + m.APNsEnv = "" + if err := s.Send(context.Background(), m); !errors.Is(err, push.ErrInvalid) || a.hits != 2 { + t.Fatalf("no environment: %v after %d hits", err, a.hits) + } +} + +func TestCachesTheProviderToken(t *testing.T) { + a := newAPNsServer(t) + clock := time.Date(2026, 11, 17, 12, 0, 0, 0, time.UTC) + s := a.sender(func() time.Time { return clock }) + for i := 0; i < 3; i++ { + if err := s.Send(context.Background(), sample); err != nil { + t.Fatal(err) + } + clock = clock.Add(20 * time.Minute) // 0, 20 and 40 minutes: one token + } + if a.auths[0] != a.auths[1] || a.auths[1] != a.auths[2] { + t.Fatal("token re-signed within 45 minutes") + } + if err := s.Send(context.Background(), sample); err != nil { + t.Fatal(err) + } + if a.auths[3] == a.auths[0] { + t.Fatal("token not re-signed after 45 minutes") + } + a.verify(a.auths[3], clock.Unix()) +} + +func TestRenewsARefusedProviderTokenOnce(t *testing.T) { + for _, reason := range []string{"ExpiredProviderToken", "InvalidProviderToken"} { + a := newAPNsServer(t) + clock := time.Date(2026, 11, 17, 12, 0, 0, 0, time.UTC) + s := a.sender(func() time.Time { return clock }) + _ = s.Send(context.Background(), sample) + clock = clock.Add(time.Minute) + a.reply = func(w http.ResponseWriter, hit int) { + if hit == 2 { + w.WriteHeader(403) + _, _ = w.Write([]byte(`{"reason":"` + reason + `"}`)) + } + } + if err := s.Send(context.Background(), sample); err != nil { + t.Fatalf("%s: %v", reason, err) + } + if a.hits != 3 || a.auths[1] != a.auths[0] || a.auths[2] == a.auths[1] { + t.Fatalf("%s: %d hits, token not renewed", reason, a.hits) + } + a.verify(a.auths[2], clock.Unix()) + + a.reply = func(w http.ResponseWriter, _ int) { + w.WriteHeader(403) + _, _ = w.Write([]byte(`{"reason":"` + reason + `"}`)) + } + err := s.Send(context.Background(), sample) + var pe *push.Error + if !errors.Is(err, push.ErrAuth) || !errors.As(err, &pe) || pe.Code != reason || a.hits != 5 { + t.Fatalf("%s twice: %v after %d hits", reason, err, a.hits) + } + } +} + +func TestMapsAppleAnswers(t *testing.T) { + a := newAPNsServer(t) + for _, c := range []struct { + status int + reason string + header string + kind error + wait time.Duration + }{ + {410, "Unregistered", "", push.ErrUnregistered, 0}, + {410, "ExpiredToken", "", push.ErrUnregistered, 0}, + {400, "BadDeviceToken", "", push.ErrUnregistered, 0}, + {400, "DeviceTokenNotForTopic", "", push.ErrUnregistered, 0}, + {400, "BadCollapseId", "", push.ErrInvalid, 0}, + {400, "IdleTimeout", "", nil, 0}, + {400, "", "", push.ErrInvalid, 0}, + {413, "PayloadTooLarge", "", push.ErrTooLarge, 0}, + {429, "TooManyRequests", "", push.ErrThrottled, 0}, + {429, "TooManyRequests", "30", push.ErrThrottled, 30 * time.Second}, + {429, "TooManyProviderTokenUpdates", "", push.ErrAuth, 0}, + {403, "MissingProviderToken", "", push.ErrAuth, 0}, + {500, "InternalServerError", "", push.ErrUnavailable, 0}, + {503, "ServiceUnavailable", "120", push.ErrUnavailable, 2 * time.Minute}, + {503, "Shutdown", "", push.ErrUnavailable, 0}, + {404, "BadPath", "", nil, 0}, + } { + a.reply = func(w http.ResponseWriter, _ int) { + if c.header != "" { + w.Header().Set("Retry-After", c.header) + } + w.WriteHeader(c.status) + if c.reason != "" { + _, _ = w.Write([]byte(`{"reason":"` + c.reason + `"}`)) + } + } + err := a.sender(nil).Send(context.Background(), sample) + var pe *push.Error + if !errors.As(err, &pe) || pe.Provider != "apns" || pe.Status != c.status || pe.Code != c.reason || pe.Kind != c.kind || pe.RetryAfter != c.wait { + t.Errorf("%d %s: %#v", c.status, c.reason, err) + } + } +} + +func TestErrorsNeverCarrySecrets(t *testing.T) { + a := newAPNsServer(t) + a.reply = func(w http.ResponseWriter, _ int) { + w.WriteHeader(500) + _, _ = w.Write([]byte(`{"reason":"` + deviceToken + ` leaked"}`)) + } + err := a.sender(nil).Send(context.Background(), sample) + if err == nil || strings.Contains(err.Error(), deviceToken) || !strings.Contains(err.Error(), "500") { + t.Fatalf("%v", err) + } + s := New("K", "T", "topic", a.key, "https://127.0.0.1:1", "https://127.0.0.1:1", nil, nil) + err = s.Send(context.Background(), sample) + if err == nil || strings.Contains(err.Error(), "127.0.0.1") || strings.Contains(err.Error(), deviceToken) { + t.Fatalf("%v", err) + } +} + +func TestCollapseIDFitsSixtyFourBytes(t *testing.T) { + short := "inst_abcdefghij:" + strings.Repeat("k", 40) + if CollapseID(short) != short { + t.Fatal("a short key was changed") + } + long := strings.Repeat("x", 65) + id := CollapseID(long) + if len(id) > 64 || id != CollapseID(long) || id == CollapseID(long+"y") { + t.Fatalf("%q", id) + } + a := newAPNsServer(t) + m := sample + m.CollapseKey = long + if err := a.sender(nil).Send(context.Background(), m); err != nil || a.last().Header.Get("apns-collapse-id") != id { + t.Fatalf("%v %q", err, a.last().Header.Get("apns-collapse-id")) + } +} + +func TestRefusesAPayloadOverTheLimit(t *testing.T) { + a := newAPNsServer(t) + m := sample + // The relay's largest ciphertext with the longest name still fits. + m.Data = map[string]string{"v": "1", "pushId": "inst_abcdefghij", "serverName": strings.Repeat("é", 40), "messageId": "m_" + strings.Repeat("a", 22), + "ct": base64.StdEncoding.EncodeToString(make([]byte, 2048))} + m.AlertTitle = m.Data["serverName"] + if err := a.sender(nil).Send(context.Background(), m); err != nil { + t.Fatal(err) + } + m.Data = map[string]string{"ct": strings.Repeat("a", 4096)} + if err := a.sender(nil).Send(context.Background(), m); !errors.Is(err, push.ErrTooLarge) || a.hits != 1 { + t.Fatalf("%v after %d hits", err, a.hits) + } +} + +func TestSendHasOneDeadline(t *testing.T) { + a := newAPNsServer(t) + a.reply = func(w http.ResponseWriter, _ int) { time.Sleep(2 * time.Second) } + s := a.sender(nil) + s.sendLimit = 200 * time.Millisecond + start := time.Now() + if err := s.Send(context.Background(), sample); err == nil { + t.Fatal("a hanging APNs let the send through") + } + if took := time.Since(start); took > time.Second { + t.Fatalf("send took %s with a 200 ms limit", took) + } +} + +func TestLoad(t *testing.T) { + dir := t.TempDir() + write := func(name string, b []byte) string { + p := filepath.Join(dir, name) + if err := os.WriteFile(p, b, 0o600); err != nil { + t.Fatal(err) + } + return p + } + ec, _ := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + der, _ := x509.MarshalPKCS8PrivateKey(ec) + s, err := Load(write("ok.p8", pem.EncodeToMemory(&pem.Block{Type: "PRIVATE KEY", Bytes: der})), "K", "T", "topic") + if err != nil || s.prodBase != ProductionBase || s.sandboxBase != SandboxBase { + t.Fatalf("%v", err) + } + rk, _ := rsa.GenerateKey(rand.Reader, 2048) + rder, _ := x509.MarshalPKCS8PrivateKey(rk) + p384, _ := ecdsa.GenerateKey(elliptic.P384(), rand.Reader) + pder, _ := x509.MarshalPKCS8PrivateKey(p384) + for name, content := range map[string][]byte{ + "not pem": []byte("hunter2-secret"), + "garbage": pem.EncodeToMemory(&pem.Block{Type: "PRIVATE KEY", Bytes: []byte("super-secret-material")}), + "rsa": pem.EncodeToMemory(&pem.Block{Type: "PRIVATE KEY", Bytes: rder}), + "p384": pem.EncodeToMemory(&pem.Block{Type: "PRIVATE KEY", Bytes: pder}), + } { + _, err := Load(write(name+".p8", content), "K", "T", "topic") + if err == nil { + t.Errorf("%s accepted", name) + continue + } + for _, secret := range []string{"hunter2-secret", "super-secret-material", dir} { + if strings.Contains(err.Error(), secret) { + t.Errorf("%s: error leaks %q: %v", name, secret, err) + } + } + } + if _, err := Load(filepath.Join(dir, "missing.p8"), "K", "T", "topic"); err == nil || strings.Contains(err.Error(), dir) { + t.Errorf("missing file: %v", err) + } +} diff --git a/internal/config/config.go b/internal/config/config.go new file mode 100644 index 0000000..9539cb2 --- /dev/null +++ b/internal/config/config.go @@ -0,0 +1,150 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +// Package config reads the relay's settings from the environment. Every secret comes from the environment or a +// mounted file, never from source. +package config + +import ( + "errors" + "fmt" + "net/mail" + "net/url" + "strconv" + "strings" +) + +// Config is the relay's settings. +type Config struct { + ListenAddr string + // PublicURL is where operators and apps reach the relay; every mailed link is built from it. + PublicURL *url.URL + // DatabasePath is the SQLite file. + DatabasePath string + // FirebaseCredentials is the path of the service-account key file, for Android. Empty only in dev mode. + FirebaseCredentials string + // APNsKey is the path of the .p8 token key, for iOS; APNsKeyID and APNsTeamID name it and APNsTopic is the app's + // bundle ID. Empty only in dev mode. + APNsKey, APNsKeyID, APNsTeamID, APNsTopic string + SMTPHost string + SMTPPort int + SMTPUsername string + SMTPPassword string + SMTPFrom string + SMTPStartTLS bool + // AdminEmail receives notices of new servers and automatic suspensions. Empty sends none. + AdminEmail string + // TrustProxy takes the client address from the last X-Forwarded-For entry, for running behind Caddy. + TrustProxy bool + // DevMode logs mail and pushes instead of sending them, and lets the domain check reach plain http and private + // addresses. Never on in production. + DevMode bool +} + +// Load reads the configuration through getenv. +func Load(getenv func(string) string) (Config, error) { + c := Config{ + ListenAddr: or(getenv("PUSH_LISTEN_ADDR"), ":8080"), + DatabasePath: or(getenv("PUSH_DATABASE_PATH"), "/data/beacon-push.db"), + FirebaseCredentials: strings.TrimSpace(getenv("PUSH_FIREBASE_CREDENTIALS")), + APNsKey: strings.TrimSpace(getenv("PUSH_APNS_KEY")), + APNsKeyID: strings.TrimSpace(getenv("PUSH_APNS_KEY_ID")), + APNsTeamID: strings.TrimSpace(getenv("PUSH_APNS_TEAM_ID")), + APNsTopic: strings.TrimSpace(getenv("PUSH_APNS_TOPIC")), + SMTPHost: strings.TrimSpace(getenv("PUSH_SMTP_HOST")), + SMTPUsername: getenv("PUSH_SMTP_USERNAME"), + SMTPPassword: getenv("PUSH_SMTP_PASSWORD"), + SMTPFrom: strings.TrimSpace(getenv("PUSH_SMTP_FROM")), + AdminEmail: strings.TrimSpace(getenv("PUSH_ADMIN_EMAIL")), + } + var err error + if c.DevMode, err = boolean(getenv, "PUSH_DEV_MODE", false); err != nil { + return Config{}, err + } + if c.TrustProxy, err = boolean(getenv, "PUSH_TRUST_PROXY", false); err != nil { + return Config{}, err + } + if c.SMTPStartTLS, err = boolean(getenv, "PUSH_SMTP_STARTTLS", true); err != nil { + return Config{}, err + } + c.SMTPPort = 587 + if v := getenv("PUSH_SMTP_PORT"); v != "" { + if c.SMTPPort, err = strconv.Atoi(v); err != nil || c.SMTPPort < 1 || c.SMTPPort > 65535 { + return Config{}, errors.New("PUSH_SMTP_PORT must be between 1 and 65535") + } + } + + raw := strings.TrimRight(strings.TrimSpace(getenv("PUSH_PUBLIC_URL")), "/") + u, err := url.Parse(raw) + if raw == "" || err != nil || u.Host == "" || u.User != nil || u.RawQuery != "" || u.Fragment != "" || (u.Path != "" && u.Path != "/") { + return Config{}, errors.New("PUSH_PUBLIC_URL must be the relay's base URL, e.g. https://push.meshcorebeacon.ca") + } + if u.Scheme != "https" && !(c.DevMode && u.Scheme == "http") { + return Config{}, errors.New("PUSH_PUBLIC_URL must be https") + } + u.Path = "" + c.PublicURL = u + + if c.DevMode { + return c, nil + } + if c.FirebaseCredentials == "" { + return Config{}, errors.New("PUSH_FIREBASE_CREDENTIALS: required, the path of the Firebase service-account key file") + } + if c.APNsKey == "" { + return Config{}, errors.New("PUSH_APNS_KEY: required, the path of the APNs .p8 key file") + } + if !appleID(c.APNsKeyID) { + return Config{}, errors.New("PUSH_APNS_KEY_ID: required, the 10-character ID of the APNs key") + } + if !appleID(c.APNsTeamID) { + return Config{}, errors.New("PUSH_APNS_TEAM_ID: required, the 10-character Apple team ID") + } + if c.APNsTopic == "" || strings.ContainsAny(c.APNsTopic, " /") { + return Config{}, errors.New("PUSH_APNS_TOPIC: required, the app's bundle ID, e.g. meshcorebeacon.app") + } + if c.SMTPHost == "" { + return Config{}, errors.New("PUSH_SMTP_HOST: required, registration works by mailed links") + } + if _, err := mail.ParseAddress(c.SMTPFrom); err != nil { + return Config{}, errors.New("PUSH_SMTP_FROM: required, one address, e.g. \"Beacon Push \"") + } + if c.AdminEmail != "" { + if _, err := mail.ParseAddress(c.AdminEmail); err != nil { + return Config{}, errors.New("PUSH_ADMIN_EMAIL: not a valid address") + } + } + return c, nil +} + +// appleID is the shape of Apple key and team IDs: 10 upper-case letters or digits. +func appleID(v string) bool { + if len(v) != 10 { + return false + } + for _, c := range v { + if (c < 'A' || c > 'Z') && (c < '0' || c > '9') { + return false + } + } + return true +} + +func or(v, def string) string { + if v = strings.TrimSpace(v); v != "" { + return v + } + return def +} + +func boolean(getenv func(string) string, key string, def bool) (bool, error) { + v := strings.TrimSpace(getenv(key)) + if v == "" { + return def, nil + } + b, err := strconv.ParseBool(v) + if err != nil { + return false, fmt.Errorf("%s must be true or false", key) + } + return b, nil +} diff --git a/internal/config/config_test.go b/internal/config/config_test.go new file mode 100644 index 0000000..c35450e --- /dev/null +++ b/internal/config/config_test.go @@ -0,0 +1,82 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package config + +import ( + "strings" + "testing" +) + +func env(m map[string]string) func(string) string { return func(k string) string { return m[k] } } + +func prod() map[string]string { + return map[string]string{ + "PUSH_PUBLIC_URL": "https://push.meshcorebeacon.ca/", + "PUSH_FIREBASE_CREDENTIALS": "/run/secrets/firebase.json", + "PUSH_APNS_KEY": "/run/secrets/apns.p8", + "PUSH_APNS_KEY_ID": "ABC123DEFG", + "PUSH_APNS_TEAM_ID": "TEAM123456", + "PUSH_APNS_TOPIC": "meshcorebeacon.app", + "PUSH_SMTP_HOST": "mail.example.ca", + "PUSH_SMTP_FROM": "Beacon Push ", + } +} + +func TestLoadProduction(t *testing.T) { + c, err := Load(env(prod())) + if err != nil { + t.Fatal(err) + } + if c.PublicURL.String() != "https://push.meshcorebeacon.ca" || c.ListenAddr != ":8080" || c.SMTPPort != 587 || !c.SMTPStartTLS || + c.DatabasePath != "/data/beacon-push.db" || c.DevMode || c.TrustProxy || c.APNsKey != "/run/secrets/apns.p8" || + c.APNsKeyID != "ABC123DEFG" || c.APNsTeamID != "TEAM123456" || c.APNsTopic != "meshcorebeacon.app" { + t.Fatalf("%+v", c) + } +} + +func TestLoadRefusesIncompleteProduction(t *testing.T) { + for key, want := range map[string]string{ + "PUSH_PUBLIC_URL": "PUSH_PUBLIC_URL", + "PUSH_FIREBASE_CREDENTIALS": "PUSH_FIREBASE_CREDENTIALS", + "PUSH_APNS_KEY": "PUSH_APNS_KEY", + "PUSH_APNS_KEY_ID": "PUSH_APNS_KEY_ID", + "PUSH_APNS_TEAM_ID": "PUSH_APNS_TEAM_ID", + "PUSH_APNS_TOPIC": "PUSH_APNS_TOPIC", + "PUSH_SMTP_HOST": "PUSH_SMTP_HOST", + "PUSH_SMTP_FROM": "PUSH_SMTP_FROM", + } { + m := prod() + delete(m, key) + if _, err := Load(env(m)); err == nil || !strings.Contains(err.Error(), want) { + t.Errorf("without %s: %v", key, err) + } + } + for key, val := range map[string]string{ + "PUSH_PUBLIC_URL": "http://push.meshcorebeacon.ca", + "PUSH_SMTP_PORT": "70000", + "PUSH_DEV_MODE": "maybe", + "PUSH_ADMIN_EMAIL": "not an address", + "PUSH_APNS_KEY_ID": "abc123defg", + "PUSH_APNS_TEAM_ID": "TEAM12345", + "PUSH_APNS_TOPIC": "bad topic", + } { + m := prod() + m[key] = val + if _, err := Load(env(m)); err == nil || !strings.Contains(err.Error(), key) { + t.Errorf("%s=%s: %v", key, val, err) + } + } + m := prod() + m["PUSH_PUBLIC_URL"] = "https://push.meshcorebeacon.ca/sub" + if _, err := Load(env(m)); err == nil { + t.Error("a path in PUSH_PUBLIC_URL must be refused") + } +} + +func TestLoadDevMode(t *testing.T) { + c, err := Load(env(map[string]string{"PUSH_DEV_MODE": "true", "PUSH_PUBLIC_URL": "http://localhost:8080"})) + if err != nil || !c.DevMode || c.PublicURL.Scheme != "http" { + t.Fatalf("%+v %v", c, err) + } +} diff --git a/internal/disposable/disposable.go b/internal/disposable/disposable.go new file mode 100644 index 0000000..f756d8c --- /dev/null +++ b/internal/disposable/disposable.go @@ -0,0 +1,40 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +// Package disposable knows the throwaway email domains registration refuses. The list is the CC0 +// disposable-email-domains blocklist, vendored as list.txt. +package disposable + +import ( + _ "embed" + "strings" +) + +//go:embed list.txt +var raw string + +var domains = func() map[string]struct{} { + m := map[string]struct{}{} + for _, line := range strings.Split(raw, "\n") { + if d := strings.ToLower(strings.TrimSpace(line)); d != "" && !strings.HasPrefix(d, "#") { + m[d] = struct{}{} + } + } + return m +}() + +// Blocked reports whether the domain, or any domain it sits under, is a disposable mail provider. +func Blocked(domain string) bool { + d := strings.TrimSuffix(strings.ToLower(strings.TrimSpace(domain)), ".") + for d != "" { + if _, ok := domains[d]; ok { + return true + } + i := strings.IndexByte(d, '.') + if i < 0 { + return false + } + d = d[i+1:] + } + return false +} diff --git a/internal/disposable/disposable_test.go b/internal/disposable/disposable_test.go new file mode 100644 index 0000000..51decaf --- /dev/null +++ b/internal/disposable/disposable_test.go @@ -0,0 +1,25 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package disposable + +import "testing" + +func TestBlocked(t *testing.T) { + for d, want := range map[string]bool{ + "mailinator.com": true, + "MAILINATOR.COM.": true, + "inbox.mailinator.com": true, + "gmail.com": false, + "example.ca": false, + "": false, + "com": false, + } { + if got := Blocked(d); got != want { + t.Errorf("Blocked(%q) = %v, want %v", d, got, want) + } + } + if len(domains) < 1000 { + t.Fatalf("blocklist looks truncated: %d domains", len(domains)) + } +} diff --git a/internal/disposable/list.txt b/internal/disposable/list.txt new file mode 100644 index 0000000..082d8ca --- /dev/null +++ b/internal/disposable/list.txt @@ -0,0 +1,10299 @@ +0-mail.com +0-mailer.dynv6.net +000-webmail.myhome-server.de +000000000000000.theworkpc.com +000000000000000000.dynv6.net +000webmail.ddnss.de +000webmail.ddnss.org +000webmail.dyn-ip24.de +000webmail.dyn.ddnss.de +000webmail.dyn.home-webserver.de +000webmail.dyndns.ddnss.de +000webmail.dyndns1.de +000webmail.home-webserver.de +00jac.com +01022.hk +010530.xyz +01130.hk +020307.xyz +027168.com +045692.xyz +062e.com +0815.ru +0815.su +0845.ru +092088.xyz +0box.eu +0cd.cn +0clickemail.com +0cpub2.tech +0n0ff.net +0nelce.com +0rg.fr +0v.ro +0w.ro +0wnd.net +0wnd.org +0x207.info +1-8.biz +1-mintue-mail.ddnsgeek.com +1-second-mail.site +1-tm.com +10-minute-mail.com +1000acres.co.uk +1000rebates.stream +100likers.com +102.io.vn +103.ink +105kg.ru +10dk.email +10inbox.online +10mail.com +10mail.org +10mail.tk +10mail.xyz +10min.email +10minemail.com +10minmail.de +10minmail.org +10minut.com.pl +10minut.xyz +10minute.email +10minutemail.be +10minutemail.cf +10minutemail.co.uk +10minutemail.co.za +10minutemail.com +10minutemail.de +10minutemail.ga +10minutemail.gq +10minutemail.ml +10minutemail.net +10minutemail.nl +10minutemail.pro +10minutemail.us +10minutemailbox.com +10minutemails.in +10minutenemail.de +10minutenmail.xyz +10minutesmail.com +10minutesmail.fr +10minutmail.pl +10timer.com +10x9.com +1111111111111.dynv6.net +11163.com +11166666.xyz +114514279.xyz +115yu.cc.cd +123-m.com +12312312312.cfd +123312.cc.cd +1234211.xyz +123456789.life +123clone.com +123mails.org +12bclass.us +12friday.space +12hosting.net +12houremail.com +12minutemail.com +12minutemail.net +12storage.com +130723.xyz +13282298.xyz +1337.care +13512863687.store +140unichars.com +142code.me +147.cl +14club.org.uk +14n.co.uk +151668.xyz +15553.eu.cc +15555.eu.cc +15557.eu.cc +15963.fr.nf +15qm.com +164109038.xyz +16816889.xyz +179297.xyz +17tb.io.vn +1820mail.vip +189.email +18lover.com +18t5b.shop +191117636.cfd +191mariobet.com +199411.store +1bin.sbs +1blackmoon.com +1ce.us +1chuan.com +1clck2.com +1fsdfdsfsdf.tk +1mail.lt +1mail.ml +1nom.org +1pad.de +1pice.io.vn +1s.fr +1sec.site +1secmail.com +1secmail.net +1secmail.org +1secmail.space +1secmail.website +1st-forms.com +1sworld.com +1t-mail.com +1to1mail.org +1trick.net +1usemail.com +1webmail.info +1win.life +1xp.fr +1zhuan.com +2-b.icu +200192.indevs.in +20030310.com +2003066.xyz +2012-2016.ru +20253025.xyz +20260501.ccwu.cc +20260503.ccwu.cc +202608221.xyz +2048unblocked.com +20email.eu +20email.it +20mail.eu +20mail.in +20mail.it +20minutemail.com +20minutemail.it +20minutesmail.com +20mm.eu +2120001.net +216222.xyz +21cn.com +21mail.top +2200freefonts.com +22345377.xyz +2333.live +247airconrepair.xyz +247chats.com +247coolcare.xyz +247fixit.xyz +247hvacservice.xyz +247web.net +24faw.com +24hinbox.com +24hourmail.com +24hourmail.net +24mail.top +24x7fixit.xyz +24x7hvac.xyz +25kcreditveo3.io.vn +25kg2gveo3.io.vn +25kmans.io.vn +25kmembers.io.vn +25kseller.io.vn +25kselll.io.vn +25kveo.io.vn +25kveo3.io.vn +25kvideo.io.vn +25u.com +264341.xyz +269966.xyz +2932919455.dynv6.net +2anom.com +2chmail.net +2ether.net +2fdgdfgdfgdf.tk +2likemobile.site +2likemobile.tech +2likemobile.top +2likemobile.xyz +2mail.eu.cc +2odem.com +2prong.com +2wc.info +300book.info +30mail.ir +30minutemail.com +30wave.com +3202.com +32132.ccwu.cc +326645.indevs.in +326646.indevs.in +326646302.indevs.in +3333366.xyz +3435637.xyz +365boxmail.com +36duongtau.live +36ru.com +37xiao.com +38yz.help +39393.eu.cc +39393.me +3a88.dev +3bbb.cc.cd +3d-painting.com +3dkai.com +3fdn.com +3jf.cn +3l6.com +3littlemiracles.com +3mail.ga +3trtretgfrfe.tk +3xu.studio +4-n.us +401010.xyz +4057.com +415dacjder.qzz.io +418.dk +42o.org +42web.io +45kg2gveo3.io.vn +45kselller.io.vn +45kveo.io.vn +45kveo3.io.vn +48dz.com +48hr.email +497000.xyz +499713376.xyz +4bbb.cc.cd +4bus.io.vn +4gfdsgfdgfd.tk +4jcescis.icu +4k5.net +4mail.cf +4mail.ga +4nextmail.com +4nmv.ru +4pu.com +4save.net +4tb.host +4warding.com +4warding.net +4warding.org +50set.ru +51baidu.tech +51mail.shop +51www.us +521883.xyz +522885.xyz +52mails.com +55hosting.net +5ghgfhfghfgh.tk +5gramos.com +5ixmonth.xyz +5july.org +5mail.cf +5mail.ga +5minutemail.net +5oz.ru +5rrs7gyd.icu +5semail.com +5tb.in +5x25.com +5xu.vn +5y.loseyourip.com +5yaochu.top +5ymail.com +60minutemail.com +628868.xyz +636364.xyz +66-77.cc +662602718.xyz +668fmail.com +66b1it.eu.org +672643.net +675hosting.com +675hosting.net +675hosting.org +6789.io.vn +67899vip.com +681mail.com +689345.xyz +6974.click +69flix.site +6gdfg.zone.id +6hjgjhgkilkj.tk +6ip.us +6mail.cf +6mail.ga +6mail.ml +6n9.net +6paq.com +6somok.ru +6th.pp.ua +6url.com +6ys.tech +709183.freeddns.org +719182.accesscam.org +729406.xyz +7362354.xyz +75hosting.com +75hosting.net +75hosting.org +778891.icu +78.edu.kg +78.school +78511939.xyz +792792.xyz +794613.accesscam.org +7days-printing.com +7mail.ga +7mail.ml +7novels.com +7tags.com +7xusq8vbim5d47.icu +80665.com +80fight.cn +8127ep.com +816qs.com +83.io.vn +84kif0sx.icu +862808.xyz +875888.xyz +88cloud.cc +8d7kh.com +8mail.cf +8mail.ga +8mail.ml +911666.xyz +912684.abrdns.com +91tanhua.top +920325.xyz +931123.xyz +94587293.xyz +94an.com +950410.xyz +957jp.cc +971007.xyz +981027.xyz +98104.cn +99.com +992551.xyz +99cows.com +99experts.com +99mail.us +9mail.cf +9me.site +9mot.ru +9ox.net +9q.ro +a--i.top +a-bc.net +a-germandu.de +a45.in +a7996.com +aa5zy64.com +aaago.cyou +aabkmail.com +aachendate.de +aaconservation.org +aahzz.com +aakingcompany.shop +aakk.link +aakkmail.com +aaoo.me +aaqwe.ru +aaqwe.store +aard.org.uk +aasdarq.eu.cc +aasdasd.eu.cc +abacuswe.us +abaib.bond +abajb.bond +abakiss.com +abalb.bond +abamb.bond +abanb.bond +abapb.bond +abasb.bond +abatido.com +abaub.bond +abaxb.bond +abayb.bond +abazb.bond +abbellerfani.co.uk +abc179312.shop +abcmail.email +aberllefenni.co.uk +abevw.com +abilityaccesslegal.org +abilitywe.us +abo-free.fr.nf +aboodbab.com +abouse.space +abovewe.us +abowned.com +absolutewe.us +abundantwe.us +abusemail.de +abuser.eu +abusultann.com +abusultansmarty.co.uk +abusultanvip.com +abusultanvipo2.co.uk +abyis.com +abyssmail.com +ac-malin.fr.nf +ac20mail.in +academiccommunity.com +academywe.us +acaic.bond +acalbarsha.xyz +acanok.com +acc1s.com +acc1s.net +accare.xyz +accclone.com +acceleratewe.us +accentwe.us +acceptwe.us +accheckup.xyz +accis.net +acclaimwe.us +accora.io.vn +accordwe.us +accountscenter.support +accreditedwe.us +acdag.indevs.in +acdesk.xyz +acdoctors.xyz +acedby.com +acexpertsdxb.xyz +acg-news.com +acgdb.eu.org +acgn.click +acgnnews.com +acheroesdubai.xyz +acherouae.xyz +achievementwe.us +achievewe.us +acidservices.xyz +acmudon.xyz +acornwe.us +acprosdxb.xyz +acqq.dev +acreadingroom.co.uk +acrepairuae.xyz +acrossgracealley.com +acrylicwe.us +acservicesdxb.xyz +acservicesuae.xyz +acserviceuae.xyz +actarus.infos.st +activatewe.us +activitywe.us +actuneupuae.xyz +acucre.com +acuitywe.us +acumenwe.us +aczabeel.xyz +aczonedubai.xyz +aczonedxb.xyz +aczoneuae.xyz +ad-managment.run.place +adaid.bond +adaptivewe.us +adaptwe.us +adarsa.me +adawd.bond +add3000.pp.ua +addadsasd.icu +addictingtrailers.com +addmails.com +addrin.uk +addyourcustomdoaminhere.store +addyourdoaminhere.online +addyourdoaminhere.sbs +addyourdoaminhere.site +addyourdoaminhere.store +adeptwe.us +adfskj.com +adios.email +adiq.eu +aditus.info +admiralwe.us +adn3t.com +ado888.biz +adobeccepdm.com +adoniswe.us +ados.cc.cd +adpugh.org +adresse.infos.st +adroh.com +ads24h.top +adsd.org +adsensekorea.com +adsjii.xyz +adubiz.info +adult-work.info +adv-dep-eng.jo3.org +advantagewe.us +advantageyoungpeople.com +advantimo.com +adventurewe.us +adventwe.us +advertisehereon.tech +advisorwe.us +advitise.com +advocatewe.us +adwaterandstir.com +aeace.bond +aeale.bond +aeame.bond +aeape.bond +aeare.bond +aeaue.bond +aeaxe.bond +aebz.makeup +aecmedya.com +aeerso.space +aegde.com +aegia.net +aegiscorp.net +aegiswe.us +aelo.es +aeonpsi.com +aerionx25k.io.vn +aeronyx.cfd +aesel.me +aetheron.cfd +afalf.bond +afarek.com +afarf.bond +afeeyah.store +affecting.org +affiliate-nebenjob.info +affiliatedwe.us +affilikingz.de +affinitywe.us +affluentwe.us +affordablewe.us +afgpuk.co.uk +afia.pro +afrobacon.com +afse-gh.top +aftercorporation.com +afterhourswe.us +afternea.sbs +afuyo.com +afw.fr.nf +ag77brc.ddnsfree.com +agabg.bond +agaexpress.com +agallagher.id +agedmail.com +agencysq.store +agendawe.us +agenpremium.store +agent.qq.com +agentloop.sbs +agger.ro +agilewe.us +agiuse.com +agmbowie.com +agorawe.us +agri4life.io.vn +agtx.net +agylzuv.top +ahavaexperience.com +aheadwe.us +ahem.email +ahk.jp +ahmadfamily.net +ahmadizhar.net +ahmedkhlef.com +ahvin.com +ai100999.com +ai666666.me +aiaccount.click +aiapes.publicvm.com +aibase.bond +aiclit.asia +aidesign.work.gd +aidesigner.2bd.net +aifmusic.top +aifreeuk.com +aifreeuk.info +aifreeuk.net +aifreeuk.store +aigcdog.com +aihubtools.space +aihuohua.online +aikunkun.com +ailicke.com +aineapi.com +aiphotoeditor.io +aiphotoenhancer.me +aiqseo.com +air2token.com +airconakoya.xyz +airconalquoz.xyz +airconcare.xyz +airconcitywalk.xyz +airconcleaningdubai.xyz +airconcompanyuae.xyz +airconcontractingdxb.xyz +airconcontractinguae.xyz +airconcontractors.xyz +airconcrew.xyz +airconcrewdubai.xyz +aircondcare.xyz +aircondcleaning.xyz +aircondeskdubai.xyz +aircondeskuae.xyz +aircondmedic.xyz +aircondtuneup.xyz +aircondworks.xyz +airconemaar.xyz +airconexpert.xyz +airconfestivalcity.xyz +airconfixdxb.xyz +airconinstallersuae.xyz +airconlabuae.xyz +airconmaintenancedubai.xyz +airconmaintenanceuae.xyz +airconmiddleeast.xyz +airconmudon.xyz +airconnadalsheba.xyz +airconprodubai.xyz +airconpros.xyz +airconprosuae.xyz +airconservicedxb.xyz +airconservicesuae.xyz +airconserviceuae.xyz +aircontechdxb.xyz +aircontechuae.xyz +airconzone.xyz +airconzonedxb.xyz +aircoolmedic.xyz +aircourriel.com +airhemp.com +airmailbox.website +airsworld.net +airychen.com +aisub.store +aisubpro.click +aisubstore.click +aisupply.click +aiuu.tech +aiworldx.com +aixnv.com +aizhongzhuan.cc +ajaxapp.net +ajinimoto.me +ak02fca.loseyourip.com +ak6lay.shop +akapost.com +akashv1.cfd +akbip.com +akerd.com +akfoin.us.ci +akgq701.com +akhl.autos +akirapowered.com +akjaey.space +akmail.in +akolay.tech +akugu.com +akunlama.com +akunlemah.biz.id +al-qaeda.us +al1ya.app +alarafoundation.com +albarshamaintenance.com +albill.com +albionwe.us +alchemywe.us +aleh.de +alfaceti.com +alfurjanmaintenance.com +alhsalumni.org +aliaswe.us +aliban.org +alienware13.com +aligamel.com +alightmotion.cloud +alightmotion.id +alightmotion.top +alightmotion.website +aligroup.uk +alilot.com +alin.cc.cd +alin.eu.cc +alina-schiesser.ch +alisaol.com +alisongamel.com +alisree.com +alivance.com +alivewe.us +alkhawaneejmaintenance.com +all-cats.ru +allaccesswe.us +allamericanwe.us +allaroundwe.us +alldayaccare.xyz +alldirectbuy.com +allegiancewe.us +allegrowe.us +allemojikeyboard.com +allez.io.vn +allfreemail.net +allgoodwe.us +alliancewe.us +allinaircond.xyz +allinamcmaintenance.xyz +allinhvactech.xyz +allinonewe.us +allofthem.net +alloutwe.us +allowed.org +alloywe.us +allprowe.us +allreview4u.com +allseasonswe.us +allstarwe.us +allthegoodnamesaretaken.org +allumhall.co.uk +allurewe.us +allwebemails.com +almatips.com +almiswelfare.org +almondwe.us +alosp.com +alph.wtf +alpha-web.net +alphaairconfix.xyz +alphaamcmaintenance.xyz +alphacooltech.xyz +alphafancoil.xyz +alphaomegawe.us +alphatronic25k.io.vn +alphax.fr.nf +alpinewe.us +alreval.com +altairwe.us +altitudewe.us +altmails.com +altrans.fr.nf +altuswe.us +aluimport.com +alvaxio.com +alves.fr.nf +alwayss.uno +ama-trade.de +ama-trans.de +amadeuswe.us +amail.club +amail.com +amail1.com +amail4.me +amazinggift.life +amazingly.online +amazon-aws.org +amberheadline.buzz +amberwe.us +ambiancewe.us +ambitiouswe.us +amccare.xyz +amccompanydubai.xyz +amccompanyuae.xyz +amccontractingdxb.xyz +amccrewdxb.xyz +amcexpertsuae.xyz +amcfixitdubai.xyz +amcfixuae.xyz +amcguysdxb.xyz +amchandymanuae.xyz +amchubdubai.xyz +amchubdxb.xyz +amcjlt.xyz +amclabuae.xyz +amcmaintdubai.xyz +amcmaintenancedxb.xyz +amcmaintenancemarina.xyz +amcmandxb.xyz +amcpointtower.xyz +amcservice.xyz +amcshielddubai.xyz +amcteam.xyz +amctilal.xyz +amcvictory.xyz +amcworkstower.xyz +amcworksvilla.xyz +ameady.com +ameeppoossaa.dedyn.io +amelabs.com +americanawe.us +americancivichub.com +americasbestwe.us +americaswe.us +amex409.monster +amicuswe.us +amilegit.com +aminating.com +aminavin.com +amiri.net +amiriindustries.com +amiyah.cloud +amiyiy.xyz +amplewe.us +amplifiedwe.us +amplifywe.us +ampsylike.com +anajakstore.site +analogwe.us +analysiswe.us +analyticalwe.us +analyticswe.us +analyticwe.us +anappfor.com +anappthat.com +anarac.com +anbinh.io.vn +andalanglobal.app +andreihusanu.ro +andrewclaude.eu +andrewclaude.fr +andrewclaude.org +andrewclaude.store +andrewcluh.top +androl.cfd +andthen.us +angiiidayyy.click +anhiqojkaq1.abrdns.com +anhvip9999.com +anie.io.vn +animesos.com +aniross.com +anit.ro +ankiclub.space +ann.qzz.io +annd.us +annnekkk.com +ano-mail.net +ano2.co.uk +anogz.com +anon-mail.de +anonbox.net +anonmail.top +anonmails.de +anonymail.dk +anonymbox.com +anonymized.org +anonymousness.com +anotherdomaincyka.tk +anquandx.com +ansibleemail.com +anthony-junkmail.com +anti.io.vn +antireg.com +antireg.ru +antispam.de +antispam.fr.nf +antispam24.de +antispammail.de +antttool.us +anversa.com.co +anvjobvnu.top +any.pink +anyalias.com +anypng.com +anytimecoolrepair.xyz +anytimerepairs.xyz +anywebmail.com +aobl.hair +aoeuhtns.com +aohl.io.vn +aokkad.com +aokkap.my.id +aokkas.com +aoyh.hair +ap535fu.ddnsfree.com +ape-tech.run.place +apedesigns.jo3.org +apedesigns.linkpc.net +apes-ai.linkpc.net +apex.io.vn +apexnovaser.com +apexone.top +apexrepair24x7.xyz +apexrepairs.xyz +apexthermo.xyz +apfelkorps.de +aphlog.com +apimi.icu +apkmd.com +apocaw.com +appbott.com +appc.se +appinventor.nl +appixie.com +apple.edu.pl +appmail.uk +appremiums.pro +apps.dj +appsdjheru.site +appzily.com +aprinastore.web.id +aprte.com +aqilakomputer.com +aqim.skin +aquaguide.ru +ar26710.cc.cd +arabianranchesmaintenance.com +arapgege.app +arapps.me +arcadein.com +arcadium.lat +arcentra.cfd +arcticairconrepair.xyz +arcticcoolair.xyz +arcticcoolcare.xyz +arcticfreon.xyz +ardsp.shop +arduino.hk +arenahiveai.com +ares.edu.pl +ares.io.vn +ariaz.jetzt +arkoo.site +armyspy.com +aron.us +arrabyte.com +arrb.autos +arroisijewellery.com +art-en-ligne.pro +art2mart.com +artegin.com +arthiq.life +artleoncommunications.com +artman-conception.com +artsdigi.store +artsdigital.store +arur01.tk +arurgitu.gq +arvato-community.de +arxxwalls.com +asajv2ray.site +asaption.com +aschenbrandt.net +asciibinder.net +asd903102.online +asdascas.dpdns.org +asdasd.nl +asdasd.ru +asdasdasd.cfd +asdcxijkj.eu.cc +asedeeqaweds.dedyn.io +asgzs.top +ashgroveventures.net +ashleyandrew.com +ashnkarsh.life +asia-hq.jo3.org +asiafootball.org.uk +asimarif.com +asistx.net +ask-mail.com +ask15da.party +asleepity.com +asorent.com +aspireviastudios.org +ass.pp.ua +assetactech.xyz +assetaircon.xyz +assetairconcare.xyz +assetaircond.xyz +assetaircool.xyz +assethvacrepair.xyz +assetmaintenance.xyz +assetscaredubai.xyz +assetsdesk.xyz +assurmail.net +astonut.tk +astroempires.info +asu.mx +asu.su +asurad.com +at.hm +at0mik.org +atelierdelune.shop +atkshop.shop +atkshopp.space +atlas4381.me +atlasimple.com +atlasstitch.cfd +atmemail.top +atnet.top +atnetcloud.space +atnextmail.com +atomauto.vn +atombomb.online +attnetwork.com +atxc.space +au1688x.us +aubady.com +augmentationtechnology.com +aumails.us +auralith.cfd +aureliandata.space +ausgefallen.info +auth2fa.com +auti.st +autofixmax.com +automisly.org +automizelymail.info +automizly.net +autommo.net +autorobotica.com +autosouvenir39.ru +autotwollow.com +autowb.com +autoxugiare.com +autre.fr.nf +autu11n.lol +available-home.com +avalentra.cfd +averdov.com +avia-tonic.fr +avifcove.me +avls.pt +avq69cb.loseyourip.com +avtolev.com +awa.pics +awatum.de +awdrt.org +awesome47.com +awesomesaucemail.org +awgarstone.com +awiki.org +awoiiwowma11001.indevs.in +aws-mail-2.dynv6.net +aws-mail-free-1017.dynv6.net +aws-mail-free-102.dynv6.net +aws-mail-free-1056.dynv6.net +aws-mail-free-1304.dynv6.net +aws-mail-free-1705.dynv6.net +aws-mail-free-1842.dynv6.net +aws-mail-free-1884.dynv6.net +aws-mail-free-2156.dynv6.net +aws-mail-free-2236.dynv6.net +aws-mail-free-2290.dynv6.net +aws-mail-free-2383.dynv6.net +aws-mail-free-2409.dynv6.net +aws-mail-free-2454.dynv6.net +aws-mail-free-2524.dynv6.net +aws-mail-free-2704.dynv6.net +aws-mail-free-2737.dynv6.net +aws-mail-free-2775.dynv6.net +aws-mail-free-2795.dynv6.net +aws-mail-free-2845.dynv6.net +aws-mail-free-2892.dynv6.net +aws-mail-free-2906.dynv6.net +aws-mail-free-2923.dynv6.net +aws-mail-free-3038.dynv6.net +aws-mail-free-3335.dynv6.net +aws-mail-free-3381.dynv6.net +aws-mail-free-3620.dynv6.net +aws-mail-free-3711.dynv6.net +aws-mail-free-3796.dynv6.net +aws-mail-free-385.dynv6.net +aws-mail-free-4014.dynv6.net +aws-mail-free-4017.dynv6.net +aws-mail-free-4131.dynv6.net +aws-mail-free-4206.dynv6.net +aws-mail-free-4257.dynv6.net +aws-mail-free-4289.dynv6.net +aws-mail-free-4531.dynv6.net +aws-mail-free-4550.dynv6.net +aws-mail-free-4573.dynv6.net +aws-mail-free-4711.dynv6.net +aws-mail-free-4726.dynv6.net +aws-mail-free-4761.dynv6.net +aws-mail-free-4816.dynv6.net +aws-mail-free-4885.dynv6.net +aws-mail-free-4920.dynv6.net +aws-mail-free-493.dynv6.net +aws-mail-free-4937.dynv6.net +aws-mail-free-5119.dynv6.net +aws-mail-free-518.dynv6.net +aws-mail-free-5241.dynv6.net +aws-mail-free-5380.dynv6.net +aws-mail-free-5392.dynv6.net +aws-mail-free-5537.dynv6.net +aws-mail-free-5670.dynv6.net +aws-mail-free-5781.dynv6.net +aws-mail-free-5786.dynv6.net +aws-mail-free-5969.dynv6.net +aws-mail-free-6032.dynv6.net +aws-mail-free-6033.dynv6.net +aws-mail-free-6080.dynv6.net +aws-mail-free-6120.dynv6.net +aws-mail-free-6253.dynv6.net +aws-mail-free-6255.dynv6.net +aws-mail-free-6306.dynv6.net +aws-mail-free-6398.dynv6.net +aws-mail-free-6552.dynv6.net +aws-mail-free-659.dynv6.net +aws-mail-free-6604.dynv6.net +aws-mail-free-6690.dynv6.net +aws-mail-free-6691.dynv6.net +aws-mail-free-6762.dynv6.net +aws-mail-free-6826.dynv6.net +aws-mail-free-7145.dynv6.net +aws-mail-free-7149.dynv6.net +aws-mail-free-7153.dynv6.net +aws-mail-free-7194.dynv6.net +aws-mail-free-7358.dynv6.net +aws-mail-free-7477.dynv6.net +aws-mail-free-764.dynv6.net +aws-mail-free-7654.dynv6.net +aws-mail-free-7838.dynv6.net +aws-mail-free-7849.dynv6.net +aws-mail-free-788.dynv6.net +aws-mail-free-7897.dynv6.net +aws-mail-free-8085.dynv6.net +aws-mail-free-8091.dynv6.net +aws-mail-free-8205.dynv6.net +aws-mail-free-8225.dynv6.net +aws-mail-free-8467.dynv6.net +aws-mail-free-8475.dynv6.net +aws-mail-free-8741.dynv6.net +aws-mail-free-9015.dynv6.net +aws-mail-free-916.dynv6.net +aws-mail-free-9161.dynv6.net +aws-mail-free-9283.dynv6.net +aws-mail-free-9409.dynv6.net +aws-mail-free-9533.dynv6.net +aws-mail-free-9596.dynv6.net +aws-mail-free-9697.dynv6.net +aws-mail-free-9703.dynv6.net +aws-mail-free-9789.dynv6.net +aws-mail.accesscam.org +aws-mailer.dynv6.net +awsoo.com +ax05.cn +axax.asia +axgrad.io +axin05.icu +axionintellex.shop +axiz.org +axon7zte.com +axrx.hair +axsup.net +ayag.cloud +ayakamail.cf +ayumas.store +az18nep.camdvr.org +azame.pw +azazazatashkent.tk +azcomputerworks.com +azeqsd.fr.nf +azly.autos +azmeil.tk +azulejoslowcost.es +azuretechtalk.net +azurien.cfd +azzancoffee.com +b0h748o.kozow.com +b1of96u.com +b1tvjn3.loseyourip.com +b20nn6.cn +b2bx.net +b2cmail.de +b3j72kr.theworkpc.com +b7s.ru +babyeat.food +babyfun.fun +back67283.eu.cc +back7654.eu.cc +backilnge.com +backyardorbit.me +backyr.com +bacteroidmail.com +badgerland.eu +badoop.com +badopsec.lol +badpotato.tk +baechecker.com +bahitarahero.store +bahitarastarha.store +bahlill.cfd +baicai1145.online +baicai1145.shop +baidoxe.com +baileybridge.org +baipiaodashen.cloud-ip.cc +baiyucraft.sbs +baizoto.shop +bakalos.dpdns.org +bakultelo.com +balaket.com +balawo.com +banana.linkpc.net +bananacomet.lol +bananaspace.shop +banancaocap.com +banclone.pro +bandtoo.com +bangban.uk +bangdieukhien.net +banhang14.com +banit.club +banit.me +bank-opros1.ru +bankinnepal.com +bankwen.com +banri.xyz +baolaowang.com +baqx.autos +bar-ton.store +bareed.ws +barnrestaurant.pro +barooko.com +barry.dpdns.org +barryogorman.com +bartdevos.be +baselogicroute.com +basepathgrid.com +baserda.net +bashyrcn.yachts +basketrise.com +basscode.org +batdongsanhatinh.org +bathdf.co.uk +batiinsaat.net +bauwerke-online.com +baybabes.com +baybumutan.shop +bazaaboom.com +bb28.dev +bbbbyyzz.info +bbfz.makeup +bbhost.us +bbitf.com +bbitj.com +bbitq.com +bbmail.store +bbmailku.com +bboys.fr.nf +bbroot.com +bbwg.one +bbxb.fashion +bbyb.fashion +bcaoo.com +bcast.ws +bcb.ro +bccto.me +bcm.edu.pl +bcmail.pro +bcnet.store +bcnetlite.xyz +bcooq.com +bda.io.vn +bdbdw.cyou +bdgstr.com +bdm.ovh +bdmuzic.pw +bdo.io.vn +bdq8.pw +bdshar.com +beaconmessenger.com +bearsarefuzzy.com +beastmail.space +beatbok.online +beautifulblessingsbeyondborders.org +bebed.cyou +bebel.cyou +beben.cyou +bebez.cyou +beddly.com +beefmilk.com +beelsil.com +beganment.com +begemail.com +begfax1.loseyourip.com +behatifoundation.org +bekasi.me +belamail.org +belfieldcorp.net +belgianairways.com +belicapcut.app +belljonestax.com +beluckygame.com +benipaula.org +benphim.com +benphim.net +benshelf.com +bepureme.com +beribase.ru +beribaza.ru +berirabotay.ru +berkahfb.com +berkahjayashope.com +berwie.com +bespokehaircare.co.uk +best-hosting.biz +best-john-boats.com +best-temp-mail.com +best-vpn.xyz +bestacmaintenance.xyz +bestchoiceusedcar.com +besthvacpro.xyz +bestlistbase.com +bestoption25.club +bestparadize.com +bestsoundeffects.com +besttempmail.com +bestwashae.xyz +beta.edu.pl +betacinder.com +betatensor.com +betr.co +betshubs.com +betteryoutime.com +beyondreasonabledoubt.co.uk +bflcafe.com +bgtmail.com +bgx.ro +bgyiacczy.top +bhana.xyz +bhap.me +bheps.com +bhuxp.org +bidourlnks.com +big1.us +bigmail.lol +bigprofessor.so +bigstring.com +bigwhoop.co.za +bij.pl +bilingva-ca.info +bilingva-ca.store +bin-ich.com +binafex.com +binancepools.cloud +binbx.net +binech.com +binich.com +binka.me +binkmail.com +binnary.com +binsh.kro.kr +bio-muesli.info +bio-muesli.net +biojuris.com +bione.co +bipochub.com +birdharbor.me +birh.hair +birminghamlife.org.uk +bishwanathuk.cc +bitmah.com +bitmens.com +bitproy.com +bitrealm.in +bittnex.com +bitwhites.top +bitymails.us +biubiuwholeworld.cn +biweia615.icu +biyug.com +biz.st +bizimalem-support.de +bizisstance.com +bj41.help +bjorwi.rest +bjvc.top +blackgoldagency.ru +blackmarket.to +bladesmail.net +blakeagency.buzz +blenched.com +blendlog.com +blenro.com +bletilla.cc +bletsoetownclosecharity.bio +blinklaunch.click +blip.ch +blip.ovh +blnkt.net +blobapps.com +block-this-for-gambling.cloud-ip.cc +block521.com +blockare.site +blog3.cc.cd +blogger.nyc.mn +blogmyway.org +blogos.net +blogspam.ro +blogtricks.de +blondemorkin.com +blondmail.com +blpz.hair +bltiwd.com +blueacmaintenance.xyz +blueaircond.xyz +bluecooling.xyz +bluedumpling.info +bluefizzclub.me +bluegrassluck.com +bluehourclub.cyou +bluewaters1.com +bluewaters2.com +bluewerks.com +blushthicket.beauty +bmoar.com +bncinema.com +bnote.com +bnrlner.shop +bnyhr.us +boatmail.us +bobgf.ru +bobgf.store +bobmail.info +bobmurchison.com +bocas.tech +boerakemail.com +bofthew.com +bogchi.com +bokgumail.kr +bokkor1.cyou +bomnet.net +bondmeadow.bond +bonobo.email +boofx.com +bookgame.org +bookthemmore.com +boom.publicvm.com +boom114.ccwu.cc +boommail.online +boostme.es +bootssl.com +bootybay.de +boranora.com +bored.lol +borged.com +borged.net +borged.org +bosakun.com +bosakun.online +boscharena.dev +boshi-gdh.club +bot.cd +bot.nu +botasky.eu.cc +botgetlink.com +botgetlink.net +botnet.my.id +boukshilf.com +boulkfout.lol +boun.cr +bouncr.com +bowlfuel.com +box-mail.ru +box-mail.store +boxem.ru +boxem.store +boxfi.uk +boxformail.in +boximail.com +boxlet.ru +boxlet.store +boxmach.com +boxmail.lol +boxmail1.com +boxomail.live +boxtemp.com.br +boyaga.com +bpotogo.com +bptfp.net +bradingtowntrust.co.uk +brand-app.biz +brandallday.net +brashbeat.online +brasx.org +brazbuzii.online +breaite.com +breakthru.com +breezeamcfix.xyz +breezehvacmaintenance.xyz +breezybundle.shop +brefmail.com +brennendesreich.de +brevionix.cfd +brevitron.cfd +brewlyric.me +bridgetonmainstreet.org +briefalpha.org +briggsmarcus.com +brightaircontech.xyz +brightaircool.xyz +brightamctech.xyz +brightbasketry.shop +brightcoupon.bond +brightfuturescharity.org.uk +brightpeaklet.top +bristolstatehousefoundation.org +brivian.link +broadbandninja.com +brodipek.xyz +brokenion.com +brothershaircut.com +brownjasen.ccwu.cc +browzensew.ca +browzensew.com +browzensew.icu +browzensew.info +browzensw.com +browzensw.info +browzensw.net +browzensw.store +bsfh.beer +bskyx.fun +bsnow.net +bspamfree.org +bspooky.com +bst-72.com +btb-notes.com +btc.email +btcmail.pw +btcmod.com +btizet.pl +btsblock.com +btthyto.org +buccalmassage.ru +budaya-tionghoa.com +budayationghoa.com +buddyfly.top +budgetac.xyz +budgetcoolcare.xyz +budgetfreon.xyz +buffemail.com +bugfoo.com +bugmenever.com +bugmenot.com +buhf95r.ddnsfree.com +buildingamcdubai.xyz +buildingmaintdubai.xyz +buildingrepair.xyz +buildingsmaint.xyz +buildingstechdubai.xyz +bukanimers.com +bukatv8.com +bukhariansiddur.com +bulapolo.site +bullbaby.com +bulrushpress.com +bultoc.com +bum.net +bumail.site +bumpymail.com +bunchofidiots.com +bund.us +bundes-li.ga +bunmail.one +bunnyhub.space +bunsenhoneydew.com +burangir.com +burnermail.bond +burnermail.cyou +burnthespam.info +burry.eu.org +burstmail.info +busd-mmjd3.wiki +business-degree.live +businessbackend.com +businesssuccessislifesuccess.com +buspad.org +bussaco.com +bussinesa.app +bussitussi.com +busyaz.tech +butteiumien.io.vn +buy-blog.com +buyaitools.site +buyapp.foo +buymoreplays.com +buyordie.info +buyreview.us +buyusdomain.com +buyusedlibrarybooks.org +buzzcluby.com +buzzcut.ws +bwingmedia.com +bwm.de5.net +bwmyga.com +bx52ff4a.shop +byagu.com +byconf.com +byebyemail.com +byespm.com +byiepsxqu.top +byjkprh.top +byom.de +bytedigi.com +bytonf.com +bznrehk.giize.com +bzpc.makeup +bzvrxf8.ooguy.com +c-eric.fr.nf +c-newstv.ru +c-pkk.icu +c-tta.top +c14.mobi +c1ph3r.xyz +c28.mobi +c4.fr +c4pro.uk +c51vsgq.com +caainpt.com +cabiste.fr.nf +cachedot.net +cade.org.uk +cafesui.com +caftee.com +caigq.qzz.io +calderstone.net +caldrexa.cfd +calendro.fr.nf +california.edu.pl +californiafitnessdeals.com +calima.asso.st +calirona.com +calmdoorway.homes +calmriver.info +calvarystreetisa.org +cam4you.cc +cameltok.com +camera47.net +cameraity.com +camping-grill.info +cancer-treatment.xyz +candassociates.com +candymail.de +cane.pw +canfga.org +cangcud.com +cangcutku.pro +cankaohe.com +cantozil.com +canvaspace.shop +canvect.com +canyontitan.fun +caowo.online +capct.id +capcud.shop +capcut.digital +capcut.sbs +capcut.space +capcut02.shop +capcutku.io +capcutmeflo.shop +capcutmm.shop +capcutpro.click +capcutpro.dev +capcvt.es +capitalistdilemma.com +caprasolver.xyz +caps7.com +captainacmaintenance.xyz +captus.cyou +capy.gay +caqcut.top +car101.pro +carbtc.net +care-breath.com +caregradeguard.com +careporto.xyz +caresportshub.xyz +carpin.org +cars2.club +carsencyclopedia.com +cartelera.org +caseedu.tk +cashflow35.co +cashflow35.com +casterview.xyz +casualdx.com +catchmail.io +catfie.app +catgroup.uk +catsredeem.com +catterickgarrisonfootballcentre.uk +cauterize.top +cavi.mx +caye.org.uk +cazlg.com +cbair.com +cbasosbr.top +cbdol.mx +cbes.net +cboc.hair +cbsbada.com +cbty.ru +cbty.store +cbvl.co.uk +cc17.name.ng +cc18.name.ng +cc3.name.ng +cc6.name.ng +cc8c1bd6.abrdns.com +ccategoryk.com +ccimran.buzz +cckuy.com +ccm8klz.camdvr.org +ccmail.uk +ccqu.top +ccsuncare.com +cctc.fashion +cctoolz.com +ccwc.fashion +ccxiao.cn +cczc.fashion +cdfaq.com +cdlpvt3.mywire.org +cdnmia.com +cdnripple.com +cdpa.cc +cdxugmy.top +cecizie.web.id +cedarledger.bond +cedarwhisper.homes +ceed.se +cek.pm +cellurl.com +cengrop.com +centermail.com +centermail.net +ceramicdrift.me +certexx.fr.nf +certificenter.com +certve.com +cetpass.com +cfo2go.ro +cg0gcab.mywire.org +cggup.com +ch.ma +chacuo.net +chahcyrans.com +chaichuang.com +chaineor.com +chalupaurybnicku.cz +chamconnho.com +chammy.info +chanceforfuture.org +chansd.com +chantellegribbon.com +chaocosen.com +chapsmail.com +charityrcao.org.uk +charl.us +chasefreedomactivate.com +chatclaude.top +chatgptmail.shop +chatgptuk.pp.ua +chatgtporg.eu.cc +chatich.com +chatworkstation.com +chaublog.com +chauhuy.click +chauhuy.io.vn +chauhuy.online +chauhuy.site +chautuyen.click +chautuyen.io.vn +chautuyen.online +cheaphub.net +cheapmori.store +cheatmail.de +chefalicious.com +chelsworth.net +cheminsdevie.ink +chenbot.email +chenbufan.top +chessgameland.com +chessgamingworld.com +chessmeadow.me +chestcloudx.com +chewydonut.com +chibakenma.ml +chickenkiller.com +chiefacfix.xyz +chiefactech.xyz +chiefaircon.xyz +chiefaircontech.xyz +chiefamc.xyz +chiefcoolair.xyz +chieffacility.xyz +chiefhvacfix.xyz +chielo.com +childrenth.com +childsavetrust.org +chilkat.com +chillart.org +chillerdesk.xyz +chillerhelp.xyz +chilloliandfii.space +chinamkm.com +chingchongme.site +chithinh.com +chitthi.in +choco.la +chogmail.com +choicemail1.com +choichay.com +choigi.com +chomolokko.shop +choner.cn +choner.shop +chong-mail.com +chong-mail.net +chong-mail.org +chongqilai.cc +chophim.com +chosenx.com +chotgo.com +chromentis.cfd +chsi.christmas +chuan.info +chucklequartz.lol +chumpstakingdumps.com +chundage.help +chupanhcuoidep.com +churchestate.org.uk +churchhousemanaton.co.uk +churchinsouthampton.org.uk +chuwel.com +cigar-auctions.com +cihai.eu.cc +cihaifhqo.eu.cc +cihuy.net +cimario.com +cipcup.site +citmo.net +citruscarton.shop +cityacmaintenance.xyz +citychiller.xyz +cityfixit.xyz +cityfreon.xyz +cityhumdaily.buzz +cityonfoot.me +civicseedling.sbs +civikli.com +civx.org +cj4fj2a.camdvr.org +cjdeyuiw.eu.cc +cjgq.skin +ckaazaza.tk +cketrust.org +ckiso.com +ckvn.edu.vn +cl-cl.org +cl0ne.net +claimab.com +clandest.in +classesmail.com +classio.click +claudd.com +claverfield.org +clayhallventures.net +cleanacrepair.xyz +cleanersdubaiuae.xyz +cleanersemirates.xyz +cleanerspalmjumeirah.xyz +cleaninbox.dynv6.net +cleaningdubaicreek.xyz +cleaningfestivalcity.xyz +cleaningpalm.xyz +clearaircontech.xyz +clearbeam.pro +clearchiller.xyz +clearclimate.xyz +clearcoolchiller.xyz +clearcoolhvactech.xyz +clearhabitpath.com +clearwatermail.info +cleveracservice.xyz +cleverhvacservice.xyz +cleverrepairs.xyz +clfapqg.theworkpc.com +click-email.com +clickcore99.click +clickdeal.co +clickpetal.click +climateexpert.xyz +clipmail.eu +clipnovella.me +clixser.com +clockemail.com +clone21.io.vn +cloneemail.com +clonehv.com +clonekhoe.com +clonemailsieure.com +clonemoi.tk +clonenpa.com +clonere.net +cloneshop24h.com +clonetrust.com +cloud-mail.top +cloud-temp.com +cloudflare.gay +cloudgen.world +cloudgue.site +cloudsign.in +cloudtempmail.net +cloudwhitespace.cc.cd +cloudwhitezone.cc.cd +cloudyhandshake.cyou +cloudyourfast.net +clousy.site +clout.wiki +cloverradiance.beauty +clowmail.com +clrmail.com +club106.org.uk +clx0vq5.kozow.com +clyvantis.cfd +cmail.blog +cmail.club +cmail.com +cmail.net +cmail.org +cmbl.top +cmcc.indevs.in +cmdkl.com +cmhvzylmfc.com +cnamed.com +cndps.com +cnebw.eu.cc +cneemail.com +cnew.ir +cnieux.com +cnmsg.net +cnoilpress.com +cnsds.de +co.cc +coasah.com +cobal.infos.st +cobarekyo1.ml +cocoro.uk +cocovpn.com +code-gmail.com +codeandscotch.com +codeguard.net +codei.site +coderdir.com +codestar.site +codesuc.top +codexrip.vip +coding.ccwu.cc +codinggo.cn +codivide.com +codywon.top +codyxue.com +codzy.net +coffeeazzan.com +coffeejadore.com +coffeetimer24.com +cogsapb.ddnsfree.com +coieo.com +coin-host.net +coinlink.club +cok.org.uk +colabeta.com +colaname.com +coldemail.info +collegewh.edu.pl +colorcastmail.com +colurmish.com +cometchatter.buzz +cometclear.com +cometlumen.com +comfythings.com +commoncove.sbs +compareshippingrates.org +completegolfswing.com +compressjpg.io +comproa.org +comwest.de +comyze.org +comzx.com +concu.net +conf.work +confmin.com +congacone312.shop +congnguyen.io.vn +connected.linkpc.net +connectifyhub.sbs +connho.com +connho.net +consumerriot.com +contaco.org +contact.infos.st +contactbox.work +contactpage.online +contbay.com +contractingcherrywood.xyz +contractingdifc.xyz +contractingzabeel.xyz +contractorsmajan.xyz +convergenceindia.co.in +coocuuu.food +cood.food +cooh-2.site +cookie007.fr.nf +coolairguys.xyz +coolairmedic.xyz +coolairservice.xyz +coolairsquad.xyz +coolandwacky.us +coolcareuae.xyz +coolclinicuae.xyz +coolcontractsameday.xyz +coolcrewuae.xyz +coolexpertsdxb.xyz +coolexpertuae.xyz +coolimpool.org +coolingamcuae.xyz +coolingdesk.xyz +coolingtechs.xyz +coolingworks.xyz +coolinstalldubai.xyz +cooljump.org +coolmaintenancedxb.xyz +coolprodubai.xyz +coolprosdubai.xyz +coolrepairdxb.xyz +coolrepairuae.xyz +cooltechdxb.xyz +cooltechuae.xyz +cooltilal.xyz +cooltownsquare.xyz +coolzabeel.xyz +copyhome.win +copytosh.com +coralhost.my +corbyrise.com +coreclip.com +corhash.net +cornwallaerospaceeducationtrust.org +corridor.bond +cosdas.com +cosmorph.com +cosoinan.com +cosycritters.co.uk +cotasen.com +cotigz.com +couponbeacon.bond +couponrook.me +courriel.fr.nf +courrieltemporaire.com +cousinment.com +covisuki.icu +coza.ro +cozilla.pw +cpc.cx +cqwbn.com +craftmirth.me +crankhole.com +crapmail.org +crastination.de +craventry.cfd +crazespaces.pw +crazymailing.com +crczrsxls.top +cream.pink +creative.publicvm.com +credit-loans.xyz +crepeau12.com +crestlantern.top +cresvyn.cfd +creteanu.com +crgjw3a.giize.com +cringemonster.com +crogra.org +cross-law.ga +cross-law.gq +cross.edu.pl +crossmailjet.com +crossroadsmail.com +croxleypartners.net +crunchcompass.com +cruncoau.asia +crusthost.com +crybio.com +cryptoavalonsolhub.cloud +cryptogmail.com +crystalcoolservice.xyz +cs.email +csapi.dpdns.org +csh.ro +cslua.com +cspaus.com +cssorbit.me +csvbeacon.me +csvlark.me +cszbl.com +ctmailing.us +ctos.ch +cttnoot.us +cu.cc +cuahangvppn.shop +cuaks.fun +cubene.com +cubiclink.com +cucadas.com +cuendita.com +cuirushi.org +cumnnm.us.ci +cunan.store +cuoly.com +cuongaquarium.com +cupbest.com +curlhph.tk +currentmail.com +curryworld.de +cursor13402.xyz +cursorcove.click +cuscuscuspen.life +cust.in +cutefrogs.xyz +cutevi.us +cutout.club +cutradition.com +cutsup.com +cutuvye.org +cuvox.de +cuvrs.info +cwetg.co.uk +cwsgear.com +cxbl.top +cxcffirx.icu +cxioms.help +cxwet.com +cyber-innovation.club +cyber-phone.eu +cyberionexus.shop +cybertemp.cfd +cybertemp.xyz +cycinst.com +cyclelove.cc +cyjd.top +cykr.beer +cylab.org +cyln.beer +cypi.fr +czx.one +d1yun.com +d3p.dk +d4ngerssquy.info +d8tiya6.camdvr.org +daabox.com +dab.ro +dacoolest.com +dadaolibai.eu.cc +daemonixgames.com +daemsteam.com +daerdy.com +dahewushi.eu.cc +daibb.us +daibond.info +daily-email.com +dailycoolcare.xyz +dailynove.com +dailynutria.com +daimuedu.com +daintly.com +dakaka.org +dalanshu.org +damachillsmaintenance.com +damaclagoonsmaintenance.com +damai.webcam +dammexe.net +damnthespam.com +damowang.eu.cc +damphen.org +dandikmail.com +dann.mywire.org +dantriviet.shop +dao.pp.ua +daouse.com +dapdigital.site +dapurx.me +dardr.com +darkemail.school +darkharvestfilms.com +darkserver.ru +daryxfox.net +dasdasdascyka.tk +dasf.bid +dash-pads.com +dataarca.com +datadudi.com +datapinacle.com +datarca.com +datazo.ca +datchuban.top +datdonshopee.site +datenschutz.ru +datgemini.io.vn +datprovn.io.vn +datprovnn.io.vn +datum2.com +daugr.com +dautubds.io.vn +davidkoh.net +davidlcreative.com +davidtrix.biz +dawin.com +dawnwick.org +dawsoncountygunclub.org +dawushihe.eu.cc +dawushihehe.eu.cc +dayizhan.top +daymail.life +daymailonline.com +dayrep.com +dbea.autos +dbmail.one +dboso.com +dboxmail.com +dbunker.com +dcctb.com +dcemail.com +dcpa.net +dcyo.skin +dd2car.com +ddat0511.click +ddcrew.com +ddfd.fashion +ddsdg34.abrdns.com +de-a.org +dea-21olympic.com +deadaddress.com +deadchildren.org +deadfake.cf +deadfake.ga +deadfake.ml +deadfake.tk +deadspam.com +deagot.com +deajeng.store +dealja.com +deallabs.org +dealrek.com +deapad.com +debitur.cam +decep.com +decodewp.com +decornido.com +decosprig.me +dede.infos.st +deekayen.us +deenur.com +deepconverts.com +deepmails.org +deepmaster.fun +deepneko.xyz +deepyinc.com +deertees.com +defomail.com +degap.fr.nf +degar.xyz +degradedfun.net +dehaopay.com +deinbox.com +deisgn-ai.work.gd +delaeb.com +delayload.com +delayload.net +delikkt.de +delivrmail.com +delorex.com +deltajohnsons.com +deluxmail.com +delvionis.cfd +demen.ml +dengekibunko.ga +dengekibunko.gq +dengekibunko.ml +denipl.com +denipl.net +dentaguardmouthguard.com +deornaumail.com +depdocla.net +der-kombi.de +derkombi.de +derluxuswagen.de +desertsundesigns.com +desfrenes.fr.nf +deshnetarchadacalculator.one +designhta.work.gd +deskblossom.me +desmond.eu.cc +desoz.com +despam.it +despammed.com +dev-null.cf +dev-null.ga +dev-null.gq +dev-null.ml +dev17.tech +devbike.com +developermail.com +developtool.app +devh24.online +devmant.com +devnullmail.com +devpoet.com +devsonline.studio +devthien.io.vn +dewlilac.beauty +deyom.com +dfghjertyh.dynv6.net +dfyuih.eu.cc +dgdf.cc +dghdfjfd.eu.cc +dh372.top +dharmatel.net +dheiwuy.eu.cc +dhkt.skin +dhm.ro +dhnow.com +dhoahn.eu.cc +dhy.cc +dialogus.com +diamondacmaintenance.xyz +diamondmaint.xyz +diapaulpainting.com +diceparlor.me +dichvuxe24h.com +dicopto.com +diddyricky.com +diddyricky.fr +diddyricky.info +diddyricky.store +diemhenvn.com +digdig.org +digeros.com +digi-value.fr +digial.jo3.org +digibeast.my +digibeast.store +digimaster.bond +digimaster.eu.cc +diginey.com +digital-message.com +digitaldesign.run.place +digitalesbusiness.info +digitalmail.info +digitalmariachis.com +digitalsanctuary.com +digitecy.live +dildoe.cfd +dildosfromspace.com +dim-coin.com +dimalk.com +dingbone.com +dinlaan.site +dinnerdrape.me +dino.icu +diolang.com +dioramafern.me +diplom-voronesh.ru +directcoolfix.xyz +directcoolservice.xyz +directhvacfix.xyz +directmail24.net +dis.hopto.org +disaq.com +disbox.net +disbox.org +discard.cf +discard.email +discard.ga +discard.gq +discard.ml +discard.tk +discardmail.com +discardmail.de +discos4.com +dishcatfish.com +disign-concept.eu +disign-revelation.com +displayme.store +dispo.in +dispomail.eu +disposable-e.ml +disposable-email.ml +disposable.cf +disposable.ga +disposable.ml +disposable.site +disposableaddress.com +disposableemailaddresses.com +disposableinbox.com +disposablemails.com +dispose.it +disposeamail.com +disposely.xyz +disposemail.com +disposemymail.com +disposly.com +dispostable.com +districtonemaintenance.com +divad.ga +divermail.com +divismail.ru +diwaq.com +dixz.net +diyongjin.net +dizigg.com +djiv.xyz +djwekih.eu.cc +dkgnds.cloud +dkz.opik.net +dldweb.info +dlemail.ru +dlwv.makeup +dmail.one +dmarc.ro +dmcelements.org +dmts.fr.nf +dmxs8.com +dnbp.hair +dndent.com +dnkah.eu.cc +dnsclick.com +dnses.ro +dnslog.tech +dnsprism.me +dnsraven.me +doanart.com +doantotnghiep.com +dob.jp +docash.app +docbao7.com +docse.site +dodgeit.com +dodgemail.de +dodgit.com +dodgit.org +dodsi.com +dogai.qzz.io +dogclothing.org +dogking.dpdns.org +dogmrp.com +dohoanganh.site +doiea.com +doj.one +dolofan.com +dolphinnet.net +domforfb1.tk +domforfb18.tk +domforfb19.tk +domforfb2.tk +domforfb23.tk +domforfb27.tk +domforfb29.tk +domforfb3.tk +domforfb4.tk +domforfb5.tk +domforfb6.tk +domforfb7.tk +domforfb8.tk +domforfb9.tk +domozmail.com +don.edu.pl +dona.one +dona.pw +dona.rip +donebyngle.com +donemail.my.id +donemail.ru +dongqing365.com +donkicode.top +dontreg.com +dontsendmespam.de +dontsleep404.com +donusumekatil.com +doobb.com +doojazz.com +doquier.tk +doreact.com +dorothyfoundation.org +doszo.qzz.io +dotapodemail.com +dotman.de +dotmsg.com +dotool8.top +dotos.dev +dotslashrage.com +dotvu.net +dotzi.net +doublemail.de +douchelounge.com +doudizhu.top +doulas.org +downloadigpost.com +downloadvideoig.app +dozvon-spb.ru +dp76.com +dpfrufiwo.top +dpmstore.id.vn +dpmurt.my +dpptd.com +dprasu.sbs +dr69.site +dragonbookcase.me +dramamixio.icu +draughtier.com +draycottholdings.net +drdrb.com +drdrb.net +dreamadventure.org +dreamclarify.org +dreameg.com +dreamgreen.fr.nf +dred.ru +drevo.si +drewzen.com +driftz.net +drimex.cfd +dripzgaming.com +drivetagdev.com +drivz.net +drmail.in +droggo.engineer +droolingfanboy.de +dropcake.de +dropinboxes.com +dropjar.com +droplar.com +dropmail.me +dropoffs.org +dropons.com +dropsin.net +drovantis.cfd +drovenix.cfd +drowblock.com +drtall.com +drugsellers.com +druzik.pp.ua +dsbe.makeup +dsfsfdsfds.shop +dsgvo.party +dsgvo.ru +dshfjdafd.cloud +dshznonline.cc +dsiay.com +dsitip.com +dspwebservices.com +dswe-56f.xyz +dtvpn.dpdns.org +du3aquli.icu +duam.net +duanju888.site +dubaiacplumbing.com +dubaiapartmentcare.com +dubaiapartmentfix.com +dubaicarecrew.com +dubaifixcrew.com +dubaifixitnow.com +dubaifixlab.com +dubaifixmasters.com +dubaifixnow.com +dubaifixpoint.com +dubaifixservices.com +dubaifixteam.com +dubaiflatfix.com +dubaiflatservices.com +dubaihandyhelp.com +dubaihandyman247.com +dubaihandymanco.com +dubaihandymanhub.com +dubaihandymanpro.com +dubaihillsmaintenance.com +dubaihomeassist.com +dubaihomecareservices.com +dubaihomemasters.com +dubaihomerepairco.com +dubaihomerepairexperts.com +dubaihomerescue.com +dubaihomeserviceco.com +dubaihomesupport.com +dubaihometechnicians.com +dubaihomeworks.com +dubaihousecare.com +dubaihousedoctors.com +dubaihousefix.com +dubailandmaintenance.com +dubaimaintenance247.com +dubaimaintenanceassist.com +dubaimaintenanceco.com +dubaimaintenancecrew.com +dubaimaintenancemasters.com +dubaimaintenancepro.com +dubaimaintenancepros.com +dubaipropertyfix.com +dubairepair247.com +dubairepairassist.com +dubairepairco.com +dubairepaircrew.com +dubairepairguys.com +dubairepairmasters.com +dubairepairworks.com +dubaiservicecrew.com +dubaiserviceworks.com +dubaisiliconoasismaintenance.com +dubaisouthmaintenance.com +dubaivillacare.com +dubaivillamaintenance.com +dubokutv.com +duck2.club +duckmail.sbs +duckyoursick.com +ducpham.id.vn +ductfixit.xyz +ductingco.xyz +ductingrepair.xyz +dudmail.com +dugmail.com +duidir.com +duk33.com +dukedish.com +dukunmodern.id +dulich360.com +dulich84.com +dulichdatlanh.com +dulichdatlanh.vn +dulieu.io.vn +dumalu.com +dumbass.nl +dump-email.info +dumpandjunk.com +dumpmail.de +dumpyemail.com +dunamispfm.org +dunefreon.xyz +dunesplit.xyz +dunkos.xyz +dunsfoldgroup.net +durandinterstellar.com +duskmail.com +dusrui.com +dustinry.com +dustmail.net +duvips.com +duya25446.top +duyquyen.site +dv2.host +dvaren.online +dvdpit.com +dwarfmining.com +dwiworka.pro +dwse.edu.pl +dwseal.com +dxbcontractquick.xyz +dxbmaintenanceuae.xyz +dxbrepairquick.xyz +dyceroprojects.com +dyclsr.xyz +dyebkj.eu.cc +dyera.studio +dyfgiavcrw.eu.cc +dygovil.com +dymarent.cfd +dynarix.cfd +dynlexspirit.fun +dz17.net +dz62.help +dzntn.io.vn +dztyhd.cn +e-mail.com +e-mail.org +e-marketstore.ru +e-pool.co.uk +e-pool.uk +e-postkasten.de +e-record.com +e-tomarigi.com +e3z.de +e4ward.com +e6hoohs.camdvr.org +eacademia.uk +ealea.fr.nf +eanok.com +eartin.net +ease.es +eastcombe.org +easy-trash-mail.com +easyamcservice.xyz +easycooltech.xyz +easygbd.com +easyhomefit.com +easyhvaccare.xyz +easyhvacfix.xyz +easymailer.live +easymails.cc +easynetwork.info +easytrashmail.com +eatmea2z.club +eay.jp +ebar.site +ebbob.com +ebeschlussbuch.de +eby9h2m.giize.com +ecallheandi.com +eckpcin.giize.com +ecolo-online.fr +ecoverseworld.com +ecstor.com +edankeunwe.site +edfc.skin +edgepodlab.com +edgetopgrid.com +edgex.ru +edinburgh-airporthotels.com +edmondventures.com +edny.net +edshol.net +edu-qin.ccwu.cc +education.nyc.mn +edudingy.cfd +eduemail.me +eduip.eu.org +edumail.edu.pl +edumail.edu.rs +edumaili.com +edumaili.edu.pl +edumaill.edu.pl +edupolska.edu.pl +edv.to +ee1.pl +ee2.pl +eedl.skin +eeedv.de +eelmail.com +eelraodo.com +eemail.eu.cc +een4dnt.ooguy.com +eewmaop.com +efdsdsdw.cloud-ip.cc +effobe.com +efxs.ca +egg5233.com +egg5233.one +eggbanjos.org +eggso.click +eggsuwz.ooguy.com +eggur.com +egirl.help +egni.beer +egvoo.com +egzones.com +ehrjkc.asia +einmalmail.de +einrot.com +einrot.de +eintagsmail.de +einzieg.site +eiveg.com +ekot.xyz +elafans.com +eldobhato-level.hu +elearningjournal.org +electro.mn +electrochillplanet.com +electrolabx.com +elerso.com +eligou.store +elitemaint.xyz +elitepixels.store +elitevipatlantamodels.com +elixora.cfd +eljawir.com +elji.autos +elki-mkzn.ru +ellertongroup.net +elobits.com +elondonteam.work.gd +elpisproject.org +elumetra.cfd +elygifts.com +em1z7v3c.icu +emaii.io.vn +email-68.com +email-fake.cf +email-fake.com +email-fake.ga +email-fake.gq +email-fake.ml +email-fake.tk +email-free.online +email-jetable.fr +email-lab.com +email-temp.com +email.edu.pl +email.net +email1.pro +email10p.org +email60.com +email84.com +emailabox.pro +emailage.cf +emailage.ga +emailage.gq +emailage.ml +emailage.tk +emailaoa.pro +emailasia1.com +emailate.com +emailawb.pro +emailax.pro +emailbbox.pro +emailbin.net +emailboxer.one +emailcbox.pro +emailcoffeehouse.com +emailcu.icu +emaildark.fr.nf +emaildbox.pro +emaildienst.de +emaildrop.io +emailfake.com +emailfake.ml +emailforyou.info +emailfoxi.pro +emailfreedom.ml +emailfutureme.com +emailgen.uk +emailgenerator.de +emailgo.de +emailgratisan.fun +emailhook.site +emailias.com +emailigo.de +emailinbo.live +emailinfive.com +emailisvalid.com +emailjps.com +emailkeep.com +emailkp.com +emaillime.com +emailluu.asia +emailmiser.com +emailmuaqat.shop +emailna.co +emailnator.com +emailnax.com +emailnow.net +emailnow.one +emailo.pro +emailondeck.com +emailplay.org +emailportal.info +emailproxsy.com +emailracc.com +emailresort.com +emailrod.com +emails.ga +emailsecurer.com +emailsensei.com +emailsingularity.net +emailspam.cf +emailspam.ga +emailspam.gq +emailspam.ml +emailspam.tk +emailsy.info +emailtech.info +emailtemporanea.com +emailtemporanea.net +emailtemporar.ro +emailtemporario.com.br +emailthe.net +emailtik.com +emailtmp.com +emailto.de +emailuae.com +emailure.net +emailvb.pro +emailviet.com +emailwarden.com +emailwww.pro +emailxfer.com +emaily.pro +emailz.cf +emailz.ga +emailz.gq +emailz.ml +emalupe.com +emaxasp.com +embege.xyz +embekhoe.com +emeil.in +emeil.ir +emeraldwebmail.com +emergencymail.site +emergentvillage.org +emiratesannualuae.xyz +emiratiacpro.xyz +emiratirepairs.xyz +emkei.cf +emkei.ga +emkei.gq +emkei.ml +emkei.tk +eml.pp.ua +emlhot.com +emlhub.com +emlpro.com +emltmp.com +emman.my.id +emocan.name.tr +empireanime.ga +empva.io.vn +empva1.com +empva1.io.vn +empva11.com +empva11.io.vn +emstjzh.com +emz.net +emziegz.com +en2ch.com +enayu.com +end.tw +endingimpunity.com +endob.com +enfq.autos +engineersdubaimarina.xyz +engineerspalmjumeirah.xyz +englishcriketclub.org.uk +enitempmail.xyz +enotj.com +enowgntg.site +enspinner.com +ensproxy.com +enterto.com +envy17.com +eoffice.top +eoopy.com +eosada.com +eoslux.com +eoutrbl.com +ep77.com +epaco9t.loseyourip.com +epb.ro +epbox.ru +epbox.store +epetsoft.com +ephemail.net +ephemeral.email +eposta.buzz +eposta.work +epostal.ru +epostal.store +epsteinisland.click +epurcf.org +eqgq.hair +eqiluxspam.ga +equivara.cfd +erahods.com +ereplyzy.com +ericjohnson.ml +eripo.net +ernestturcotte.us +ero-tube.org +erth.nl +esadverse.com +esbano-ru.ru +esc.la +escapehatchapp.com +esemay.com +esgeneri.com +eshimod.com +esiix.com +esprity.com +estate-invest.fr +estatecoolrepair.xyz +estatecoolservice.xyz +estatemaintenancedubai.xyz +esterace.com +estrowebservices.com +etempmail.net +etenx.com +eth2btc.info +ether123.net +ethereum1.top +ethersports.org +ethersportz.info +etickethelpdesk.net +etics.us +etotvibor.ru +etquakemultimedia.com +etramay.com +etranquil.com +etranquil.net +etranquil.org +etubemail.com +etymoasis.me +etzg.de5.net +euaqa.com +euleina.com +eulercraft.com +euploading.com +euroallsports.org.uk +eurokool.com +euucn.com +evairo.fun +evairo.web.id +evanfox.info +eve.dpdns.org +eveav.com +evilcomputer.com +evilgodshop.uk +evjy.skin +evnft.com +evomiserver.com +evontra.cfd +evopo.com +evusd.com +evvgo.com +evyush.com +ewebrus.com +ewma.hair +ewma.skin +exactaccare.xyz +exactacrepair.xyz +exactchiller.xyz +exacthvacrepair.xyz +exahut.com +examcentral.co.uk +examstudy.xyz +exbts.com +exclussi.com +exdonuts.com +exelica.com +exespay.com +exhaycle.com +exile.my.id +existiert.net +exitbit.com +exitstageleft.net +exkucn.ccwu.cc +exmab.com +expertacmaintenance.xyz +expertairconservice.xyz +expertamcmaintenance.xyz +expertcitywalk.xyz +expertcoolservice.xyz +expertinstallationsdxb.xyz +expertqusais.xyz +expertsarabianranches.xyz +expertskarama.xyz +experttechgulf.xyz +expertwarsan.xyz +expiredtoaster.org +explodemail.com +expltain.com +express.net.ua +extracurricularsociety.com +extraku.com +extraku.net +extraku.shop +extremail.ru +extrset.com +exweme.com +exzork.sbs +ey-hungry.top +eycfhb.com +eyee.eu.cc +eyepaste.com +eynlong.com +ez.lv +ezai.chat +ezehe.com +ezfill.com +ezimb.com +ezonemail.com +ezsj.hair +ezstest.com +ezua.com +ezztt.com +f1b.email +f1b.vn +f2b.click +f2b.email +f2b.info +f2b.site +f2b.tech +f2b.tokyo +f2b.vn +f2c.email +f2c.host +f2c.me +f2c.mobi +f2c.press +f2d.click +f2d.info +f2d.life +f2d.pro +f2e.click +f2e.email +f2e.pro +f2e.pw +f2e.world +f2f.email +f2f.pw +f3p.io.vn +f4k.es +f4wxmpu.kozow.com +f5p0y90.ooguy.com +f5v7u9a.ddnsfree.com +f6z6ica.camdvr.org +fabaos.com +fabm4msw.icu +fabricmarsh.cfd +facebook-email.cf +facebook-email.ga +facebook-email.ml +facebookmail.gq +facebookmail.ml +facemac.website +facilitiesacrepair.xyz +facilitiesrepair.xyz +fackme.gq +factoryuk.org.uk +fadingemail.com +fadsfdsfaa.indevs.in +faecesmail.me +fafa.beer +fag.wf +fahjnlgfa1fa2.com +failbone.com +fairairconcare.xyz +fairairconfix.xyz +fairamc.xyz +fairhavenventures.net +faithkills.com +faizasoft.com +fake-box.com +fake-email.pp.ua +fake-mail.cf +fake-mail.ga +fake-mail.ml +fakedemail.com +fakeinbox.cf +fakeinbox.com +fakeinbox.ga +fakeinbox.info +fakeinbox.ml +fakeinbox.tk +fakeinformation.com +fakemail.fr +fakemail.io +fakemail.net +fakemailgenerator.com +fakemailz.com +falconcitymaintenance.com +falconcoolmaintenance.xyz +falconryadventurecentreofeducation.com +fallinhay.com +famamail.com +fammix.com +fanclub.pm +fancoilsquad.xyz +fandoe.com +fanfanhenkuai.xyz +fangoh.com +fangxiaobai.us.ci +fangxiaobai1.us.ci +fanicle.com +fansworldwide.de +fantastu.com +fantasy139.icu +fantasymail.de +fantatua.com +fanymail.com +fanzher.com +farah.rip +farouter.tech +farrowgate.net +farrse.co.uk +fasl4kas3.site +fasssd.ru +fasssd.store +fast-email.info +fast-mail.fr +fastaccare.xyz +fastacura.com +fastchevy.com +fastchrysler.com +fasternet.biz +fastestflex.com +fastfacility.xyz +fastinbox.one +fastkawasaki.com +fastmail.edu.pl +fastmazda.com +fastmitsubishi.com +fastnissan.com +fastnodo.click +fastsearcher.com +fastsubaru.com +fastsuzuki.com +fasttoyota.com +fastyamaha.com +fatebd.com +fatflap.com +faviconpouch.me +faxico.com +faxzu.com +faybetsy.com +fazka.ovh +fazs.skin +fbb.cool +fbb.id.vn +fbb.io.vn +fbb.kim +fbb.linkpc.net +fbb.lu +fbb.vn +fbfbs.lol +fbhotro.com +fbi.one +fbins001mail.com +fbins607.com +fbkjlnry.top +fblgsl.cam +fbma.tk +fboxmail.com +fbviamail.com +fcetpkqwm.top +fddns.ml +fdfdsfds.com +fdfggh-df5.cc +fdger88.cc +fdhsui.eu.cc +fdmail.top +fdpbnzx.cn +fdsgsd.org +fdsregre.shop +fdvctte.info +featcore.com +fedayroi.online +feelmyheartwithsong.com +feiyujingxuan.top +femailtor.com +fenfax.com +fengzheng.qzz.io +fenzhuai.top +fer-gabon.org +feralrex.com +ferd.live +ferdomnermail.com +feriwor.com +fermaxxi.ru +ferngrove.org +feroxid.com +fettometern.com +fewzc.makeup +fexbox.org +fexbox.ru +fexpost.com +fextemp.com +ffpp.store +ffps.fun +fft.edu.do +ffyf.fashion +fgmail.cyou +fgtygcop.store +fhoau.eu.cc +fhpfhp.fr.nf +fhwui.eu.cc +fhwyuoia.eu.cc +fiallaspares.com +fibmail.com +ficken.de +fictionsite.com +fidhost.com +fifafotball.org.uk +fightallspam.com +fighthunger.co.uk +fightingzebras.org +figjs.com +figshot.com +figurescoin.com +fiifke.de +filbert4u.com +filberts4u.com +file2drive.com +filetodrive.com +film-blog.biz +filmla.org +filzmail.com +finacenter.com +findemail.info +findids.net +findize.com +findmeghana.org +findu.pl +finews.biz +fingso.com +finsburyholdings.net +finsmine.info +fir.hk +fira.my +firemail.com.br +firemailbox.club +firerocket.site +firstaidtrainingschool.co.uk +firstamcmaintenance.xyz +firstamcpro.xyz +firstducting.xyz +firstlawyer.org +fisdom.vip +fitbloomlab.com +fitnesrezink.ru +fivemail.de +fivermail.com +fixarabianranches.xyz +fixbarsha.xyz +fixclean24x7.xyz +fixcontractexpress.xyz +fixitdip.xyz +fixitsprings.xyz +fixmail.tk +fixmirdif.xyz +fixmydubaihome.com +fixtech24x7.xyz +fizmail.com +fj7v67f.camdvr.org +fjic.hair +fjic.skin +fkainc.com +fknm8.mobi +flaimenet.ir +flakeian.com +flameoflovedegree.com +flashemail.site +flatimostore.cloud +flavourity.com +flayeraaron.eu.cc +flayerhu.eu.cc +fldubai.com +fleckens.hu +flemail.ru +flews.app +flexvio.com +flickerbutton.click +fliegender.fish +flobo.fr.nf +flock84.uk +florevia.cfd +flosek.com +flowconnect.beer +flowu.com +flu.cc +fluidsoft.us +flurred.com +fly-ts.de +flyhubs.top +flyinggeek.net +flymail.tk +flyovertrees.com +flyspam.com +flywaverun.com +flyzy.net +fmuss.com +fncp.ru +fncp.store +fngd.hair +fog.one +fommie.com +fommie.online +fommie.store +foobarbot.net +footard.com +footballgamesbd.site +foothilltoy.site +for4u.net +forapps.space +forbmmend.com +foreastate.com +forecastertests.com +foreskin.cf +foreskin.ga +foreskin.gq +foreskin.ml +foreskin.tk +forexnews.bg +forexru.com +forexzig.com +forge45k.io.vn +forgetmail.com +forgetmenotstudio.org.uk +forliion.com +formatbento.me +formodapk.com +fornow.eu +forregmail.asia +forregmail.xyz +forspam.net +forum.nyc.mn +forward.cat +fosil.pro +fossilwharf.me +foxglovegoods.shop +foxja.com +foxnew.info +foxtrotter.info +fpgrabber.com +fpt-student-support.store +fqys.hair +fr.cr +fr33mail.info +fragolina2.tk +france.edu.pl +frankhealeyfoundation.org +frapmail.com +frappina.tk +frederictonlawyer.com +free-email.cf +free-email.ga +free-temp-mail.eu.org +free-temp.net +freebabysittercam.com +freeblackbootytube.com +freecat.net +freecustom.email +freedom4you.info +freedomcentremereside.org +freedompop.us +freedrops.org +freefattymovies.com +freegrok.cc.cd +freehotmail.net +freeimagehosts.org +freeimghost.org +freeinbox.email +freelance-france.eu +freeletter.me +freemail.ms +freemails.cf +freemails.ga +freemails.ml +freemails.pp.ua +freemeil.ga +freemeil.gq +freemeil.ml +freeml.net +freeplumpervideos.com +freerubli.ru +freeschoolgirlvids.com +freesistercam.com +freesourcecodes.com +freeteenbums.com +freetimer.online +freonexpert.xyz +freshairconpro.xyz +freshcooling.xyz +freshfable.buzz +freundin.ru +friday12.store +friendfete.me +friendlyhollow.sbs +friendlymail.co.uk +friendlyorbit.cyou +friendsofbram.com +frive.site +frm.ovh +front14.org +frostaircon.xyz +frostamcdubai.xyz +frostfixit.xyz +frostmail.fr.nf +frostsplit.xyz +frostycoolservice.xyz +frostyfixit.xyz +frostyhvacpro.xyz +frostypeak.info +frostythermo.xyz +fruitservice.xyz +frwdmail.com +frza.me +fsercure.online +fsitip.com +fsotl.icu +fthcapital.com +ftlz.hair +ftp.sh +ftpinc.ca +ftrh.skin +fuckedupload.com +fuckingduh.com +fucklinuxdo.com +fuckme69.club +fuckneo.org +fucknloveme.top +fuckxxme.top +fudgerub.com +fudier.com +fuirio.com +fuk996.icu +fukaru.com +fukurou.ch +fullac.xyz +fullaircond.xyz +fullangle.org +fullcoolmaintenance.xyz +fulldiets.com +fullfreon.xyz +fulvie.com +fumemail.com +fun4k.com +fun64.com +fundapk.com +fundproceed.com +funnycodesnippets.com +funnyfail.app +funnylolcap.com +funnylolcap.fr +funnylolcap.org +funnylolcap.store +funnymail.abrdns.com +funnymail.de +funteka.com +furzauflunge.de +fusioninbox.com +futcost.online +futcost.ru +futuramind.com +fuvk.ru +fuvk.store +fuwa.be +fuwa.li +fuwamofu.com +fuwari.be +fux0ringduh.com +fuzmwa.asia +fviadropinbox.com +fviainboxes.com +fviamail.com +fviamail.work +fvz7wvh.ddnsfree.com +fwya.asia +fwyi.asia +fwze.asia +fxavaj.com +fxnxs.com +fxos.hair +fxt.ink +fxtubes.com +fxxf.beer +fxzig.com +fyawmtu.camdvr.org +fycloud.online +fyeiwh.eu.cc +fyii.de +fynix.sbs +fyronex.cfd +fznb.hair +g-mail.biz.id +g-mail.kr +g0pg02x.theworkpc.com +g14l71lb.com +g1xmail.top +g2xmail.top +g3xmail.top +g4hdrop.us +g947lzu.kozow.com +gacharevenue.cc +gafy.net +gagagaga1.icu +gagagaga10.icu +gagagaga3.icu +gagagaga8.icu +gagagaga9.icu +gagcalculator.me +gage.ga +gailiuzi.icu +gakhum.com +galaxim.fr.nf +galaxy.tv +galebird.cc.cd +gally.jp +gamadaiz.shop +gamail.top +gamapa.asia +gamebcs.com +gamegregious.com +gamen.me +gamepec.com +gamerai.shop +gamerai.space +gamerai.website +gamgling.com +gandobaba.bond +ganlin.shop +garasikita.pw +garbagecollector.org +garbagemail.org +gardenscape.ca +gardu.codes +garizo.com +garliclife.com +garod1.xyz +garrymccooey.com +gashoainam.io.vn +gassmail.com +gasuda.com +gav0.com +gavrom.com +gawab.com +gaxetovemail.com +gbcmail.win +gblw.site +gbmail.top +gbui.autos +gcfv.skin +gclwiv9p.icu +gcmail.top +gcpfas.shop +gcphanter.skin +gcpmakerds.cyou +gcpowner.online +gcpripon.space +gcpriponteam.xyz +gcptoday.xyz +gdasg.bid +gdcrm.store +gddghh.space +gddp2018.edu.vn +gdfgergrer.online +gdmail.top +gdmo.autos +gdqoe.net +gdxs.cc.cd +gear3.pro +gebrauchtwarencenter.com +gedmail.win +geekforex.com +geeksun.us.ci +geew.ru +gehensiemirnichtaufdensack.de +geldwaschmaschine.de +gelitik.in +gemapan.com +gemipro1.store +gemmarosefoundation.co.uk +gemniultra.me +gendeng.indevs.in +genderfuck.net +generator.email +generator1email.com +gentleinfopath.com +genzmaile.com +genzotp.com +genztrang.com +geometrics.icu +georgefletcher.org.uk +georgeheddon.co.uk +geronra.com +gerv.app +geschent.biz +get-mail.cf +get-mail.ga +get-mail.ml +get-mail.tk +get.pp.ua +get1mail.com +get2mail.fr +getai-hub.com +getairmail.cf +getairmail.com +getairmail.ga +getairmail.gq +getairmail.ml +getairmail.tk +getamccare.xyz +getasail.com +getbloomdata.com +getbox89.xyz +geteit.com +getemail.space +getfun.men +getgptcode.com +getmail.my.id +getmail1.com +getmailfree.cc +getmails.eu +getmails.top +getmule.com +getnada.cc +getnada.com +getnowtoday.cf +getol.pro +getonemail.com +getonemail.net +getotp.fun +getover.de +getsimpleemail.com +gett.icu +getthermo.xyz +gewalusitest1.cloud-ip.cc +gexik.com +gghjnvgfyjhk.top +ggmal.ml +ggoop69.kozow.com +ggrainn.com +ggu6ctm.ooguy.com +ggvendas.store +ggvk.ru +ggvk.store +ggxg.fashion +ggxhunter.com +ghfnhcf.xyz +ghis.beer +ghiyugh.uk +ghk55.us +gholar.com +ghosttexter.de +ghvv.click +gi-mel.web.id +giacmosuaviet.info +giaiphapmuasam.com +giantmail.de +giare.fun +gifto12.com +gigglefern.lol +gimbmail.com +gimme-cooki.es +gimpmail.com +gimuemoa.fr.nf +ginzi.be +ginzi.co.uk +ginzi.es +ginzi.net +ginzy.co.uk +ginzy.eu +giodaingan.com +gioidev.news +giratex.com +girlfriend.ru +girlmail.win +girlsindetention.com +girlsundertheinfluence.com +gishpuppy.com +gislinghamsilverband.com +github-com-disposable-email-domains.loseyourip.com +giue.hair +giveh2o.info +givememail.club +givemetoken.xin +givmail.com +gixenmixen.com +gkd2323c.in +gkyd3vu.loseyourip.com +gladogmi.fr.nf +glasswhitehub.com +glastonventures.net +glaventra.cfd +glaviu.icu +glcspp.top +glenmoorcorp.net +gli.dpdns.org +glitch.sx +globalbizflow.com +globaltouron.com +glorylandconnections.com +gls-info.help +glubex.com +glucosegrin.com +gmaail.icu +gmaiil.top +gmail-xsniper.com +gmail-xsniper.site +gmail-xsniper.space +gmail.or.at +gmail2.gq +gmailedu.us +gmailinsta.com +gmaill.click +gmaill.vn +gmaillive.cloud +gmaillk.com +gmailold.com +gmailot.com +gmailxsn.com +gmailxsn.site +gmailxsn.space +gmailxyz.bond +gmali.online +gmatch.org +gmayll.com +gmeenramy.com +gmel.biz.id +gmel.my.id +gmells.com +gmial.com +gmneel.eu.cc +gmx1mail.top +gmxmail.top +gmxmail.win +gnctr-calgary.com +gng.edu.pl +gni8.com +gnwzqaz.shop +go2farm.io.vn +go2usa.info +go2vpn.net +goacpro.xyz +goaircool.xyz +goalmillion.online +goatmail.uk +gob.re +godfare.com +godulygmail.com +goemailgo.com +goeschman.com +gohivezone.com +gokublue.me +golano2.co.uk +gold.edu.pl +goldairconrepair.xyz +goldamc.xyz +goldamccare.xyz +goldcoolmaintenance.xyz +goldcoolservice.xyz +goldenmagpies.com +goldenmaint.xyz +goldinbox.net +goldivis.work.gd +goldlicai.com +goldvester.com +golemico.com +goleudy.org.uk +goliszek.net +gomail.in +gomomy.sbs +gongjua.com +gonida.co.uk +gonida.com +gonida.uk +gonrr.net +gonw3bb.camdvr.org +goodjzy.art +goodpetday.me +googl.win +goomail.club +goonby.com +gooner.cat +goplaygame.ru +gorillaswithdirtyarmpits.com +goround.info +gosarlar.com +gossipglove.uk +gosuslugi-spravka.ru +gothere.biz +gotmail.com +gotmail.net +gotmail.org +gotrak.org +gowcp.com +gowikibooks.com +gowikicampus.com +gowikicars.com +gowikifilms.com +gowikigames.com +gowikimusic.com +gowikinetwork.com +gowikitravel.com +gowikitv.com +gpt-mail-free-1200.dynv6.net +gpt-mail-free-140.dynv6.net +gpt-mail-free-1427.dynv6.net +gpt-mail-free-1550.dynv6.net +gpt-mail-free-161.dynv6.net +gpt-mail-free-1694.dynv6.net +gpt-mail-free-1721.dynv6.net +gpt-mail-free-1980.dynv6.net +gpt-mail-free-1998.dynv6.net +gpt-mail-free-2019.dynv6.net +gpt-mail-free-2049.dynv6.net +gpt-mail-free-2109.dynv6.net +gpt-mail-free-2141.dynv6.net +gpt-mail-free-2307.dynv6.net +gpt-mail-free-2310.dynv6.net +gpt-mail-free-2375.dynv6.net +gpt-mail-free-248.dynv6.net +gpt-mail-free-2491.dynv6.net +gpt-mail-free-3.dynv6.net +gpt-mail-free-3074.dynv6.net +gpt-mail-free-3093.dynv6.net +gpt-mail-free-3127.dynv6.net +gpt-mail-free-3291.dynv6.net +gpt-mail-free-3330.dynv6.net +gpt-mail-free-3348.dynv6.net +gpt-mail-free-3476.dynv6.net +gpt-mail-free-3527.dynv6.net +gpt-mail-free-366.dynv6.net +gpt-mail-free-3792.dynv6.net +gpt-mail-free-3927.dynv6.net +gpt-mail-free-4111.dynv6.net +gpt-mail-free-4547.dynv6.net +gpt-mail-free-4771.dynv6.net +gpt-mail-free-4775.dynv6.net +gpt-mail-free-4788.dynv6.net +gpt-mail-free-4821.dynv6.net +gpt-mail-free-4900.dynv6.net +gpt-mail-free-5018.dynv6.net +gpt-mail-free-5182.dynv6.net +gpt-mail-free-5211.dynv6.net +gpt-mail-free-5226.dynv6.net +gpt-mail-free-5241.dynv6.net +gpt-mail-free-5261.dynv6.net +gpt-mail-free-5386.dynv6.net +gpt-mail-free-5406.dynv6.net +gpt-mail-free-551.dynv6.net +gpt-mail-free-5539.dynv6.net +gpt-mail-free-561.dynv6.net +gpt-mail-free-5659.dynv6.net +gpt-mail-free-574.dynv6.net +gpt-mail-free-5902.dynv6.net +gpt-mail-free-6067.dynv6.net +gpt-mail-free-610.dynv6.net +gpt-mail-free-6221.dynv6.net +gpt-mail-free-6289.dynv6.net +gpt-mail-free-6320.dynv6.net +gpt-mail-free-6342.dynv6.net +gpt-mail-free-6397.dynv6.net +gpt-mail-free-6419.dynv6.net +gpt-mail-free-6603.dynv6.net +gpt-mail-free-6664.dynv6.net +gpt-mail-free-6691.dynv6.net +gpt-mail-free-6779.dynv6.net +gpt-mail-free-6812.dynv6.net +gpt-mail-free-6925.dynv6.net +gpt-mail-free-6962.dynv6.net +gpt-mail-free-7208.dynv6.net +gpt-mail-free-7298.dynv6.net +gpt-mail-free-7493.dynv6.net +gpt-mail-free-7548.dynv6.net +gpt-mail-free-7572.dynv6.net +gpt-mail-free-7582.dynv6.net +gpt-mail-free-7689.dynv6.net +gpt-mail-free-7939.dynv6.net +gpt-mail-free-8015.dynv6.net +gpt-mail-free-8049.dynv6.net +gpt-mail-free-8591.dynv6.net +gpt-mail-free-86.dynv6.net +gpt-mail-free-861.dynv6.net +gpt-mail-free-8611.dynv6.net +gpt-mail-free-8671.dynv6.net +gpt-mail-free-8773.dynv6.net +gpt-mail-free-8786.dynv6.net +gpt-mail-free-8791.dynv6.net +gpt-mail-free-882.dynv6.net +gpt-mail-free-8886.dynv6.net +gpt-mail-free-8933.dynv6.net +gpt-mail-free-8944.dynv6.net +gpt-mail-free-902.dynv6.net +gpt-mail-free-9243.dynv6.net +gpt-mail-free-9307.dynv6.net +gpt-mail-free-9446.dynv6.net +gpt-mail-free-9502.dynv6.net +gpt-mail-free-9515.dynv6.net +gpt-mail-free-9584.dynv6.net +gpt-mail-free-9609.dynv6.net +gpt-mail-free-9620.dynv6.net +gpt-mail-free-9695.dynv6.net +gpt-mail-free-9825.dynv6.net +gpt-mail-free-9935.dynv6.net +gpt-mail.myftp.org +gpt20260701.top +gptmail.cc.cd +gptmail.us.ci +gptmail.webredirect.org +gptworkone.dev +gpxmail.win +gqov.top +grabafilafoundation.org +gracetvglobal.com +grandmamail.com +grandmasmail.com +graphicanal.site +graphicbulk.site +graphicdany.site +graphicedge.click +graphicedge.io.vn +graphicedge.site +graphicedge.tokyo +graphicenda.site +graphiclean.click +graphiclean.io.vn +graphiclean.site +graphiclean.tokyo +graphiclens.site +graphiclever.site +graphicmen.site +grassdev.com +gravexia.cfd +gravityengine.cc +great-host.in +greencafe24.com +greendike.com +greenhousemail.com +greensloth.com +greenvin.io.vn +greggamel.com +greggamel.net +gregorsky.zone +gregorygamel.com +gregorygamel.net +grendel.qzz.io +grewq.makeup +grimshawholdings.net +grimstroke.me +grish.de +gristod.my +griuc.schule +grn.cc +groklan.com +groupbuff.com +grqccqbwg.top +grr.la +grtd.beer +gruene-no-thanks.xyz +grugrug.ru +gruz-m.ru +gs-arc.org +gsoleyfoyle.org.uk +gsredcross.org +gsrv.co.uk +gsttony.shop +gsxstring.ga +gthyjuytr.dynv6.net +gts.cc.cd +guanshuyun.com +gudanglowongan.com +gudri.com +guerillamail.biz +guerillamail.com +guerillamail.de +guerillamail.info +guerillamail.net +guerillamail.org +guerillamailblock.com +guerrillamail.biz +guerrillamail.com +guerrillamail.de +guerrillamail.info +guerrillamail.net +guerrillamail.org +guerrillamailblock.com +guetshb.store +gufacoding.com +gufum.com +guima2.asia +gukox.org +gulfacmaintenance.xyz +gulfclimate.xyz +gulfhvacrepair.xyz +guozivpn.cc.cd +gurmerly.online +gustr.com +guysmail.com +guzukll.camdvr.org +gvqnpt.asia +gxemail.men +gxmail.top +gxybkq6.theworkpc.com +gyan-netra.com +gykf.hair +gyknife.com +gynzi.co.uk +gynzi.es +gzb.ro +gzeos.com +h0tmaii.com +h2beta.com +h8s.org +ha92.store +haadishah.co.uk +haben-wir.com +habenwir.com +habitnestguide.com +habitue.net +hacccc.com +hackersquad.tk +hackthatbit.ch +hadjoy.com +hahawrong.com +haibabon.com +haibaipei.ccwu.cc +haida-edu.cn +hailu.publicvm.com +hairs24.ru +halamaridfcfs.site +halashao1.dpdns.org +halashao3.us.ci +halcroft.org +haleloya.site +halionex.cfd +haltospam.com +hamham.uk +handrik.com +handsofhelpinc.org +handymandubaimarina.xyz +handymanfestivalcity.xyz +hanghai232.shop +hangxomcuatoilatotoro.ml +hanha.kozow.com +hanoinet.io.vn +happiseektest.com +happy-new-year.top +happy2023year.com +happy9toy.com +happydomik.ru +happyheadshed.org +happyhome.eu.cc +happyhorsespace.shop +haqimi.cc.cd +harakirimail.com +hardwork.icu +haren.uk +haribu.com +harpix.org.uk +hartbot.de +harthwaite.net +hasanmail.ml +hastana.com +hat-geld.de +hatespam.org +hathitrannhien.edu.vn +havefundarling.xyz +havertz.tk +hawrong.com +haydoo.com +hayys.app +hazelnut4u.com +hazelnuts4u.com +hazmat.help +hazmatshipping.org +hcap.ai +hccmail.win +hcypku.cloud +hdcroom.us +hdiscord.xyz +headerprism.me +headstrong.de +healingheartmission.org +healthforwomen.info +healxo.org +heathenhammer.com +heathenhero.com +hebase.com +hecat.es +heheee.com +heirfoundation.com +heisei.be +hellodns.site +hellodream.mobi +helloricky.com +hellosravan.in +helpinghandtaxcenter.org +helpjobs.ru +helpthechildren.uk +heocondeisng.cc +herclan.com +herilev.top +herlan.co.uk +heros3.com +herp.in +herpderp.nl +hertz.ltd +hesoyam.shop +hethongtudong.store +hetzez.com +heycmm.cn +heyzalo.vn +hezll.com +hfogzua.top +hh7f.com +hhan.top +hhe.org.uk +hhhhbfshb.date +hhyru.us +hi2.in +hi5.si +hiddentragedy.com +hideam.com +hidebox.org +hidebusiness.xyz +hidemail.de +hidemail.pro +hidemail.us +hidesmail.net +hidevak.com +hidingmail.net +hidmail.org +hidzz.com +hiemail.net +hieu.in +hieuclone.net +highapes.run.place +highbros.org +higher-tech.linkpc.net +highnestle.top +highstar.shop +hightech.jo3.org +higogoya.com +higuruma.site +hihi.lol +hikuhu.com +hillaxiant.xyz +hilltopcove.top +hilmipremindo.com +hilostar.com +hiltonvr.com +him6.com +himacreative.id +himail.infos.st +himail.online +hiredify.com +hiringview.com +histartool.com +hitbase.net +hitbtcpool.cloud +hiverun.io +hjdkker-kdet.click +hkuv.skin +hkvtop.us +hkxrde.asia +hldrive.com +hlkes.com +hmail.us +hmamail.com +hmh.ro +hnamkqdl.icu +hnfw-ngd.top +hnfw-ngd.wiki +hoanggiaanh.com +hoanglong.tech +hochsitze.com +hohohim.com +hoichvu.ddnsfree.com +hokyflix.site +hola.org +holio.day +holl.ga +holmes.de5.net +homeacpro.xyz +homeairconfix.xyz +homecoolair.xyz +homecoolservice.xyz +homecut.pro +homehappy.eu.cc +homesrepair.xyz +homesservicesdubai.xyz +homestartbromley.org.uk +homewiseleaf.com +homewrt.xx.kg +homvela.com +honesthirianinda.net +honesthvaccare.xyz +honesthvacpro.xyz +honestinterest.bond +honeydaybook.cyou +honeyparcels.shop +honeys.be +hongsemeixi.us.ci +honor-8.com +hook2ad.com +hookmono.click +hooooooo.store +hopefunder.com +hopemail.biz +hopesx.com +horizonspost.com +hormails.com +hornhorizon.com +hornyalwary.top +horsgit.com +host1s.com +hostcalls.com +hostguru.top +hosthalting.lol +hosthalting.site +hosthalting.store +hostingmail.me +hostlaba.com +hostpapa.dynv6.net +hot-mail.cf +hot-mail.ga +hot-mail.gq +hot-mail.ml +hot-mail.tk +hotboyckdh.shop +hotboyckdh1122.shop +hotboyckdhn55.shop +hotelpiesi.pro +hotelplazer.com +hotelplazer.fr +hotelplazer.org +hotelplazer.store +hotlinkimg.com +hotmai.com +hotmail-us.top +hotmailproduct.com +hotmailtrusted.com +hotmeil.net +hotmial.com +hotpop.com +hotprice.co +hotrokh.com +hotsmial.click +hotsoup.be +hottchurch.org.uk +hottmat.com +housat.com +houseaircon.xyz +houseclimate.xyz +housereformas.es +howardgiving.org +hpari.com +hpc.tw +hpj4l28.loseyourip.com +hqfi.hair +hqid.homes +hqpdf.com +hripleh.us.ci +hs.vc +hsmw.net +ht.cx +hta.2bd.net +hta.publicvm.com +htgb.help +hthlm.com +htmail.store +http.nyc.mn +httpsgreenwichmeantime.in +huage.me +hualabtech.com +huangao.xyz +huangniu8.com +hubaiclass.org +hubglee.com +hubhost.store +hudisk.com +hudska.dpdns.org +hudzer.com +huggsfeld.store +huizk.com +hukkmu.tk +hulapla.de +hulisang.edu.kg +hulkteam.cyou +huluwaaaron.eu.cc +humaility.com +hungpackage.com +hungtpt.site +hunnur.com +huolala.de5.net +huongdanfb.com +huongvemientrung.store +huoyumars.cc.cd +hushmail.cf +huskion.net +husng-kang.top +hutathuww.org +hutudns.com +huychau.click +huychau.online +huynhlx.shop +huynhtran.io.vn +huytuyen.click +huytuyen.online +huytuyen.site +huyvillafb.online +hvaccaredubai.xyz +hvaccaredxb.xyz +hvaccheckupuae.xyz +hvaccitywalk.xyz +hvaccompanydxb.xyz +hvaccontractorsdxb.xyz +hvaccrewuae.xyz +hvacdeskdubai.xyz +hvacdubaicreek.xyz +hvacexpertdubai.xyz +hvacexpertsuae.xyz +hvachubdxb.xyz +hvacinstallations247.xyz +hvacinstalldubai.xyz +hvacmotorcity.xyz +hvacpointdxb.xyz +hvacprosdxb.xyz +hvacrepairuae.xyz +hvacsatwa.xyz +hvacservicedubai.xyz +hvacservicesdubai.xyz +hvacservicingdubai.xyz +hvacsolutionsdubai.xyz +hvacspecialistuae.xyz +hvacsportshub.xyz +hvactechdxb.xyz +hvacunitdxb.xyz +hvacworksuae.xyz +hvaczonedubai.xyz +hvastudiesucces.nl +hvhg.skin +hviy.skin +hvva.hair +hwax4h4.giize.com +hwqmh2g.ddnsfree.com +hwsye.net +hxopi.ru +hxopi.store +hygle.net +hyhotmail.ccwu.cc +hymenjj.cfd +hypenated-domain.com +hyproxy.lol +i-dork.com +i-love-you-3000.net +i0mn8cx.mywire.org +i2b.asia +i2b.cam +i2b.com.vn +i2b.email +i2b.fun +i2b.id.vn +i2b.info +i2b.io.vn +i2b.lol +i2b.lu +i2b.mov +i2b.pw +i2b.space +i2b.vn +i2bgmail.com +i2c.email +i2c.pw +i2c.vn +i2i.vn +i2m.email +i2m.vn +i2n.vn +i2p.vn +i2pmail.org +i2u.vn +i2x.vn +i6.cloudns.cc +iafu.hair +iafu.skin +iandsec.cc.cd +iaoss.com +ibande.xyz +ibmdoors.com +ibmdoors.com.cn +ibnuh.bz +ibolinva.com +ibymail.com +icantbelieveineedtoexplainthisshit.com +icbr.us +iceans.cc.cd +icelandgcp.org.uk +icemail.club +ich-essen-fleisch.bio +ichecker.tech +ichigo.me +icidroit.info +ickletonrelief.co.uk +ickletonrelief.shop +icloudmail.kr +icloulb.com +icmans.com +iconcubic.com +iconmal.com +icotz.com +icousd.com +icubik.com +icwr.beer +icx.in +icx.ro +icznn.com +ideuse.com +idf.ovh +idfd.live +idg.io.vn +idns7v8.ooguy.com +idont.date +idu4aa4.info +idx4.com +idxue.com +ieatspam.eu +ieatspam.info +ieh-mail.de +iencm.com +ifeq.hair +iffymedia.com +ifoxdd.com +ige.es +igg.biz +ignoremail.com +igty.autos +ihateyoualot.info +ihazspam.ca +ihc3znb.theworkpc.com +iheartspam.org +ihnpo.food +ihra.hair +ijwqvo.asia +ikbenspamvrij.nl +ikewe.com +ikomail.com +ikuromi.com +ilck.hair +ilcvn.cn +illistnoise.com +illnessth.com +illubd.com +iloveion.com +ilovespam.com +ilyx7j5.theworkpc.com +im5z.com +imaanpharmacy.com +imagenbox.xyz +imagic.wiki +imail.edu.vn +imail1.net +imails.asso.st +imails.info +imailt.com +imap.fr.nf +imashr.com +imbo.hair +imc.io.vn +imfaya.com +img-free.com +imgof.com +imgv.de +imlimikom.store +immo-gerance.info +imnart.com +imperialcnk.com +importemail.com +imranbt.store +imranccnn.buzz +imrancm.buzz +imrancumi.buzz +imranking.buzz +imranmax.buzz +imranspc.buzz +imstations.com +imul.info +in-ulm.de +in2reach.com +inactivemachine.com +inbax.tk +inbound.plus +inbox.si +inbox2.info +inboxalias.com +inboxbear.com +inboxclean.com +inboxclean.org +inboxdesign.me +inboxed.im +inboxed.pw +inboxfast.space +inboxfly.space +inboxkitten.com +inboxly.website +inboxnow.ru +inboxnow.store +inboxopen.space +inboxorigin.com +inboxproxy.com +inboxstore.me +inclick.net +inclusiveprogress.com +incognitomail.com +incognitomail.net +incognitomail.org +incq.com +inctart.com +ind.st +inderpalsandhu.com +indevgo.com +index-mail.com +indianahorsecouncil.org +indieclad.com +indigobook.com +indirect.ws +indomaed.pw +indomina.cf +indoserver.stream +indosukses.press +indoxs.bond +indsec.online +ineec.net +inetopenwrt.dpdns.org +infix1.io.vn +inflyratech.site +infobuzzsite.com +infocom.zp.ua +infoisp.me +infolinewest.com +ingam.online +inggo.org +inilogic.com +init.ink +inkiny.com +inkomail.com +inlook.cloud +inly.vn +inmune.ddns.net +inmynetwork.tk +innovationvirtuelle.asia +inoutmail.de +inoutmail.eu +inoutmail.info +inoutmail.net +inpwa.com +inreur.com +insanony.art +insanony.one +insanony.store +insanumingeniumhomebrew.com +insgrmail.site +inshuan.com +insorg-mail.info +instaddr.ch +instaddr.uk +instaddr.win +instagr.vn +instagra.vn +instagram.io.vn +installalquoz.xyz +installdubai.xyz +installkarama.xyz +installmiddleeast.xyz +installmydubai.xyz +installwarsan.xyz +instance-email.com +instant-mail.de +instantaircon.xyz +instantblingmail.info +instantemailaddress.com +instantfreon.xyz +instantletter.net +instantmail.fr +instantrepairs.xyz +instmail.uk +instrete.com +intady.com +interestgrove.bond +internet-v-stavropole.ru +internetkeno.com +internetoftags.com +interstats.org +intersteller.com +intlgalleryheritageculture.org +intobx.com +intopwa.com +intopwa.net +intopwa.org +introex.com +inversiq.cfd +investore.co +inwagit.com +inxout.dpdns.org +ioioioio.sbs +iojn.hair +iolq.top +ionolenonos.com +ionolenonos.fr +ionolenonos.info +ionolenonos.store +ionq.pl +iotf.net +iozak.com +ip4.pp.ua +ip6.pp.ua +ipaddressforme.com +ipinf.eu.org +ipoo.org +ippandansei.tk +ipsur.org +ipusgo.cfd +ipxwan.com +iqec.skin +iqfucsod.top +iqxu.hair +irabops.com +iralborz.bid +iraniandsa.org +iraqedu.online +irc.so +irealiy.cyou +iridales.com +irinakicka.site +irish2me.com +irishspringrealty.com +iroid.com +ironbrookco.com +ironiebehindert.de +irpine.com +irssi.tv +is.af +isdaq.com +isep.fr.nf +isfew.com +ishop2k.com +ismartsense.online +isosq.com +ispeedtest.digital +ist-hier.com +istii.ro +isukrainestillacountry.com +iswin.ccwu.cc +it7.ovh +italy-mail.com +itaolo.com +itcompu.com +itduniya.online +itfast.net +itit.tk +itmj3po.ddnsfree.com +itmo.edu.pl +itos.cloudns.org +itquoted.com +itsbds.com +itsedit.click +itsjiff.com +itspid.com +itunesgiftcodegenerator.com +iuanhoi.store +iubridge.com +iuemail.men +iuno.fun +iupo219.ddnsfree.com +ivpnxoo.cfd +ivythorn.net +iwatermail.com +iwx4k98.theworkpc.com +ixaks.com +ixhale.com +ixqr.hair +ixunbo.com +ixx.io +iya.fr.nf +iysqv.com +izhowto.com +izimybes.lt +izunasan.my.id +izunasuite.biz.id +izymybes.lt +j-p.us +j3r8qd.space +j5bie4.tech +jabmag.com +jackierobinsonparkoffame.org +jadenursery.top +jafps.com +jaga.email +jagomail.com +jailbreakeverything.com +jaipas.lu +jajxz.com +jakarta.io.vn +jakemsr.com +jakl.li +jamesat.biz.id +jamesat.my.id +jamesjfattorini.rocks +jamesthynnealmshouse.co.uk +jamyjmkqdsc.com +janestore.xyz +janproz.com +japanesegirls.cc +japnc.com +jaqis.com +jarszone.com +jasminesports.com +jasonbella.online +jasonswheels.org +jav8.de +javadmin.com +javaemail.com +javafs.com +javaka.live +javindra.cfd +jazzvip.site +jbsu.hair +jbsze.com +jbsze.ne +jbsze.net +jc58t04.kozow.com +jcaton.com +jcnorris.com +jdmadventures.com +jdz.ro +je-recycle.info +jejes.de +jejesfb.biz.id +jellow.ml +jellycat.eu.cc +jellyglimmer.me +jellyraccoon.lol +jellyrolls.com +jeoce.com +jeremytunnell.net +jessitrust.com +jessyx.bond +jet-renovation.fr +jetable.com +jetable.fr.nf +jetable.net +jetable.org +jetable.pp.ua +jewby.com +jgjitffy.store +jgkcr.com +jhfnre-kjf.sbs +jhkf.beer +jhphoto.top +ji-a.cc +ji5.de +ji6.de +ji7.de +jiangwy.one +jiaoo.pp.ua +jiaxi.work +jibbo01.com +jieluv.com +jika.gg +jilingling.eu.cc +jincer.com +jingood.dpdns.org +jinkeyun.com +jinva.fr.nf +jiongguo.top +jiooq.com +jioso.com +jisan.uk +jisankhan1.site +jiuji.asia +jjfcharitabletrust.co.uk +jjice.com +jjj.ee +jjk.app +jjlj.fashion +jjmj.fashion +jjuisyj.top +jjxj.fashion +jjxt6lv.mywire.org +jkotypc.com +jksndh-afd2.wiki +jlpevents.co.uk +jmail.fr.nf +jmail.ovh +jmail.ro +jmods.me +jmt2469.xyz +jnad.skin +jndp.hair +jnwexkd.giize.com +jnxjn.com +jobbikszimpatizans.hu +jobbrett.com +jobdatei.de +jobposts.net +jobs-to-be-done.net +jobscai.com +jobsma.pp.ua +jobzyy.com +joelpet.com +joetestalot.com +jofuso.com +johorulcloud.space +joihonm.shop +jojolt.shop +jojomedia.store +jonira.sbs +jonsjav.cc +jopho.com +jora.dpdns.org +joseihorumon.info +josse.ltd +jourrapide.com +joymail.cyou +joywavepoint.com +jp-ml.com +jpco.org +jrhmail.com +jsifh5i.kozow.com +jsnc.cloud +jsncos.com +jsonlark.me +jsonmender.me +jsrsolutions.com +jualakun.com +jualakunfb.co +jualfb.co +juicehour.com +jumeirahmaintenance.com +jumeirahparkmaintenance.com +jumonji.tk +jungkamushukum.com +junk.to +junk1e.com +junkmail.ga +junkmail.gq +just-email.com +justdefinition.com +justemail.ml +juvanta.cfd +juyouxi.com +jvcmaintenance.com +jvtmaintenance.com +jwork.ru +jxin.hair +jxpomup.com +jy36nnvi.icu +jysnk.com +jywa.social +jzlvoei.cn +jzlz.hair +jzzm.top +k-global.dev +k4money.com +kabamail.com +kabarr.com +kabinbilla.com +kademen.com +kadokawa.cf +kadokawa.ga +kadokawa.gq +kadokawa.ml +kadokawa.tk +kaengu.ru +kagi.be +kajaib.social +kaka0.kr +kakadua.net +kakao-mail.com +kakaomail.kr +kakator.com +kakaveo3.io.vn +kakslsie.store +kalapi.org +kallokarlabahi.online +kalquoris.cfd +kalwa.fun +kamen-market.ru +kamete.org +kampret.asia +kamsg.com +kanjoosbahi.site +kankoplm.eu.cc +kanlangld.shop +kanonmail.com +kantclass.com +kaoing.com +kaovo.com +kappala.info +kapten.site +kaptencpl.com +kara-turk.net +karatraman.ml +kardarankab.online +karenkey.com +kariplan.com +karkambahi.store +karta-kykyruza.ru +kartvelo.com +kashre.com +kasmail.com +kasmirfx.buzz +kaspop.com +katalyst.indevs.in +kathrynis.my.id +kathrynis.web.id +katputli.world +kattthu.us +katztube.com +kavio.my.id +kaw-sar.top +kawneha.site +kaybooks.top +kayfilms.top +kaygroup.top +kayilo.com +kaynlab.com +kazava.tech +kazelink.ml +kbishwanathuk.cc +kbox.li +kcoporation.com +kcql.hair +kcrw.de +kcxxvqyx.icu +kcya.skin +kd2.org +kdpsl.org +ke1le.cyou +kee40vq.ddnsfree.com +keecs.com +keepmail.dev +keepmymail.com +kein.date +keinhirn.de +keipino.de +kejinxi.xyz +kekita.com +kelenson.com +kelimo.sbs +kellychibale-researchgroup-uct.com +kemail.uk +kempstoncharities.band +kempstoncharities.co.uk +kemptvillebaseball.com +kenari.online +kendev.id.vn +kenfern.com +kenhbanme.com +kenhphim.net +kenvanharen.com +kepkat.com +kepkat.site +kerotu.com +ket-qua.org +ketimunfam.online +ketua.id +kgfu.makeup +khaibn.com +khamu.me +khoke.nl +khtextile.com +kia-sdn.me +kiani.com +kidaroa.com +kiecchn.com +kierko.com +kiki287666.xyz +killlove.site +killmail.com +killmail.net +killyourtime.com +kilverstone.net +kimagure.ccwu.cc +kimagure1.cc.cd +kimdyn.com +kimgmail.com +kimora.space +kimsdisk.com +kimzavin.shop +kinda.email +kindamail.com +kindnessjunction.sbs +kindredpicnic.cyou +kinfolkcanvas.sbs +kingdais.com +kingproplan.site +kingsholme.net +kingsq.ga +kingss.de5.net +kino-100.ru +kintil.buzz +kiois.com +kismail.ru +kisoq.com +kissgy.com +kisstwink.com +kitap.az +kitnastar.com +kiwkiw.shop +kiwof.com +kjhg.hair +kjkpc.net +kjkszpjcompany.com +kjnbtv.dedyn.io +kk.io.vn +kkdty.dynv6.net +kkkoouy.cyou +kkmail.be +kkoup.com +kksm.be +klassmaster.com +klassmaster.net +kleinanzeigen-verification.de +klick-tipp.us +kliknesia.io +klingai.asia +klipschx12.com +kloap.com +klovenode.com +kludgemush.com +klut.io +klyverra.cfd +klzlk.com +kmail.li +kmail.live +kmail.qzz.io +kmail123.com +kmhow.com +knaresboroughtownmuseum.org +knickerbockerban.de +knilok.com +knmcadibav.com +knol-power.nl +knowledgemd.com +kobrandly.com +kodeholik.site +kodpan.com +kokalo.store +kokklsd.dpdns.org +koletter.com +kommunity.biz +kon42.com +konican.com +konigyuan.us.ci +konterkulo.com +kontoko.org +konultant-jurist.ru +kook.ml +kopagas.com +kopaka.net +korimoddin.store +korona-nedvizhimosti.ru +korvanta.cfd +koshu.ru +kosmetik-obatkuat.com +kostenlosemailadresse.de +koszmail.pl +kpay.be +kpmn-design.org +kpooa.com +kpost.be +kppk.beer +kpxj.hair +kpxj.skin +kqbz.beer +kqhmln6.theworkpc.com +kravintis.cfd +krd.ag +kreabaka.site +krouter.net +krsw.tk +kruay.com +krypton.tk +krysentra.cfd +kskblzdjdwkzkbl.top +ksmtrck.tk +kswm.beer +ktisocial.asia +ktpingprox.id.vn +kuailesidiwen.top +kuhaku.indevs.in +kuhrap.com +kuku.lu +kulmeo.com +kulturbetrieb.info +kumli.racing +kurin.sbs +kuromee.com +kuromee.store +kurumibnb.dog +kurzepost.de +kutakbisajauhjauh.gq +kv2vpn.eu.org +kvbs.hair +kvhrr.com +kvhrs.com +kvhrw.com +kwifa.com +kwift.net +kwilco.net +kwtest.io +kxbj.beer +kyal.pl +kynninc.com +kyntaris.cfd +kyois.com +kyriog.fr +kyuusei.fr.nf +kyx9sgz.loseyourip.com +kzccv.com +l-c-a.us +l2gyw37.mywire.org +l2rrz31.ddnsfree.com +l33r.eu +l6factors.com +laafd.com +labananmakmur.com +labetteraverouge.at +labforge.freeddns.org +laborderie.com +labworld.org +lacedmail.com +lackmail.net +lackmail.ru +lacraffe.fr.nf +lacto.info +lags.us +laicai8.sbs +lailmiki.store +lain.ch +lak.pp.ua +lakeground.shop +lakelivingstonrealestate.com +lakqs.com +laksamantunggalakma.me +lalayun.cyou +lalulahoot.me +lamasticots.com +lambsauce.de +landmail.co +lanstudio.top +lanuiopl.bond +laoeq.com +laoia.com +lapakqu.com +lapluz.xyz +lappies.net +laptoplonghai.com +larisia.com +larland.com +lashyd.com +last-chance.pro +laste.ml +lastexile.site +lastmail.co +lastmail.com +laulund.info +launchpadx.shop +launders.money +lawlita.com +laxex.ru +laxex.store +laxiw.org +layanmaintenance.com +laymro.com +lazerbade.com +lazerbade.fr +lazerbade.org +lazerbade.store +lazyinbox.com +lazyinbox.us +lbrmail666.site +lbvz.homes +lcvfdvynb.top +ldaho.biz +ldkll.cn +ldofy2e.ooguy.com +ldop.com +ldtp.com +le-tim.ru +leadwizzer.com +leafflip.com +lebetrust.org +lecn.beer +lee.mx +leechchannel.com +leeching.net +leetmail.co +lefruit-dev.work +legalrc.loan +legendaryseller.com +leie.me +lellno.gq +lellol.dev +lellol.tech +lemonkk.cn +lenovog4.com +leoguio.site +leopik.com +lerany.com +lerbhe.com +lerch.ovh +lero3.com +leruvo.icu +lesobprovermail.com +lessismore.eu.cc +letterhaven.net +letterprotect.net +lettersboxmail.com +letthemeatspam.com +levi.cc.cd +leviacerman.store +lez.se +lfsz.beer +lftl.hair +lgxscreen.com +lhsdv.com +liadhene.com +liamcyrus.com +liang-tts.shop +liangganxiaopu.bond +libinit.com +licccons.icu +licenses.sbs +lifebitsnotes.com +lifebyfood.com +lifetimefriends.info +lifetotech.com +lifetreechurch.co.uk +lifewiseleaf.com +liggegi.com +lightnestmarket.shop +lightv.online +ligsb.com +likeageek.fr.nf +likemovie.net +likevip.net +lilbahlil.me +lillemap.net +lilo.me +lilspam.com +lilsuite.id +limcil.cyou +lindenbaumjapan.com +lindenmere.net +link2mail.net +linkbento.me +linkcoll.my.id +linkedindiscount.com +linkedintuts2016.pw +linkmail.info +linkspo.my.id +linlin.cloud +linlshe.com +linshiyou.com +linshiyouxiang.net +linux-do.me +linuxgo.us.ci +linuxmail.so +linxi.online +linyu.qzz.io +linzefor.asia +linzefor.shop +liocbrco.com +liondapt.com +liopsacac.shop +liovexphoenix.fun +lista.cc +litedl.com +litedrop.com +littlecourtyard.homes +littlejohns.info +littlemvh.org.uk +littlewildnote.cyou +littsocial.com +liun.cc.cd +liuyuyu.space +liveforms.org +liveradio.tk +livinglegendsmaintenance.com +livinitlarge.net +lixlord.xyz +liyao.edu.kg +lizery.com +lkgn.se +llciuoau.top +llogin.ru +lloudfsxly.top +lnovic.com +lnwtt.com +loadby.us +loan101.pro +loaoa.com +loapq.com +localairconservice.xyz +localamcrepair.xyz +localhvaccare.xyz +localmingle.sbs +locanto1.club +locantofuck.top +locantowsite.club +locawin.com +locomodev.net +loganister.com +logicfieldzen.com +logicstreak.com +login-email.cf +login-email.ga +login-email.ml +login-email.tk +logsmarter.net +logular.com +loh.pp.ua +lohinja.com +loin.in +lokenathassociation.co.uk +lolfreak.net +lolmail.biz +lonaxter.site +londonyouthsailing.org +lonegarden.top +longsbkt.xyz +lookugly.com +loommosaic.cfd +lordfortescue.news +lordfortescue.org.uk +lordofmysteries.org +lordsofts.com +lortemail.dk +losemymail.com +lostnow.org +love-your.mom +lovecalculatorname.org +lovecv.cn +lovegivingsadaqah.org +lovemeet.faith +lovemeleaveme.com +lovepet.vip +lovertboy.online +loveuu.xyz +lowprizo.com +lpfmgmtltd.com +lqkrxvc.loseyourip.com +lr7.us +lr78.com +lroid.com +lru.me +ls-server.ru +lsaar.com +lsbl6fq.mywire.org +lsd10086.ccwu.cc +lsd8866.ccwu.cc +lsereborn.com +lsfh.hair +lsirdomain.us.ci +lsyx24.com +lts35.help +lu1mtac.ooguy.com +luckfeed.com +lucktaro.com +luckymail.org +luffygadgets.com +lugiz.com +lujialu.edu.kg +lujian.de5.net +lukecarriere.com +lukemail.info +lukop.dk +lum25kcredit.io.vn +lumeika.com +lumg.uk +luminexis.cfd +luminix1.shop +lumm25k.io.vn +lumyrix.cfd +lunarmoon.online +lunetra.shop +lunor.cfd +lushiyi.eu.cc +lushosa.com +lutech.uk +luv2.us +luxentra.cfd +luxovira.cfd +luxudata.com +lxbeta.com +lxydawang.top +lydir.com +lyfestylecreditsolutions.com +lyft.live +lympstonevillagehall.co.uk +lynex.sbs +lyngo.tech +lynwise.shop +lyricspad.net +lyxhzz.com.cn +lzoaq.com +lzum.homes +m21.cc +m4ilweb.info +ma1l.duckdns.org +mabal.fr.nf +maboard.com +mabox.eu +mac-24.com +machen-wir.com +macmail.info +macos.one +macr2.com +macromaid.com +macromice.info +macsnipe.com +magamail.com +magbit.food +maggotymeat.ga +magicbox.ro +magim.be +magspam.net +mahjonglore.me +mahreenlifestyle.shop +maidlow.info +mail-burn.com +mail-card.net +mail-easy.fr +mail-filter.com +mail-help.net +mail-hosting.co +mail-hub.info +mail-mario.fr.nf +mail-now.top +mail-owl.com +mail-share.com +mail-temporaire.com +mail-temporaire.fr +mail-tester.com +mail.by +mail.gw +mail.tm +mail.wtf +mail0.ga +mail1.top +mail101.xyz +mail10m.com +mail11.xyz +mail114.net +mail123.beer +mail123.click +mail123.com.br +mail123.fr +mail123.online +mail123.pro +mail123.site +mail123.tech +mail123.website +mail123box.tech +mail12h.com +mail1a.de +mail1mail.com +mail1web.org +mail21.cc +mail22.club +mail2me.co +mail2rss.org +mail333.com +mail4.uk +mail456.fr +mail4qa.com +mail4trash.com +mail666.ru +mail7.io +mail707.com +mail72.com +mail789.dedyn.io +mail789.fr +mailaddress.de +mailadresi.tk +mailapp.top +mailapril.org +mailba.uk +mailback.com +mailbai.com +mailbali.com +mailbidon.com +mailbiscuit.com +mailbiz.biz +mailblocks.com +mailbox.in.ua +mailbox.zip +mailbox49.com +mailbox52.ga +mailbox80.biz +mailbox82.biz +mailbox87.de +mailbox92.biz +mailboxify.ru +mailboxify.store +mailboxly.ru +mailboxly.store +mailboxy.fun +mailboxy.ru +mailboxy.store +mailbucket.org +mailcat.biz +mailcatch.com +mailchannels.de +mailchatgpt.eu.cc +mailchop.com +mailcker.com +mailclone2023.top +maildax.me +mailde.de +mailde.info +maildrop.cc +maildrop.cf +maildrop.ga +maildrop.gq +maildrop.ml +maildu.de +maildx.com +maildy.site +maileater.com +mailed.in +mailed.ro +mailedu.edu.pl +maileduvn.us +maileimer.de +maileme101.com +mailer.edu.pl +mailer.io.vn +mailers.edu.pl +mailexpire.com +mailf5.com +mailfa.tk +mailfall.com +mailfast.pro +mailfirefly.com +mailfirst.icu +mailfor1month.shop +mailforgo.site +mailforspam.com +mailfortiktok.us +mailfree.ga +mailfree.gq +mailfree.ml +mailfreeonline.com +mailfs.com +mailgo.cyou +mailguard.me +mailgutter.com +mailhazard.com +mailhazard.us +mailhex.com +mailhz.me +mailimate.com +mailin8r.com +mailinatar.com +mailinater.com +mailinator.co.uk +mailinator.com +mailinator.gq +mailinator.info +mailinator.net +mailinator.org +mailinator.us +mailinator0.com +mailinator1.com +mailinator2.com +mailinator2.net +mailinator3.com +mailinator4.com +mailinator5.com +mailinator6.com +mailinator7.com +mailinator8.com +mailinator9.com +mailincubator.com +mailisia.com +mailismagic.com +mailistry.com +mailita.tk +mailjunk.cf +mailjunk.ga +mailjunk.gq +mailjunk.ml +mailjunk.tk +mailku.co +mailllshop.website +maillog.uk +mailmagnet.co +mailmate.com +mailmaxy.one +mailmay.org +mailme.gq +mailme.ir +mailme.lv +mailme24.com +mailmenot.io +mailmetrash.com +mailmoat.com +mailmoth.com +mailms.com +mailna.biz +mailna.co +mailna.in +mailna.me +mailnada.cc +mailnada.com +mailnator.com +mailnesia.com +mailnet.io.vn +mailnoop.store +mailnull.com +mailnuo.com +mailo.edu.pl +mailold.us +mailonaut.com +mailorc.com +mailorg.org +mailosaur.net +mailox.fun +mailp.org +mailphu.com +mailpick.biz +mailpluss.com +mailpooch.com +mailpoof.com +mailpress.gq +mailpro.lat +mailpro.live +mailproxsy.com +mailpts.com +mailpull.com +mailquack.com +mailrock.biz +mailrun.one +mailsa.biz.id +mailsa.my.id +mailsac.com +mailsafe.fr.nf +mailsbay.com +mailscrap.com +mailseal.de +mailserv.info +mailshan.com +mailshell.com +mailshiv.com +mailshou.com +mailshun.com +mailsiphon.com +mailslapping.com +mailslite.com +mailslurp.com +mailsucker.net +mailt.net +mailt.top +mailtao.me +mailtechx.com +mailtecom.com +mailtemp.info +mailtemple.xyz +mailtemporaire.com +mailtemporaire.fr +mailtest.ccwu.cc +mailto.plus +mailtome.de +mailtothis.com +mailtraps.com +mailtrash.net +mailtrix.net +mailtub.com +mailtv.net +mailtv.tv +mailuniverse.co.uk +mailvip.net +mailw.site +mailx.click +mailxyz.cyou +mailyan.my.id +mailzi.ru +mailzilla.com +mailzilla.org +mailzy.org +mainerfolg.info +mainkask.site +maintdxb.xyz +maintenancecitywalk.xyz +maintenancedamachills.xyz +maintenancedso.xyz +maintenancejaddaf.xyz +maintenancevictory.xyz +maintmudon.xyz +maintsportshub.xyz +make.cc.cd +makemenaughty.club +makemetheking.com +makeraura.online +makertrial.com +makesomestone.shop +makmursrondol.store +makoli.sbs +makoli.space +malahov.de +malayalamdtp.com +malioter.pro +mama3.org +mamabood.com +mamangbadrut.site +mameganteng.store +mamulenok.ru +managedisabled.online +mandraghen.cf +manhmmonew.online +manifestgenerator.com +mannawo.com +mansiondev.com +maohe.cloud +maplemarketry.shop +mapleveranda.homes +mapsguy.com +marchguidesassociation.org +marchguidesassociation.org.uk +marhumal.tech +marineso.com +mariyaa.pp.ua +mark-compressoren.ru +markableytrust.org.uk +markaihub.shop +markandvirginiarometty.org +marketlink.info +markmurfin.com +markstonehub.org +marrytodo.de +martenson-mail.mywire.org +martenson-mail.ooguy.com +martenson-mail.theworkpc.com +masbahlil.xyz +mask03.ru +maskmy.id +masonline.info +master24x7.xyz +masterannual24x7.xyz +masterannualquick.xyz +mastercareae.xyz +mastercareexpress.xyz +masterhandyman.xyz +masteryforn.shop +maswae.world +matamuasu.ga +matchpol.net +matjoa.com +matmayer.com +matra.site +max-mail.org +maxresistance.com +maxseeding.com +maxtanie.com +maxturns.com +maxxspace.com +mayre.shop +mbox.re +mbrcityservices.com +mbx.cc +mbygjjo.mywire.org +mc-fly.be +mc088ue.loseyourip.com +mcache.net +mcdomaine.fr.nf +mchasd.eu.cc +mciek.com +mcpservers.one +mcs.cc.cd +mcunnm.ccwu.cc +mdahld.eu.cc +mdhc.tk +mdz.email +meadowsdubaimaintenance.com +mealwhim.me +meantinc.com +mebeiuk.co.uk +mebelnu.info +mech2build.io.vn +mechanicalresumes.com +mechanicspedia.com +medevsa.com +mediaeast.uk +mediaholy.com +medicichoir.org +mediseat.com +medkabinet-uzi.ru +meef.uk +meepsheep.eu +meevpo.id +megasend.org +mehda.eu.cc +mehr-bitcoin.de +meidecn.com +meikeya.com +meinspamschutz.de +meinvr.com +meitu.io.vn +meituy.com +mekqh.eu.cc +melbourne.edu.pl +melbournecrest.net +mellowharbor.cyou +melorvian.com +meltcoo.com +meltedbrownies.com +meltmail.com +meltp.com +memeazon.com +memoniclife.online +memsg.site +mendpetal.me +meng2026.bond +meng2026.cyou +mengma.eu.cc +mengundang.live +mentonit.net +meocon.org +meomo.store +meonvr.com +mepost.pw +merepost.com +merry.pink +meruado.uk +merumart.com +merxo.me +mesemails.fr.nf +mess-mails.fr.nf +messagebeamer.de +messibucu.click +messwiththebestdielikethe.rest +meta.aid.pl +meta.auto.pl +meta.corsica +meta.mail.pl +metadownload.org +metaintern.net +metajaya.biz.id +metalunits.com +metaorbitx.com +metas.io.vn +metroacpro.xyz +metroamcservice.xyz +metrofixit.xyz +mexvat.com +mezimages.net +mfapi.dpdns.org +mfsa.info +mfsa.ru +mfunza.com +mfxis.com +mgdns.shop +mgtop.cc +mgxianlu.gq +mhzayt.online +miaferrari.com +mianfeibuluo.com +miaowuai.buzz +miauj.com +michaeladmin.eu +michaeladmin.fr +michaeladmin.org +michaeladmin.store +mickaben.fr.nf +micropaste.com +midcoastcustoms.com +midcoastcustoms.net +midcoastsolutions.com +midcoastsolutions.net +middletoncheneyuc.uk +mideastlens.com +mideastview.com +midiharmonica.com +midlertidig.com +midlertidig.net +midlertidig.org +midwestpride.org +mierdamail.com +migmail.net +migmail.pl +migumail.com +mihep.com +miistermail.fr +mijnhva.nl +mikesomelike.shop +mikfarm.com +mikrotikvietnam.com +mikrotikvn.com +mikrotikx.com +mikumirai.top +milllogiciel.asia +miloras.fr.nf +minafter.com +minefieldmail.com +minhquang2000.com +minidmx.icu +minimail.gq +ministry-of-silly-walks.de +minitts.net +minsmail.com +mintemail.com +minuteafter.com +minuteinbox.com +mipg.autos +mirai.re +miramaintenance.com +mirasync.tokyo +mirdifmaintenance.com +miros.cloud +missionbulldogs.org +misterpinball.de +mitico.org +mitrabisa.com +mitraprem.online +mitraprem.site +miucce.com +miwacle.com +mixmail.site +mixzu.net +mji.ro +mjj.edu.ge +mjukglass.nu +mkeya.com +mkpfilm.com +mkql.autos +mkseiuuda.top +mkvesta.io.vn +mkvo.hair +mkzaso.com +ml8.ca +mlanm.online +mlgmail.top +mliok.com +mlumzmh.cn +mm.my +mm2flip.pw +mm5.se +mmaily.com +mmayl.com +mmcat.icu +mmdesign.work.gd +mmmggg0123.ccwu.cc +mmmo.us.ci +mmo.us.ci +mmo365.store +mmyuu.cn +mnode.me +mnvr.site +moakt.cc +moakt.co +moakt.com +moakt.ws +mobileninja.co.uk +mobilevpn.top +moblha.com +moburl.com +mochuangcheng.com +mockata.net +mockmyid.com +modirosa.com +modolku.store +moeri.org +mofu.be +mohmal.com +mohmal.im +mohmal.in +mohmal.tech +moimoi.re +mokondo.today +mokondoo.cyou +mokook.com +molabo.bond +moldind.help +molms.com +momentics.ru +momoi.uk +momopifa.cc.cd +momroad.org +mona.edu.kg +mona.edu.pl +mona.edu.rs +monachat.tk +monadi.ml +monchu.fr +moncourrier.fr.nf +mondial.asso.st +monemail.fr.nf +moneypipe.net +monglung.space +mongrec.top +monity.top +monmail.fr.nf +monomoho.site +monopacket.com +monotensor.com +monumentmail.com +monyal.shop +moolee.net +moonapps.org +moondyal.com +moonfee.com +moonhuddle.cyou +moonikent.us +moonlitwares.shop +moonstarsun.shop +moonwake.com +mooo.com +moorgatecorp.net +moot.es +mopess.help +mora45ktil.io.vn +moravita.com +moreawesomethanyou.com +moreorcs.com +morriesworld.ml +morsin.com +moruzza.com +mossatelier.cfd +mosslandings.homes +mosswoodmissionhall.bio +motion.jo3.org +motique.de +motorcitymaintenance.com +mototoke.click +mountainregionallibrary.net +moutianwuliu.top +mowline.com +mox.pp.ua +moy-elektrik.ru +moyang303.de5.net +moza.pl +mozej.com +mp-j.ga +mp3oxi.com +mpk.ovh +mr-email.fr.nf +mr24.co +mrcheannko45k.io.vn +mriscan.live +mriscanner.live +mrizkifreelace.dpdns.org +mrnz.skin +mrotzis.com +mrphoto.org +mrvpm.net +mrvpt.com +msarra.com +msgos.com +msn-mail-free-1.dynv6.net +msn-mail-free-1092.dynv6.net +msn-mail-free-1268.dynv6.net +msn-mail-free-1522.dynv6.net +msn-mail-free-1659.dynv6.net +msn-mail-free-1750.dynv6.net +msn-mail-free-189.dynv6.net +msn-mail-free-1974.dynv6.net +msn-mail-free-1980.dynv6.net +msn-mail-free-2112.dynv6.net +msn-mail-free-2193.dynv6.net +msn-mail-free-2205.dynv6.net +msn-mail-free-2634.dynv6.net +msn-mail-free-2681.dynv6.net +msn-mail-free-3011.dynv6.net +msn-mail-free-3229.dynv6.net +msn-mail-free-3232.dynv6.net +msn-mail-free-3270.dynv6.net +msn-mail-free-33.dynv6.net +msn-mail-free-3312.dynv6.net +msn-mail-free-3373.dynv6.net +msn-mail-free-3414.dynv6.net +msn-mail-free-3622.dynv6.net +msn-mail-free-3632.dynv6.net +msn-mail-free-3737.dynv6.net +msn-mail-free-3812.dynv6.net +msn-mail-free-4062.dynv6.net +msn-mail-free-4088.dynv6.net +msn-mail-free-4151.dynv6.net +msn-mail-free-4290.dynv6.net +msn-mail-free-4304.dynv6.net +msn-mail-free-4411.dynv6.net +msn-mail-free-4518.dynv6.net +msn-mail-free-4640.dynv6.net +msn-mail-free-4718.dynv6.net +msn-mail-free-4868.dynv6.net +msn-mail-free-5064.dynv6.net +msn-mail-free-5162.dynv6.net +msn-mail-free-5184.dynv6.net +msn-mail-free-5198.dynv6.net +msn-mail-free-5402.dynv6.net +msn-mail-free-5415.dynv6.net +msn-mail-free-554.dynv6.net +msn-mail-free-5696.dynv6.net +msn-mail-free-5718.dynv6.net +msn-mail-free-5872.dynv6.net +msn-mail-free-6047.dynv6.net +msn-mail-free-6113.dynv6.net +msn-mail-free-6326.dynv6.net +msn-mail-free-6581.dynv6.net +msn-mail-free-6589.dynv6.net +msn-mail-free-6760.dynv6.net +msn-mail-free-678.dynv6.net +msn-mail-free-6877.dynv6.net +msn-mail-free-6883.dynv6.net +msn-mail-free-6906.dynv6.net +msn-mail-free-6943.dynv6.net +msn-mail-free-6959.dynv6.net +msn-mail-free-6981.dynv6.net +msn-mail-free-708.dynv6.net +msn-mail-free-7155.dynv6.net +msn-mail-free-727.dynv6.net +msn-mail-free-733.dynv6.net +msn-mail-free-7424.dynv6.net +msn-mail-free-7429.dynv6.net +msn-mail-free-7434.dynv6.net +msn-mail-free-7509.dynv6.net +msn-mail-free-7570.dynv6.net +msn-mail-free-7742.dynv6.net +msn-mail-free-7760.dynv6.net +msn-mail-free-8047.dynv6.net +msn-mail-free-810.dynv6.net +msn-mail-free-8131.dynv6.net +msn-mail-free-8282.dynv6.net +msn-mail-free-8582.dynv6.net +msn-mail-free-86.dynv6.net +msn-mail-free-8632.dynv6.net +msn-mail-free-8704.dynv6.net +msn-mail-free-8776.dynv6.net +msn-mail-free-8841.dynv6.net +msn-mail-free-890.dynv6.net +msn-mail-free-8952.dynv6.net +msn-mail-free-8986.dynv6.net +msn-mail-free-9002.dynv6.net +msn-mail-free-9061.dynv6.net +msn-mail-free-9121.dynv6.net +msn-mail-free-9173.dynv6.net +msn-mail-free-9224.dynv6.net +msn-mail-free-9313.dynv6.net +msn-mail-free-9368.dynv6.net +msn-mail-free-9382.dynv6.net +msn-mail-free-9444.dynv6.net +msn-mail-free-9536.dynv6.net +msn-mail-free-9587.dynv6.net +msn-mail-free-9597.dynv6.net +msn-mail-free-9649.dynv6.net +msn-mail-free-9734.dynv6.net +msn-mail-free-9921.dynv6.net +msn-mail-free-9990.dynv6.net +msn-mail-free-9998.dynv6.net +mspeciosa.com +msqatl.com +msrc.ml +msssg.com +msvw.skin +mswork.ru +msxd.com +mt2009.com +mt2014.com +mt2015.com +mtdalmshouse.fitness +mtdalmshouse.uk +mtdog.xyz +mtmdev.com +mtnewtoy.us +mtshop18.io.vn +muadaingan.com +muareview.com +muataikhoan.info +muathegame.com +muchomail.com +mucincanon.com +mudahmaxwin.com +mudonmaintenance.com +muehlacker.tk +muell.icu +muell.io +muell.monster +muell.xyz +muellemail.com +muellmail.com +muetop.store +mugadget.com +mui.cc.cd +mui.de5.net +mukn.skin +multicorse.com +mumm.beer +muncloud.com +munik.edu.pl +munoubengoshi.gq +muonwhila.com +muralin-aja.com +muratec.eu.org +muratreis.icu +musiccode.me +musicflow.buzz +musiku.studio +mutant.me +mutudev.com +mvnofijm.asia +mvpmedix.com +mvrht.com +mvrht.net +mwalshabs.dev +mwarner.org +mwlp.skin +mwqj.xyz +mxclip.com +mxfuel.com +mxhquxyi.top +mxmm.hair +mxvia.com +mxwm.hair +my-pomsies.ru +my-teddyy.ru +my10minutemail.com +myairconpro.xyz +myamya.tech +mybitti.de +mycleaninbox.net +mycorneroftheinter.net +mycreativeinbox.com +myde.ml +mydefipet.live +mydemo.equipment +myecho.es +myemailboxy.com +myerly.com +myfixit.xyz +myfxspot.com +mygeoweb.info +mygoo.vip +myhochzeitsfilm.de +myhosrn.servehalflife.com +myindohome.services +myinfoinc.com +myinterserver.ml +mykickassideas.com +myletters.online +mymail-in.net +mymail.infos.st +mymail90.com +mymaildo.kro.kr +mymailoasis.com +mymaily.lol +mymrxuyrd.top +mynes.com +mynetstore.de +mynoop.store +myntora.cfd +myopang.com +mypacks.net +mypartyclip.de +mypdj08.mywire.org +myphantomemail.com +mypk.beer +mysadfjwefwf.us.ci +mysamp.de +myself.fr.nf +myspaceinc.com +myspaceinc.net +myspaceinc.org +myspacepimpedup.com +myspamless.com +mystvpn.com +mysugartime.ru +mytemp.email +mytempemail.com +mytempmail.com +mythmarsh.me +mytrashmail.com +mywarnernet.net +myweblaw.com +mywrld.site +mywrld.top +myxentra.cfd +myzx.com +mzico.com +n1nja.org +n24n8x9.giize.com +n8.gs +na-cat.com +na3qxuk.kozow.com +naacpadvancement.org +naah.ru +naah.store +nabaxox.edu.pl +nabilalo.bond +nabomail.com +nabuma.com +nada.email +nada.ltd +nadalshebaservices.com +nagi.be +nailooong.site +naka.edu.pl +nakedtruth.biz +namdev-mail-01.bond +namdev-mail-01.cyou +namdevmail2.qzz.io +namenan.me +namewok.com +nangspa.vn +naniniva.com +nanonym.ch +nanopools.info +nanoskin.vn +naobk.com +naocan.org +napthex4.com +narrowment.com +narsub.online +narsub.shop +nashapoultryshop.com +naslazhdai.ru +natachai.me +natange.org.uk +nategetvpn.store +nationalgardeningclub.com +natuanal.com +nautonk.com +navalcadets.com +naverapp.com +naverly.com +navermail.kr +navura.in +nawmin.info +naxx.dev +naylonksosmed.com +naymedia.com +nazisat.com +nbasweeps.com +nbmbb.com +nbskyhope.shop +nbspace.us +nbvrluhsh.top +nbzmr.com +nbzy.hair +ncfx.beer +ncien.com +ncleap.com +ndade.eu.cc +ndnphim.io.vn +ndut.pro +neatdaynote.com +neatdrape.cfd +necub.com +negated.com +neghtlefi.com +neighborhoodtide.sbs +neko2.net +nekochan.fr +nekosan.uk +neoamc.xyz +neomailbox.com +neonbuzzline.buzz +neonorbitx.com +neosstudy.work +neotlozhniy-zaim.ru +neowd.com +nepwk.com +neroki.shop +nervmich.net +nervtmich.net +nesopf.com +nespf.com +nespj.com +nespressopixie.com +nestlynotes.com +net1mail.com +netcnet.uk +netcom.ws +netfusionhub.surf +netfxd.com +netgcp.online +nethercottventures.net +netherfieldvillagehall.co.uk +nethubmail.net +netmails.com +netmails.net +netn.top +netoiu.com +netricity.nl +netris.net +netviewer-france.com +networksolutionshk.asia +netzidiot.de +nevanata.com +nevermail.de +neverover.life +new-api.cc.cd +newaddr.com +newairconpro.xyz +newbpotato.tk +newbreedapps.com +newconnect.uk +newcoolfix.xyz +newdelhi.io.vn +newfilm24.ru +newgreenpath.org +newideasfornewpeople.info +newmail.top +newmano.store +newsteadabbeypartnership.org +newyork.io.vn +nexarisystems.online +nexarsh.store +nexarshop.store +nexentia.cfd +nexio.sbs +nexorabio.pro.vn +nexosphere.lifestyle +next.ovh +nextamcrepair.xyz +nextcoolrepair.xyz +nexthandyman.xyz +nextmail.info +nextpomi.dynv6.net +nextstopvalhalla.com +nextsuns.com +nexus-streams.online +nexushost.site +nexverseal.shop +nezdiro.org +nezid.com +nezuka.net +nezumi.be +nezzart.com +nfast.net +nfengwu.bond +nfkah.eu.cc +nfuo.makeup +nghienplus.io.vn +nghienplus.store +nguyendanhkietisocial.com +nguyenlieu24h.com +nguyentinhblog.com +nguyenusedcars.com +nh3.ro +nhienpv1.io.vn +nhmi1.com +nhmvn.com +nhoopmail.store +nhotv.com +nhungdang.xyz +niang-sfx.biz +nianshen09.help +nianshens.help +nice-4u.com +nice.qzz.io +nicebad.com +niceground.shop +nicemail.cc +niceminute.com +nichaoxing.cc +nick-ao.com +nickmxh.com +nicknassar.com +nicusaurelus.online +nigeriansincoventry.org +nightfood.studio +nightorb.com +nik.edu.pl +nikora.fr.nf +nimbacharity.com +nincsmail.com +nincsmail.hu +ninepacman.com +niprack.com +niseko.be +niulaibulai.me +niwave.shop +niwave.top +niwl.net +njwzzvmtin.my +nlpdy8m.ooguy.com +nm123.com +nm7.cc +nmail.cf +nnh.com +nnnetworks.com +nnot.net +nnoway.ru +no-spam.ws +no-trash.ru +no-ux.com +no2bullyingatwork.org.uk +nobleaccare.xyz +noblefacility.xyz +noblepioneer.com +nobugmail.com +nobulk.com +nobuma.com +noc5yva.theworkpc.com +noclickemail.com +nocp.ru +nocp.store +nodejs.uk +nodezine.com +noexpire.top +nogmailspam.info +noicd.com +noinspect.top +noizonicfoundation.com +nokdot.com +nokiamail.com +nolemail.ga +nolettersbox.com +nomail.cf +nomail.ga +nomail.pw +nomail2me.com +nomes.fr.nf +nomomail.com +nomorespamemails.com +nomorix.cfd +nonchalantresmita.biz +nondon.site +nondon.store +nongnue.com +nonspam.eu +nonspammer.de +nonze.ro +noodleparade.lol +nooploop.store +noopmail.com +noproposal.com +noref.in +noreply.fr +nori24.tv +norovpn.site +norseforce.com +northboveymeadow.business +northpinnacle.top +northsixty.com +northwindfinds.shop +norvanta.cfd +norwegischlernen.info +noship.shop +noshiper.pro +nospam.fr.nf +nospam.today +nospam4.us +nospamfor.us +nospamthanks.info +nosubcriber.shop +notboxletters.com +nothingtoseehere.ca +notif.me +notipr.com +notlettersmail.com +notmailinator.com +notrnailinator.com +notsharingmy.info +novacontigencia.xyz +novaemail.com +novahvaccare.xyz +novaprime.vip +novaspherelabs.store +novasub.click +novyrix.cfd +now.im +nowhere.org +nowmymail.com +nowmymail.net +nowrouter.store +nowtopzen.com +nowyoudme1.cc.cd +noyavip.com +noyp.fr.nf +npobox.us +nproxi.com +nqmo.com +nrbs.me +nrehi.com +nriza.com +nrlord.com +ns01.biz +nsvpn.com +nsyncxy.com +nthrl.com +ntlhelp.net +ntto.us +nttoadmin2.us +nu9233b.theworkpc.com +nubescontrol.com +nucleant.org +nuknjkv.ooguy.com +nulla.de5.net +nullbox.asia +nullbox.info +nuoifb.com +nuox.eu.org +nurfuerspam.de +nut.cc +nutpa.net +nuts2trade.com +nv6ei2v.kozow.com +nvhrw.com +nvqt304.xyz +nwfa.hair +nwldx.com +nwrlr.org +nwytg.com +nwytg.net +nxdbxd.top +nxirad.online +ny7.me +ny7u9qr.kozow.com +nyasan.com +nyfhk.com +nygren-realty.com +nygrenrealty.com +nypato.com +nyrmusic.com +nyxmail.pro +nyxpanel.xyz +nyxstores.id +o2stk.org +o2y50o5.loseyourip.com +o326lav.kozow.com +o7i.net +oakon.com +oalsp.com +oasisclimate.xyz +obelion.cfd +obfusko.com +objectmail.com +obobbo.com +oborudovanieizturcii.ru +obxpestcontrol.com +ocbxpz3.camdvr.org +oceva.site +octovie.com +oczt15m.kozow.com +odaymail.com +odeask.com +odem.com +odnorazovoe.ru +oebd.hair +oepia.com +oerpub.org +ofags.com +ofanda.com +officecombine.com +offshore-proxies.net +ofisher.net +ogcover.com +ogoplace.pro +ogprism.me +ogrencikredisi.org +ogzmail.com +ohaaa.de +ohgitu.me +ohi.tw +ohm.edu.pl +oida.icu +oiioii.email +oiioii.vip +oing.cf +okauq.store +okcdeals.com +okclprojects.com +okcx.edu.rs +okcxhssgk.top +okhko.com +okiae.com +okinawa.li +okrent.us +oku.ovh +oky.ovh +okzk.com +oldao.com +oldcrestgroup.net +oldhamgroup.net +oliespace.id +oliespace.site +olimp-case.ru +olipii.com +olisup.cyou +oliviadiffuser.store +oloh.ru +oloh.store +olypmall.ru +olzx.skin +omail.de +omail.pro +omanarts.com +omarnasrrr.com +omfg.run +omgheels.com +omkiujk.ddnsgeek.com +omnievents.org +omnilog.space +omnisent.cfd +omnivex.cfd +omonomon.shop +omtecha.com +onbap.com +one-mail.top +one-ml.com +one-sec-mail.site +one-time.email +one2mail.info +oneaircon.xyz +oneairconrepair.xyz +oneamcservice.xyz +oneclicksprout.click +onecoolrepair.xyz +onekisspresave.com +onelettersmail.com +onemail.host +onemuou.com +oneoffemail.com +oneoffmail.com +onestopacfix.xyz +onestopamcmaintenance.xyz +onestopduct.xyz +onetm-ml.com +onetm.jp +onetopclick.online +oneummahorg.uk +onewaymail.com +onheb.com +onionred.com +oniventa.cfd +onlatedotcom.info +onldm.net +online.ms +onlinecmail.com +onlineidea.info +onlyapp.net +onmailflare.com +onqin.com +ontasa.com +ontyne.biz +onwp6ved.icu +oohioo.com +ooioo.tech +oolus.com +oonies-shoprus.ru +oooooooo.store +oopi.org +oosln.com +oovk.ru +oovk.store +ooxxoo.asia +ooynib.com +ooyv.homes +opayq.com +opelkun.net +opemails.com +openagent.cfd +openavz.com +openclawskill.shop +opendns.ro +openedclaw.top +openmail.pro +openstudy.edu.pl +opentrash.com +openwrt.qzz.io +opihhushdjn.cyou +opmmedia.ga +opog.hair +opog.skin +oposite.org +opp24.com +opportunity-africa.com +optimaweb.me +optivex.cfd +opwebw.com +opxwbt.asia +oqgd.skin +oqmy.hair +oranek.com +oravantis.cfd +oravell.cfd +orbit25k.io.vn +orbitwhisper.buzz +orbitxhive.com +orbixacoa.com +orceqjqw.top +ordinaryamerican.net +ordite.com +oreidresume.com +orgmail.pro +orgmbx.cc +orimassage.com +oroki.de +oronny.com +orsbap.com +ortogenmail.com +orwpaztm.cfd +oryxhvacmaintenance.xyz +oryxmaint.xyz +oryxmaintenance.xyz +osaxadinhos.com.br +oshietechan.link +oshjr-24.xyz +osifixtech.com.mx +oskarstalbergcitygenerator.com +ospirun.com +ostahie.com +ostinmail.com +osxofulk.com +otherinbox.com +otmail.jp +otpku.com +ottsathi.store +ouchcloud.com +ouk.me +oupul8b1k.bond +oupul8b1k.cyou +ourklips.com +ourl.me +ourpreviewdomain.com +outdaremusicdevon.org +outlawspam.com +outlook.edu.pl +outlookapp.tech +outlooks.bond +outmail.win +ovbest.com +ovomail.co +ovpn.to +owdrcro.giize.com +owleyes.ch +owlpic.com +ownsyou.de +owo-mailteam.bond +owo-mailteam.cyou +owovo.site +owube.com +oxbridgeholdings.net +oxfo.edu.pl +oxmail.homes +oxopoha.com +oxvq.hair +oyisam.my +oynsuxe.ooguy.com +oyoa.hair +oyoa.skin +ozatvn.com +ozjp.skin +ozm.fr +ozsaip.com +ozvmail.com +ozyl.de +p-aac.top +p-banlis.ru +p-kk2.icu +p-ttz.top +p-y.cc +p0dl9ik.giize.com +p2bvz.cyou +p33.org +p3t8dyv.mywire.org +p6vvvok.mywire.org +p71ce1m.com +p94y7ff.camdvr.org +pa9e.com +pachilly.com +packiu.com +packwhistle.me +padue.app +pagamenti.tk +paharpurmim.ga +pakadebu.ga +palaze.cc +paldonanamansilolo.online +paliospiti.com +palmjebelaliservices.com +palmjumeirahservices.com +pamaweb.com +pamil.fr.nf +pancakemail.com +pandorasboxproductions.org +panlix.cloud +paperlanternly.cyou +papierkorb.me +paplease.com +para2019.ru +paratrabajar.xyz +paris.edu.pl +parisdaily.fr +parlimentpetitioner.tk +parsitv.com +parthekio.live +parthxxtoasts.site +passeone.com +passeone.xyz +past-line.com +pastcrumbs.me +pastebitch.com +pastipremium.store +pastryofistanbul.com +patientlecadet.online +patity.com +patonce.com +patternplume.cfd +pavilionx2.com +pawobby.cfd +paxeluni.com +paxlys.com +paylaar.com +payperex2.com +payspun.com +pazard.com +pazuric.com +pbhak.dev +pbis.beer +pbrg4fb.ooguy.com +pcaa.lol +pcbb.lol +pcdo.hair +pckage.com +pdf-cutter.com +pdftinker.me +pdmy.skin +pdood.com +pe.hu +peachlumin.beauty +peakac.xyz +peakairconfix.xyz +peakengineeringdubai.xyz +peakinbox.net +peakinstallations24x7.xyz +peaksystemsdubai.xyz +pearlairconrepair.xyz +pearlamcrepair.xyz +pearlrepairs.xyz +pebblepouch.shop +pecinan.com +pecinan.net +pecinan.org +pelviro.sbs +pembrookgroup.net +pemoteme.online +pemoteusonourweb.online +pemoteusonourweb.sbs +pemoteusonourweb.site +pemoteusonourweb.store +penisgoes.in +penoto.tk +pepamail.com +pepbot.com +percyfx.com +pertera.com +peruss.biz.id +pesagilt.top +petalglimmer.beauty +petalhem.cfd +peterdethier.com +peterhe-ai.bond +petloca.com +petrzilka.net +pewpewpewpew.pw +pflege-schoene-haut.de +pfui.ru +pgxh.skin +phamay.com +phanmembanhang24h.com +phctool.com +philipdowney.com +phimib.com +phimteen.net +phmail.site +phmail.us +phone-elkey.ru +photo-impact.eu +photobrex.com +photomark.net +phpto.us +phucmmo.com +phuongnhicare.com +phuotngay.com +phuturemail.com +phyones.com +physcroenmail.com +physicaladithama.io +pi.vu +piaa.me +picdirect.net +pickuplanet.com +picturehostel.com +picturehostel.fr +picturehostel.org +picturehostel.store +pig.pp.ua +pigeonprotocol.com +pii.at +piki.si +pimpedupmyspace.com +pinehill-seattle.org +pingddns.net +pingir.com +pinkgreengenerator.me +pinnaclemeadow.top +pinpool.ai +pipemail.space +pipmmotube.store +pippoc.com +piscesbody.xyz +pisls.com +pitaniezdorovie.ru +pithu.org +pitiful.pp.ua +pivo-bar.ru +pivotylabs.pro +pixdd.com +pixelcroft.org +pixelgagnant.net +pixelrumble.buzz +pixiil.com +pixoledge.net +pizu.ru +pizu.store +pizuhdev.work +pizzajunk.com +pjjkp.com +pkday.eu.cc +pkdigitalmart.site +pkrj.hair +placebomail10.com +plainhomehub.com +plantporch.me +planworker.pro +platinumactech.xyz +platinumchiller.xyz +playasiafootball.xyz +playfine.com +pleasenoham.org +plenoryx.cfd +plexfirm.com +plexflux.app +plexolan.de +plhk.ru +pliz.fr.nf +ploae.com +ploki.fr +ploncy.com +plowcreek.org +plugintonature.org.uk +plw.me +pmail.site +pnaz.skin +pngmender.me +pngrise.com +pntvipveo45k.io.vn +pnvipveo25k.io.vn +pobbofqd.top +poc4756bb.camdvr.org +pochtac.ru +poehali-otdihat.ru +pofmagic.com +pojok.ml +pokemail.net +pokemons1.fr.nf +pokiemobile.com +polaramccare.xyz +polarkingxx.ml +polarmaint.xyz +politikerclub.de +polkaroad.net +polvexar.space +polyfaust.net +polysolextcoin.cloud +pondmosaic.me +pongpong.org +ponp.be +pooae.com +poofy.org +pookmail.com +poolemethodists.org.uk +pooo.ooguy.com +poopiebutt.club +popcornfarm7.com +popcornfly.com +popesodomy.com +popgx.com +poplk.com +popol.fr.nf +porchpetal.homes +porjoton.com +porsh.net +porsilapongo.cl +portaltrendsarena.com +posdz.com +positivevoiceteesvalley.co.uk +posta.store +postacin.com +postbx.ru +postbx.store +postonline.me +poubelle-du.net +poubelle.fr.nf +poutineyourface.com +powerdea.me +powered.name +powerencry.com +powerscrews.com +powlearn.com +pox2.com +pozima.rest +pp-n6.top +pp-tw.cc +pp7rvv.com +pp9vdr0.ddnsfree.com +ppdf.cc +ppedu.pp.ua +ppetw.com +ppoo.ccwu.cc +pptrvv.com +pqoia.com +pratikmail.com +pratikmail.net +pratikmail.org +prazdnik-37.ru +prc.cx +predatorrat.cf +predatorrat.ga +predatorrat.gq +predatorrat.ml +predatorrat.tk +premiapp.com +premieragents.net +premieramcpro.xyz +premierhvacservice.xyz +premierr.site +premigu.co +premirum.shop +premium-mail.fr +premiumapk.store +premiumcrome.site +premiuminternet.site +premiuminternetvpn.xyz +premiumonebd.store +premiumsigma.shop +premsy.net +prestige-leadership.org +prestore.space +pretreer.com +pricegh.com +pricegh.fun +pride-worldwi.de +primabananen.net +primalhigh.click +primeacmaintenance.xyz +primeamcpro.xyz +primebulidv1.uk +primehvacpro.xyz +primejetnet.com +primemaint.xyz +primeorchard.top +primered.shop +primtech.cn +prin.be +printz.site +prisonity.com +privacy-mail.top +privacy.net +privacyshield.cc +privatdemail.net +privmail.edu.pl +privo.edu.pl +privy-mail.com +privy-mail.de +privymail.de +priyo-mail.com +priyo.edu.pl +priyo.ovh +priyo.site +priyoemail.site +priyomail.in +priyomail.net +priyomail.top +priyomail.uk +priyomail.us +priyor.com +priyp.com +prkmail.xyz +pro-tag.org +pro5g.com +procontract365.xyz +procrackers.com +productmm.shop +profast.top +progarhoud.xyz +proguidex.com +prohade.com +prohisi.store +projectcl.com +promailt.com +promptpebble.click +promudon.xyz +promyvia.cfd +proprietativalcea.ro +propscore.com +prorises.com +prosbarsha.xyz +prosdeira.xyz +prosdubaiuae.xyz +prosemaar.xyz +prosmirdif.xyz +prosocial.io.vn +prossportshub.xyz +protectsmail.net +protempmail.com +protonza.com +prout.be +proveity.com +prowashquick.xyz +prowashsameday.xyz +proxy-gateway.net +proxymail.eu +proxyparking.com +prp-ppdt.app +prtnx.com +prtshr.com +prtz.eu +psai.run.place +psh.me +psles.com +psnator.com +psoxs.com +ptct.net +ptncereio.com +ptnstudio.vn +ptsculure.com +puabook.com +puffiqo.store +puglieisi.com +puji.pro +pulse25k.io.vn +pulsix.pw +pumpoly.com +punchbagartgallery.org.uk +punkass.com +punkproof.com +puppetmail.de +purcell.email +pureamcrepair.xyz +pureheart.org.uk +purelogistics.org +purerepairs.xyz +purifyzed.org +purmuttad.com +pursip.com +pushcom.store +pusmail.com +pussport.com +put2.net +puttanamaiala.tk +putthisinyourspamdatabase.com +puxa.top +puzzlebirch.me +puzzledotter.lol +pvnmax.space +pwpwa.com +pwrby.com +pwx129.love +pxlys.com +pyrosenex.cfd +pyskillsgame.com +q06htej.ddnsfree.com +q0y5ffo.kozow.com +q1zx2zj.camdvr.org +q7qipaa.kozow.com +qabq.com +qacmjeq.com +qagk.hair +qaondqs.loseyourip.com +qasti.com +qazaxmj.theworkpc.com +qbfree.us +qc.to +qcai.skin +qcgmtzhzh.top +qd.je +qd28max.eu.cc +qdoit.com +qejjyl.com +qentic.shop +qeurtor.com +qexvhz.com +qfnt.skin +qg9flboa.icu +qhgs.com +qi3hav9.mywire.org +qiang66.ccwu.cc +qibl.at +qiott.com +qipmail.net +qiq.us +qisdo.com +qisoa.com +qiuvision.com +qjwlaaa.giize.com +qkwv.skin +qkxm.skin +qlbz.hair +qlhub.org.uk +qlto.hair +qlvnux.asia +qmrbe.com +qodiq.com +qoika.com +qopow.com +qoq.indevs.in +qpdm.beer +qq.my +qqcomeback.me +qrduwpak.asia +qrmason.me +qrt8e6v.ddnsfree.com +qrxs6eh.giize.com +qrzzq7z.ooguy.com +qsl.ro +qsmail.cc.cd +qsuo.uno +qtum-ico.com +quadrafit.com +quantorynexus.space +quantumeridian.site +quarvex.cfd +queenstonegroup.net +quentavo.cfd +questtechsystems.com +quick-mail.cc +quickaircontech.xyz +quickdrop.buzz +quickemail.info +quickgesture.click +quickinbox.com +quickmail.nl +quicksend.ch +quietdetour.me +quillet.eu +quinz.me +quipas.com +quixentra.cfd +qukv.skin +quml.skin +quorixia.cfd +ququb.com +qvcq.skin +qvmao.com +qvttclass.us +qvwi.skin +qvy.me +qweasd123.cc.cd +qwertyhandsome.net +qwezxc321.cc.cd +qwickmail.com +qydxproapi.store +qytechs.cn +qzueos.com +r2money.io.vn +r4nd0m.de +r8cri1k.theworkpc.com +ra3.us +rabin.ca +rabiot.reisen +rabitex.com +racaho.com +rackabzar.com +racovor.com +radioastronomynet.com +rael.us +raetp9.com +rafiv2ray.xyz +rainbib.co.uk +rainbowly.ml +rajaiblis.com +raketenmann.de +raleigh-construction.com +rallywisp.me +ramcen.com +ramenmail.de +ramin200.site +ramizan.com +rancidhome.net +randol.infos.st +randomail.io +randomail.net +rankme.site +rapidairconservice.xyz +rapidcleangulf.xyz +rapidcoolfix.xyz +rapidcoolmaintenance.xyz +rapidducting.xyz +rapidefr.fr.nf +rapidinstallations365.xyz +rapidrambler.me +rapplo.com +rapt.be +raqid.com +ravavo.bond +ravc.beer +ravensholme.net +raveqxon.blog +raveqxon.store +rawr.foo +rax.la +raxtest.com +rayrayactive.com +razemail.com +razeny.com +razuz.com +rbb.org +rbmz.beer +rbs1.xyz +rc38643.ddnsfree.com +rcasd.com +rccgmanifestinghisglory.co.uk +rcpt.at +rdklcrv.xyz +rdlt0hi.mywire.org +rdsekaunx.top +re-gister.com +reacc.me +reality-concept.club +realize.edu.pl +reallymymail.com +realmail.co +realman.mywire.org +realmka.io +realquickemail.com +realseek.xyz +realtyalerts.ca +reapsa.com +reason.edu.pl +rebates.stream +receiveee.com +recipeforfailure.com +reclameaqui.services +recode.me +reconmail.com +recyclemail.dk +redbiodiesel.com +redfeathercrow.com +redi.fr.nf +rednotecreatoracademy.art +redproxies.com +reelpicnic.me +reestore.site +refblogs.com +refk.site +reftoken.net +regapts.com +regbypass.com +regexquill.me +regspaces.tk +regvippro.site +reimondo.com +rejectmail.com +rejo.technology +rekaer.com +relayne.top +reliable-mail.com +relieve.us.ci +remahankerupuk.com +remai.freeddns.org +remail.cf +remail.ga +remarkable.rocks +remind.edu.pl +remote.li +remoteflyer.co.uk +remraammaintenance.com +rensumo.top +rentaen.com +rentop.asia +renvotra.cfd +renydox.com +reovipvpn.top +repairannual365.xyz +repairgarhoud.xyz +repairsjumeirah.xyz +repairsolutionsae.xyz +repairssportshub.xyz +replyloop.com +reportfresh.com +reptilegenetics.com +resgedvgfed.tk +resmso.com +restorationchurchtv.com +resumeforest.cn +reusable.email +reusecomputers.site +reverendneedham.co.uk +reviewfood.vn +revolvingdoorhoax.org +rewermail.com +rexabot.com +rexmoo.ccwu.cc +rexornge.net +rexornge.site +reymaticx.com +rezalabs.shop +rezato.com +rezeptegesunde.com +rf.gd +rfc822.org +rfods.tech +rfzpnrbpv.top +rgbeastcomputers.site +rgwdomb.theworkpc.com +rhalmshouse.church +rhalmshouse.co.uk +rhyta.com +riazra.bond +ricardo0911.xyz +richfinances.pw +riddermark.de +riffproductions.co.uk +rifkian.ga +rifqysaputra.dev +rikka0612.site +rilzz.store +rimshacooking.site +rinseart.com +riposh.shop +rippb.com +ripplebrief.buzz +risinggirl.co.uk +risingsuntouch.com +riski.cf +risu.be +riwutz-gmail.com +rjzh8vf.giize.com +rklips.com +rkomo.com +rkzpcx.top +rm2rf.com +rma.ec +rmmr.fun +rmqkr.net +rnailinator.com +rniz667.mywire.org +rnmut8pudgj0ikregqx6.dynv6.net +rnvvpn.store +ro.lt +robertspcrepair.com +roborena.com +robot-mail.com +robothandcook.cfd +robustq.com +rodhazlitt.com +roguemaster.dev +roiv.hair +rollindo.agency +ronete.com +ronger.cfd +ronghsng.buzz +ronnierage.net +rootfest.net +roratu.com +roroki.cn +rosebearmylove.ru +rosella.my.id +rosequartzglow.beauty +rotaniliam.com +rotherhamcorp.net +rotomails.co.uk +rotomails.com +rouflav.com +route64.de +routerboardvietnam.com +rover.info +rowdydow.com +rowe-solutions.com +roweryo.com +royal.net +royalairconservice.xyz +royalcoolair.xyz +royaldoodles.org +royalmarket.life +royalpriesthoodagc.org.uk +royalrepairs.xyz +royalthermo.xyz +royandk.com +roybl.com +rppkn.com +rr.nu +rshz.hair +rsvhr.com +rteet.com +rtrobinsbequest.org.uk +rtrtr.com +rtskiya.xyz +rua.pp.ua +rudymail.ml +ruinique.tech +rukiaops.me +rulersonline.com +rulp.skin +rumahweb.site +rumgel.com +runcubesapps.id +runi.ca +runlop6.ooguy.com +runpebble.me +rupayamail.com +ruru.be +rustydoor.com +rustyload.com +ruu.kr +ruutukf.com +rvb.ro +rvhx.hair +rvneous.com +rw1aifc.camdvr.org +rweebz-mail-1.online +rwstatus.com +rwxsxnomo.top +rxinai.com +rxs9.cn +rygel.infos.st +rynetvpn.site +ryteto.me +ryuu.codes +ryuucn.com +ryyr.ru +ryyr.store +rzbal.xyz +s-mail.social +s-mdg.top +s0ny.net +s1q59z82q.top +s33db0x.com +s3cmt5w.kozow.com +s3k.net +s40vwj8.camdvr.org +s4sfoundation.org.uk +s8gz4ay.kozow.com +sabrestlouis.com +sackboii.com +sad23321adja.cn +sada-sd.cc +saddope.lol +sadfg.indevs.in +sadrain.shop +sads-ads-awe.top +saeoil.com +safaat.cf +safeamcpro.xyz +safermail.info +safersignup.de +safetymail.info +safetypost.de +sagametour.com +sageoutfitters.top +saharanightstempe.com +sahildash.dev +sailmail.io +saisonhama.shop +sajutadollars.com +sakoonthroughcancer.com +sakurapink.top +salakoais.shop +saleis.live +salmeow.tk +sam1.eu.org +samaltour.site +samaritanfamilyfoundation.com +samblogs.nett.to +samblogs.zone.id +sampsave.tech +samsclass.info +samsung-gmail.com +sandcars.net +sandduct.xyz +sandelf.de +sandwhichvideo.com +sanfinder.com +sanfnge.run +sanfnges.cc +sanim.net +sanstr.com +saovangtiles.site +sappisi.com +sarawakreport.com +sast.ro +sasukiez.shop +satinfern.beauty +satisfyme.club +satorix.id +satukosong.com +saturrshop.uk +saungadaid.pro +sausen.com +save4now.com +savemydinar.com +savests.com +say0.com +saynotospams.com +sayverfox.com +scamlantern.me +scatmail.com +scatterteam.com +scay.net +scentlilt.me +schachrol.com +schafmail.de +schemastash.me +schmeissweg.tk +schrott-email.de +scook.cfd +scottcoffman.net +scottni.com +scpulse.com +scribito.de +scrsot.com +sd3.in +sdbbs.cc +sdhaiok.eu.cc +sdi5mon.ooguy.com +sdj.fr.nf +sds-awe.top +sdsfre.blog +sdvft.com +sdvgeft.com +sdvrecft.com +seamandstory.cfd +search4gpt.com +seasonofgrace.org +seaworld.asia +sebbcn.net +secmail.pw +secretemail.de +secure-mail.biz +secure-mail.cc +secured-link.net +securehost.com.es +securitybot.online +sedekah-mudah.com +seduck.com +seedancespace.shop +seedcorn.foundation +seedspeed.site +seekapps.com +seekjobs4u.com +sehier.fr +sejaa.lv +sekotong.store +selaciptama.com +seler25k.io.vn +selfdestructingmail.com +selfdestructingmail.org +selftrak.fit +selltub.com +selltub.me +seman.edu.kg +semester.bond +send22u.info +send4.uk +sendapp.uk +sendfree.org +sendgrid.ovh +sendingspecialflyers.com +sendnow.win +sendo.dedyn.io +sendo.giize.com +sendokai.click +sendos.fr.nf +sendos.infos.st +sendspamhere.com +sengkuni.dedyn.io +sengkuni.qzz.io +sengkuni.xx.kg +senseless-entertainment.com +sentra-premium.com +senvas.me +senyan.fun +seosnaps.com +seqerc.com +serbaprem.store +serbaserbisoftware.site +serenamaintenance.com +serenith.cfd +server.ms +servicee.es +servicenadalsheba.xyz +services391.com +servicesalquoz.xyz +servicesdso.xyz +servicesmeydan.xyz +serviceszabeel.xyz +servicetilal.xyz +servicetr.me +sesasdl.top +setxko.com +severnday.us +sevopay.com +sewink.my.id +sex520.eu.org +sexforswingers.com +sexfrancecute.lol +sexfrancecute.tattoo +sexfrancecute.xyz +sexical.com +sexyalwasmi.top +sexymeowers.site +sexymeowers.space +sexymeowers.store +sexymeowers.xyz +sfacg.org +sfolkar.com +sfr09g1.camdvr.org +sgatra.com +sgm.ovh +shaceng.biz.id +shaceng.my.id +shadap.org +shaguaaini.click +shahabnoor.org +shalar.net +shanhaijuli.sbs +sharebot.net +sharedmailbox.org +sharedwillow.sbs +sharkfaces.com +sharklasers.com +sharpairconcare.xyz +sharpaircool.xyz +sharpfreon.xyz +sharpmaint.xyz +shchiba.uk +sheerid.top +sheinup.com +shelfsonnet.me +shengxia.asia +sherazhaider.com +sheryli.com +shhmail.com +shhuut.org +shieldedmail.com +shieldemail.com +shiftmail.com +shiita12.com +shipfromto.com +shiphazmat.org +shipping-regulations.com +shippingterms.org +shiptudo.com +shiro-alice.live +shitaway.tk +shitmail.de +shitmail.me +shitmail.org +shitty.email +shizuku-lulu.love +shkele.cyou +shmavje.mywire.org +shmeriously.com +shopaccmmo.com +shopbantkclone.com +shopcreative.cc +shopempva11.com +shopld.linkpc.net +shopprimeaccounts.com +shopvipduzk666.shop +shopvipduzk6868.shop +shopxda.com +shopy.club +shortmail.net +shortweb.live +shotmail.ru +showslow.de +shrib.com +shuelder.com +shut.name +shut.ws +shxwonew.xyz +si1ver.xyz +siap-sepuh.com +sibafo.asia +siberpay.com +siby9w6.loseyourip.com +sicmg.com +sidelka-mytischi.ru +sidement.com +sidlabs.site +sidneymichaelpoland.travel +sidramaintenance.com +siempre.gratis +sifan077.cc.cd +siftportal.ru +sify.com +sig.de5.net +signalxp.com +signsoflife.org.uk +sihanoma.store +sika3.com +sikux.com +silenceofthespam.com +silentmail.ccwu.cc +siliwangi.ga +silvaron.cfd +silveraircool.xyz +silvercoin.life +silverleafgroup.net +sim-simka.ru +sim-sppg.com +simaenaga.com +simoka.sbs +simplecoolmaintenance.xyz +simpleducting.xyz +simplefreon.xyz +simpleitsecurity.info +simranaitech.space +sin.cl +sinaite.net +sind-hier.com +sind-wir.com +sindhier.com +sindwir.com +sinema.ml +sinfiltro.cl +singapore.edu.pl +singlespride.com +sinnlos-mail.de +sino.tw +sinorto.com +siperer.online +siroja.top +siteinfox.com +sitemaplark.me +siteposter.net +sitwelltownlands.org.uk +six25.biz +sixoplus.com +sizzlemctwizzle.com +sjuaq.com +sjusngde.info +sk-ai.eu.cc +skeefmail.com +skingkong.com +skrak.com +skrhqfnya.top +skrx.tk +sky-inbox.com +sky-ts.de +skyemails.app +skyemails.tech +skyforte25k.io.vn +skygazer42.cn +skygazerhub.com +skyhope666.icu +skyhope666.shop +skyhope666.xyz +skyhopenb.shop +skyhopenb.xyz +skyhopenba.shop +skyhopetw.xyz +skyhopewd.xyz +skyhopewdf.xyz +skynet.infos.st +skyrt.de +skyserver.cyou +skytopway.com +slapsfromlastnight.com +slaskpost.se +slave-auctions.net +sleepyplatypus.lol +slimirin.com +slippery.email +slipry.net +sliverkeigo.fun +slopsbox.com +slotbeer.com +slothmail.net +slowpokerfrance.eu +slowpokerfrance.fr +slowpokerfrance.org +slowpokerfrance.store +slushmail.com +slushpools.cloud +sluteen.com +sly.io +slyouthuk.org +smaau.com +smailpro.com +smailwork.com +smakit.vn +smallker.tk +smapfree24.com +smapfree24.de +smapfree24.eu +smapfree24.info +smapfree24.org +smartaccare.xyz +smartamccare.xyz +smartannualquick.xyz +smartcooltech.xyz +smartemailbox.co +smartfixgulf.xyz +smartnator.com +smartsolutionsfast.xyz +smarttalent.pw +smarttickethub.com +smashmail.de +smell.sbs +smellfear.com +smellrear.com +smellypotato.tk +smeux.com +smevzoli.icu +smkanba.com +smncloud.com +smpcharity.co.uk +smpnegeri4-pwt.my.id +smtp.id.vn +smtp.io.vn +smtp99.com +smwg.info +smykwb.com +snakebutt.com +snakemail.com +snapbx.com +snapcanvas.click +snapmail.cc +snapmail.site +snapmail.xyz +snapwet.com +sneakmail.de +snece.com +sneydgreen-communityhall.co.uk +snpmail.fun +sobhahartlandservices.com +soc123.net +social-mailer.tk +socialfurry.org +socialist.sbs +sociallymediocre.com +socialpulse.casa +socialtrash.online +soco7.com +socoori.com +sofia.re +sofimail.com +sofort-mail.de +sofortmail.de +sofrge.com +softbank.id +softdailyguide.com +softkey-office.ru +softlitceg.com +softpls.asia +sogetthis.com +sohai.ml +sohus.cn +soioa.com +soisz.com +solar-impact.pro +solarnyx.com +solarunited.net +solarunited.org +solenox.cfd +soleoddity.me +solerbe.net +solidairconpro.xyz +solimoddin.online +solkill.store +solquira.cfd +solvemail.info +solventtrap.wiki +somadethcdk.site +somelora.com +somervillepartners.net +somestoneair.shop +somoj.com +son2d.site +songsan.business +songsign.com +soniot.fr +soniot.info +soniot.online +soniot.store +sonjj.edu.pl +sonl192.theworkpc.com +sonny.tk +sonphuongthinh.com +sonrusu.com +sonshi.cf +soodmail.com +soodomail.com +soodonims.com +soombo.com +soon.it +soscandia.org +soson.shop +soul-association.com +soundattic.me +southai.bond +southdubaimaintenance.com +southeastessexanimal.uk +soyboy.observer +sozenit.com +spacebazzar.ru +spacehotline.com +spacework.top +spacexyz.space +spacezin.space +spam-be-gone.com +spam.care +spam.ceo +spam.la +spam.org.es +spam.su +spam4.me +spamail.de +spamarrest.com +spamavert.com +spambob.com +spambob.net +spambob.org +spambog.com +spambog.de +spambog.net +spambog.ru +spambooger.com +spambox.info +spambox.me +spambox.org +spambox.us +spamcero.com +spamcon.org +spamcorptastic.com +spamcowboy.com +spamcowboy.net +spamcowboy.org +spamday.com +spamdecoy.net +spamex.com +spamfellas.com +spamfighter.cf +spamfighter.ga +spamfighter.gq +spamfighter.ml +spamfighter.tk +spamfree.eu +spamfree24.com +spamfree24.de +spamfree24.eu +spamfree24.info +spamfree24.net +spamfree24.org +spamgoes.in +spamherelots.com +spamhereplease.com +spamhole.com +spamify.com +spaminator.de +spamkill.info +spaml.com +spaml.de +spamlot.net +spammer.fail +spammotel.com +spammy.host +spamobox.com +spamoff.de +spamok.com +spamsalad.in +spamsandwich.com +spamslicer.com +spamsphere.com +spamspot.com +spamstack.net +spamthis.co.uk +spamthis.network +spamthisplease.com +spamtrail.com +spamtrap.ro +spamtroll.net +spamwc.cf +spamwc.ga +spamwc.gq +spamwc.ml +sparkletoc.com +sparxautomationhub.store +speak2all.com +speaknow.org.uk +specialneedscircle.co.uk +speedgaus.net +speedlooking.fun +sperma.cf +spicysoda.com +spiedemtion.store +spikio.com +spindl-e.com +spinly.net +splitparents.com +sponserme.store +spoofmail.de +sportcornwall.org +sportrid.com +sportscitymaintenance.com +sportsfunlifestyle.org +spotiy.site +spotlightdiary.com +spr.io +spritzzone.de +sproutassembly.sbs +spruzme.com +spybox.de +spymail.com +spymail.one +square32o.com +squizzy.de +squizzy.net +srame.com +sroff.com +sry.li +srzi.makeup +ss0qw9a.ddnsfree.com +ssanphone.me +ssi-bsn.infos.st +sslglance.me +ssoia.com +sssig.one +sssvcv.uno +stableharvest.bond +stacys.mom +stanfordujjain.com +star-fish.org.uk +starbalance.site +starcheck.in +stardust-2.store +starlight-breaker.net +starlight.store +starmail.net +starnlink.com +starpower.space +startfu.com +startkeys.com +statdvr.com +stathost.net +statiix.com +stayhome.li +stc-88.com +steadyhabithub.com +steam-area.ru +steam-coin.com +steambot.net +steel4work.io.vn +stepsofhope.co.uk +sterlingpointco.com +stexsy.com +stgodanang.com +stinkefinger.net +stomatogomail.ru +stoneground.shop +stonesinwater.com +stop-my-spam.cf +stop-my-spam.com +stop-my-spam.ga +stop-my-spam.ml +stop-my-spam.pp.ua +stop-my-spam.tk +stopspam.app +storebanme.com +storegmail.net +storiesonthestreet.org +storiqax.top +storj99.com +storj99.top +storybuddies.online +stpaulsgrammaralumniusa.org +stravico.cfd +strayhood.org +streamingku.live +streamtv.biz.id +streamwolf.store +streetwisemail.com +stromox.com +strongairconpro.xyz +stronghvactech.xyz +strongmaintenance.xyz +strongthermo.xyz +stuckmail.com +student.nyc.mn +studio.jo3.org +studio.publicvm.com +studyhub.edu.pl +stuffmail.de +stufmail.com +stumpfwerk.com +stylist-volos.ru +su.cloudns.biz +suarj.com +submic.com +submitreports.com +substoretools.com +substoretools.site +substoretools.store +suburbanthug.com +suckmyd.com +sudern.de +sueshaw.com +suexamplesb.com +suft.autos +suftwari.com +sugarloafstudios.net +suhasmedam.com +suioe.com +sumberakun.com +summitamc.xyz +summitcabin.top +summitcare24x7.xyz +summitcare365.xyz +summitcoolcare.xyz +summitcoolservice.xyz +summitfacility.xyz +summitrepairquick.xyz +summitworksgulf.xyz +sunlitcircle.cyou +sunmoonlight.shop +sunnysill.homes +sunstarmoon.shop +suntuy.com +super-auswahl.de +super.lgbt +superblohey.com +superbowlstarttime.org +supergreatmail.com +supergrok.site +supermailer.jp +superplatyna.com +superrito.com +supersave.net +superstachel.de +superti4r.dev +superyp.com +supplementsdiary.com +supplementwiki.org +supportorganization.online +supporttc.com +surbitonnewlifebaptist.com +sureaircon.xyz +surecoolrepair.xyz +suremail.info +suryain.app +sushisalmon.online +sustainablecitymaintenance.com +sute.jp +svetims.com +svgmend.me +svip520.cn +svip888888888.com +svipcun.eu.org +svk.jp +svlg.hair +svvf.hair +svxr.org +swagpapa.com +swap.name.ng +swapagrawal.work.gd +sweetberry.online +sweetpotato.ml +sweetxxx.de +swi4jut.ddnsfree.com +swift-mail.net +swift10minutemail.com +swiftcroft.org +swifthvacmaintenance.xyz +swiftmaintenancegulf.xyz +swiftwashdxb.xyz +swissokalmo.org.uk +swsdz.com +sx227.top +sx235.top +sx697.top +sx856.top +sx872.top +sx882.top +sx992.top +sydney.edu.pl +syecna9.ooguy.com +syinxun.com +sylentha.cfd +sylnetdns.site +sylnetgcp.site +sylnetgcp.top +sylnetx1.top +sylvannet.com +symphonyresume.com +synarca.com +syncax.com +synovaris.cfd +syntheradynamics.site +syosetu.gq +sysout.cloud +sytchampton.directory +sytchamptoncc.co.uk +syujob.accountants +sz345p7.loseyourip.com +szerz.com +szxcfagah.online +t15ippy.giize.com +t1mo.net +t2d9n0j.ooguy.com +t2t.email +t6s7.top +t7sqtao.giize.com +t8xieb2.kozow.com +tabmender.me +tacomail.de +tafmail.com +tafnsxo.ooguy.com +tafoi.gr +tagara.infos.st +taglead.com +tagmymedia.com +tagyourself.com +taikhoankiro.pro +taimb.com +taischaves.com +tako.skin +talemarketing.com +talkinator.com +talkmatrix.study +talkup.sbs +talmetry.com +tamthomca.click +tamttts.com +tandlplith.se +tanlanav.com +tanpony.com +tanukis.org +tanvo.online +taobudao.com +taohucom.store +taojingrun.online +taomail.web.id +tapchicuoihoi.com +taphear.com +tapi.re +tapparade.click +tarasbest.xyz +tartinemoi.com +tarzanmail.cf +taseek.cc.cd +taseek.top +tastmemail.com +tastrg.com +tatadidi.com +tatsu.uk +taugr.com +taukah.com +taxibmt.com +taxibmt.net +taymonera.de +tb-on-line.net +tbgroupconsultants.com +tbr.fr.nf +tbterqwzv.top +tcwlm.com +tcwlx.com +tdtda.com +teambunnyfoundation.org.uk +teamnewmexico.org +teamtitan.co +tech2grow.io.vn +tech69.com +techblast.ch +techcitywalk.xyz +techcyber.shop +techdubaicreek.xyz +techemail.com +techgroup.me +techjaddaf.xyz +techlhj.email +technoproxy.ru +techsdamachills.xyz +techsdifc.xyz +techsdubai.xyz +techsfestivalcity.xyz +techsgarhoud.xyz +techstecom.xyz +techstilal.xyz +techtecom.xyz +techusa.org +teerest.com +teewars.org +tefl.ro +tehillahpraise.uk +teihu.com +telecomix.pl +teleg.eu +telegmail.com +teleworm.com +teleworm.us +teliedge.com +teligmail.site +telimail.online +tellos.xyz +telos.lat +telvetto.com +temailz.com +tembusselalu.biz.id +tembusselalu.my.id +teml.net +temp-email.de5.net +temp-link.net +temp-mail-free.dedyn.io +temp-mail-free.dynv6.net +temp-mail.best +temp-mail.cfd +temp-mail.com +temp-mail.de +temp-mail.edu.rs +temp-mail.freeddns.org +temp-mail.gg +temp-mail.lol +temp-mail.now +temp-mail.org +temp-mail.pp.ua +temp-mail.ru +temp-mailer.dynv6.net +temp-mails.com +temp.skymeshdynamics.com +temp1month.icu +tempail.com +tempalias.com +tempblockchain.com +tempe-mail.com +tempebossok.my.id +tempemail.biz +tempemail.co +tempemail.co.za +tempemail.com +tempemail.de +tempemail.net +tempemail.nyc.mn +tempemailgen.com +tempemaill.com +tempemailo.org +tempestme.com +tempfastmail.com +tempinbox.co.uk +tempinbox.com +tempmail.at +tempmail.au +tempmail.best +tempmail.cc +tempmail.cloud +tempmail.cn +tempmail.co +tempmail.de +tempmail.email +tempmail.eu +tempmail.id.vn +tempmail.ing +tempmail.io.vn +tempmail.it +tempmail.ninja +tempmail.plus +tempmail.pp.ua +tempmail.us +tempmail.vip +tempmail.world +tempmail.ws +tempmail101.com +tempmail2.com +tempmail5.com +tempmaildemo.com +tempmailer.com +tempmailer.de +tempmailer.net +tempmailfree.net +tempmailnow.io +tempmailo.com +tempmailr.com +tempmails.net +tempmailto.com +tempmailyo.org +tempomail.fr +tempomail.org +tempomailo.site +temporalemail.org +temporam.com +temporam.online +temporam.xin +temporam.xyz +temporarily.de +temporarioemail.com.br +temporarly.com +temporary-mail.net +temporaryemail.dpdns.org +temporaryemail.net +temporaryemail.us +temporaryforwarding.com +temporaryinbox.com +temporarymailaddress.com +tempp-mails.com +temppppo.store +tempr.email +tempsky.com +temptami.com +tempthe.net +tempymail.com +tenhub.uk +tenmin.app +tensi.org +tenull.com +ternaklele.ga +terre.infos.st +test-infos.fr.nf +test1byali.cfd +testore.co +testudine.com +tetestebu.online +tevstart.com +texify.online +textpivot.me +tfbnw.asia +tfbnw.id.vn +tfbnw.in +tfbnw.info +tfbnw.io.vn +tfbnw.tech +tfbnw.xyz +tfcn.beer +tffv4a3.kozow.com +tgduck.com +tgmaiss.xyz +tgnm.hair +tgoj.skin +thaihp.net +thaitudang.xyz +thalarex.cfd +thameschamberorchestra.co.uk +thanhnhontienbao.com +thanksnospam.info +thankyou2010.com +thaotri.com +thatim.info +thc.st +thdfyrg.top +the23app.com +theaviors.com +thebearshark.com +thebest73.shop +theboys.cyou +thecarinformation.com +thechildrensfocus.com +thecity.biz +thecloudindex.com +thecwf.co.uk +thediamants.org +thedirhq.info +thedorsetcarershub.org +theducting.xyz +theeyeoftruth.com +thefixit.xyz +thegrampians.net +thehjhvj.ink +thejenkins.net +thejoker5.com +theking.id +thelakesmaintenance.com +thelifecentre.org.uk +thelightningmail.net +thelimescommunitygarden.org +thelimestones.com +themailer.de +thembones.com.au +themccarneyfoundation.co.uk +themegreview.com +themostemail.com +thereddoors.online +theroyalweb.club +thescrappermovie.com +these.cc +theshahnazfoundation.com +thespamfather.com +thespringsmaintenance.com +theteastory.info +thetechnext.net +thevalleymaintenance.com +thevillamaintenance.com +theweifamily.icu +thex.ro +thg.cc.cd +thichanthit.com +thichmmo.com +thiefness.com +thietbivanphong.asia +thirifara.com +thisisnotmyrealemail.com +thismail.net +thispy.top +thisurl.website +thnikka.com +thoas.ru +thodianamdu.com +thoitrangnam2024.shop +thomasblackerby.org.uk +thor.my.id +thraml.com +threads.io.vn +thriftmorrow.me +thrma.com +throam.com +thrott.com +throwam.com +throwaway.dynv6.net +throwaway.io +throwawayemailaddress.com +throwawaymail.com +throwawaymail.pp.ua +throya.com +thrubay.com +thshyo.org +thueotp.net +thulinh.net +thunderbolt.science +thunkinator.org +thuongxg.com +thurleighchurchestate.church +thxmate.com +tianblog.top +tianmi.me +tianstudy.space +tiapz.com +tic.ec +tidaksuka.cfd +tidewick.org +tidissajiiu.com +tidylifehub.com +tiendadezapasok.com +tiffincrane.com +tigrisstem.org +tijdelijke.email +tikanony.com +tikmail.org +tiksofi.uk +tiktakgrab.com +tiktakgrab.shop +tiktakgrabber.com +tiktokngon.com +tiktokus.us +tilalalghafmaintenance.com +tilien.com +tilumo.cfd +tilvex.click +timbourkescholarshipfund.org +timgiarevn.com +timkassouf.com +tinhoconline.com +tinoza.org +tinpho.com +tinyroomlife.me +tinyshortcuts.click +tinytimer.org +tinyurl24.com +tipsb.com +tirasya.pro +titangamezz.com +titenpa.com +tittbit.in +tiv.cc +tivendra.cfd +tivertonhospitalleagueoffriends.co.uk +tivo.camdvr.org +tizi.com +tjhn.beer +tk4em7sk.icu +tkfb24h.com +tkitc.de +tlktok.us +tlpn.org +tmail.com +tmail.edu.rs +tmail.gg +tmail.io +tmail.link +tmail.lt +tmail.mx +tmail.ws +tmail1.org +tmail2.org +tmail3.com +tmail3.org +tmail4.org +tmail5.org +tmail6.com +tmail9.com +tmaile.net +tmailinator.com +tmailor.com +tmailor.net +tmails.net +tmmbt.net +tmpbox.net +tmpemails.com +tmpeml.com +tmpeml.info +tmpjr.me +tmpkit.com +tmpmail.net +tmpmail.org +tmpmailtor.com +tmpnator.live +tmpx.sa.com +tmxttvmail.com +tnbeta.com +toaik.com +toastunicorn.lol +tocuda.cloud +toddsbighug.com +tofeat.com +togetherbrook.sbs +tohru.org +toiea.com +tokem.co +token.ro +token0v0.com +tokenmail.de +tokfly.org +tokmail.fun +tokmail.net +tokobibit.co +tokyo.edu.pl +tokyo112.top +tokyoflarex.tokyo +tomhouse.shop +tommyfommy.site +tomvnet.uk +tonaeto.com +tongle.ccwu.cc +toni.io.vn +tonne.to +tonyfarm.indevs.in +tonymanso.com +too.li +toolbox.ovh +toolnator.plus +toolourles.tech +tools-capcut.com +toolsequipment.cyou +toomail.biz +toon.ml +top-shop-tovar.ru +top101.de +top1mail.ru +top1post.ru +topacservice.xyz +topclassacservice.xyz +topclassduct.xyz +topcleangulf.xyz +topcoolmaintenance.xyz +topdatamaster.com +topinrock.cf +topmail2.com +topmail2.net +topofertasdehoy.com +topranklist.de +topren.cyou +topren.top +toprumours.com +toptechdubai.xyz +topupgg.app +topvu.net +torkakak.site +tormail.org +torrent411.fr.nf +torvila.sbs +tospage.com +toss.pw +tosunkaya.com +totallynotfake.net +totalvista.com +totesmail.com +totoan.info +totococo.fr.nf +toupiao7003.top +tourcc.com +towerac.xyz +towerfacility.xyz +towerhubdubai.xyz +townsquaremaintenance.com +toyafterglow.me +tozya.com +tp-qa-mail.com +tppp.one +tppp.online +tpwlb.com +tqoai.com +tqosi.com +trackden.com +tradermail.info +tradingview.my.id +tradr.space +trainthem2fish.co.uk +tramynguyen.net +tranceversal.com +trandigabapoe.shop +trangiabao.click +trangzim.uk +tranhtai.com +transaksikita.tech +transferpulsa.net +translateid.com +traodoinick.com +traogiai.com +trap-mail.de +trash-amil.com +trash-mail.at +trash-mail.cf +trash-mail.com +trash-mail.de +trash-mail.ga +trash-mail.gq +trash-mail.ml +trash-mail.tk +trash-mail.webredirect.org +trash-me.com +trash2009.com +trash2010.com +trash2011.com +trashcanmail.com +trashdevil.com +trashdevil.de +trashemail.de +trashemails.de +trashinbox.com +trashmail.at +trashmail.com +trashmail.de +trashmail.fr +trashmail.gq +trashmail.hu +trashmail.io +trashmail.me +trashmail.net +trashmail.org +trashmail.se +trashmail.ws +trashmailer.com +trashmailgenerator.de +trashmails.com +trashymail.com +trashymail.net +trasz.com +travelfriend.online +travelistaworld.com +travelovelinka.club +travionex.cfd +trayna.com +trbvm.com +trbvn.com +trbvo.com +treesforderby.org +trend-maker.ru +trendcricket.buzz +treso.me +treterter.shop +trevourus.com +trfu.to +trgfu.com +trgovinanaveliko.info +trialmail.de +trickmail.net +trieuhao.site +trillianpro.com +trinovia.cfd +triots.com +trixtrux1.ru +trojanvmesswrt.dpdns.org +trolebrotmail.com +trollproject.com +tropicalbass.info +tropovenamail.com +trovantis.cfd +troveniq.cfd +truecoolcare.xyz +trumingovn.online +trunghocphothong.io.vn +trungmetax.com +trungtamtoeic.com +trustcheck.cc +trustdomainvn.us +trustedadmin2.shop +trustedadmindns.site +trusteddns.online +trustguru.vip +trusticloud.us +trustmailold.us +truthfinderlogin.com +tryalert.com +tryninja.io +trythe.net +tryzoe.com +tscasalnt.top +tsderp.com +tsdpt.co.uk +tshdn.cfd +tshirtsavvy.com +tsmtp.org +tstrust.org.uk +ttirv.org +ttpo89japan.com +ttszuo.xyz +tualias.com +tuamaeaquelaursa.com +tubebox.us +tubeemail.com +tuethong.shop +tuku26012023.xyz +tulw6ae.ooguy.com +tumroc.net +tunthuta.com +tuofs.com +tupmail.com +turkeyth.com +turnimon.com +turoid.com +turual.com +turuma.com +tutuapp.bid +tuyenchau.click +tuyenchau.online +tuyenchau.site +tuyenhuy.click +tuyenhuy.online +tuyenhuy.site +tvchd.com +tverya.com +twck.hair +tweet.fr.nf +twinmail.de +twitch.work +twitchythoughtcreations.in +twitter.io.vn +twkly.ml +twocowmail.net +twoweirdtricks.com +twskyhope.top +twskyhope.xyz +twskyhopenb.shop +twzhhq.online +tx1ggv4.theworkpc.com +txcct.com +txen.de +txqx.skin +txtadvertise.com +tybz.hair +tyhe.ro +tyldd.com +tympe.net +tyoless.org.uk +tzrj.pro +u2v7nnn.mywire.org +u6a9a5wy.icu +uacro.com +uaecleanexpress.xyz +uaerepairquick.xyz +uaeserviceae.xyz +uber-mail.com +uberip.com +ubinert.com +ubismail.net +ubm.md +ucche.us +ucupdong.ml +uddinfoundation.org +udingclin.com +uemail99.com +ufacturing.com +ufokeuabmail.com +ug.wtf +uggsrock.com +uguuchantele.com +uhe2.com +uhhu.ru +uiemail.com +uiu.us +ujijima1129.gq +uk.to +ukev.org +uki.io.vn +ukm.ovh +ukshop538yt.uk +ukwv.skin +ulitmtehub.store +ulm-dsl.de +ulteriq.cfd +ultra.fyi +ultrada.ru +ultrafive.online +ultralabs24.store +ultralux.io.vn +ultrasix.online +ultraunitquick.xyz +ultravex.cfd +ultraz1.io.vn +ultrmigos.online +uma3.be +umail.net +umil.net +umiudi.cn +ummsuqeimmaintenance.com +umombiss.tk +undeadbank.com +undercliffholdings.net +underseagolf.com +undo.it +unfairship.com +unicodeworld.com +unids.com +unimain.tech +unimark.org +uniromax.com +unit7lahaina.com +unitedcharitiesosm.org.uk +universall.me +unlikeyth.com +unmail.ru +unratito.com +uofzcpg9ftykob.asia +uooos.com +uorak.com +upc.infos.st +upliftnow.com +uplipht.com +uploadnolimit.com +upozowac.info +upphim.net +upsnab.net +uqfb.hair +uqqlrdi.top +urbancoolpro.xyz +urbanmaintenance.xyz +urbanvalore.info +urfunktion.se +urgentmail.ovh +urhen.com +uroid.com +urvs.skin +urzy.skin +us-x.top +us.af +us.to +usa.cc +usa.edu.pl +usaishop.shop +usako.net +usbc.be +usdtbeta.com +used-product.fr +usedus.me +usefulbriefing.com +uselesswebsites.net +ushijima1129.cf +ushijima1129.ga +ushijima1129.gq +ushijima1129.ml +ushijima1129.tk +usm.ovh +usmail.one +uspsp.top +usrl71x.camdvr.org +ustorp.com +usus.accesscam.org +usus.camdvr.org +usus.casacam.net +usus.ddnsfree.com +ususus.dynv6.net +utiket.us +utkarsh.tech +utmastream.com +uu.gl +uu2.ovh +uue.edu.pl +uuf.me +uuii.in +uvaul.us.ci +uvicone.in +uwork4.us +uyhip.com +uyqs.skin +uz8.net +v-mail.xyz +v1jhjrc.giize.com +v2v.click +v2v.email +v2v.world +v6omlz6.giize.com +va7tkaqk55.icu +vaasfc4.tk +vaati.org +vae.indevs.in +vafyxh.com +valanides.com +valemail.net +valhalladev.com +valueacrepair.xyz +valueairconrepair.xyz +valueamcdubai.xyz +valuehandyman.xyz +valuehvac.xyz +valueineveryone.co.uk +valuerepairs.xyz +vankin.de +vasteron.com +vatos.gg +vaupk.org +vbgvd.com +vbv.cards +vcois.com +vctel.com +vda.ro +vddaz.com +vdig.com +vdzc.skin +veanlo.com +veb37.com +vectorbrasil.app +velatrix.cfd +veletis.bond +velloxist.site +velmoor.org +velocitronix.online +velonarix.com +veltexline.com +velvetpetalia.beauty +velvetstitchery.cfd +vemomail.win +venariq.cfd +venompen.com +ventrovia.cfd +veo.kr +veo325k.io.vn +veo325kcredit.io.vn +veo33.io.vn +veo3ultra.sbs +veomatrix25k.io.vn +veoverse25k.io.vn +ver0.cf +ver0.ga +ver0.gq +ver0.ml +ver0.tk +vercelli.cf +vercelli.ga +vercelli.gq +vercelli.ml +vercelspace.shop +verdejo.com +verel.online +verifycenter.net +verityemail.site +vermutlich.net +vernonbourne.uk +veronicamira.info +vertexinbox.com +vertexium.net +veruvercomail.com +verybigdick.cyou +veryday.ch +veryday.eu +veryday.info +veryrealemail.com +ves.ink +vesa.pw +vesdev01.shop +vetra.cyou +vevs.de +vexalor.cfd +vexaluno.xyz +vexi.my +vextora.click +vfdhks.eu.cc +vfre4w3.dynv6.net +vfwladiesauxin.org +vgfautd.mywire.org +vggh.beer +vgyi.hair +vi1ilpa.mywire.org +via.tokyo.jp +viavuive.net +vibertees.com +vibzi.net +vickaentb.tk +victime.ninja +victoriaalison.com +victoriantwins.com +victoryheightsmaintenance.com +vidchart.com +videoigdownload.com +videotoptop.com +viditag.com +vidwobox.com +vidxlr.me +viemarter.online +viettravel.io.vn +vietxf.com +viewbuster.ru +viewcastmedia.com +viewcastmedia.net +viewcastmedia.org +viewmuse.com +vigilantkeep.net +vigoneo.com +vikingsonly.com +villaamcdubai.xyz +villaamcrepair.xyz +villaclimate.xyz +villanovaservices.com +villasdesk.xyz +villaspro.xyz +villaxoa.site +vinaemail.com +vinakoop.com +vinakop.com +vinatissue.org +vinernet.com +vinhdo.shop +vintomaper.com +viole.cfd +violet0923.online +vipepe.com +vipmail.name +vipmail.pw +vipmba.cc +vips.pics +vipxm.net +viralplays.com +virelio.cfd +virgilian.com +virginsrus.xyz +virtual-hipster.com +virtualemail.info +virtualminerals.com +visal007.tk +visal168.cf +visal168.ga +visal168.gq +visal168.ml +visal168.tk +visignal.com +visualdep.run.place +visualnest.work +visuals.linkpc.net +vitahicks.com +vitaspherelife.com +vitrineproducoes.com +viv2.com +vividtipzone.com +vixces.cyou +vixletdev.com +vixtricks.com +vjbl.skin +vjoid.ru +vjoid.store +vjuum.com +vkbb.ru +vkbb.store +vkbt.ru +vkbt.store +vkcbt.ru +vkcbt.store +vkcode.ru +vkfu.ru +vkfu.store +vkjashdf.eu.cc +vkpr.store +vkr1.com +vkrr.ru +vkrr.store +vladhub.buzz +vlemi.com +vlrregulatory.com +vmailing.info +vmani.com +vmbx.skin +vmm.indevs.in +vmpanda.com +vn-one.com +vncctv.org +vnedu.me +vnfjsh.eu.cc +vnqi.skin +vntechhub.online +vnvmail.com +vnxdxpf.loseyourip.com +vobau.net +voerpemww.click +voicesforchangeinc.org +voidbay.com +voidmail.one +voidpop.win +volaj.com +volku.org +voltaer.com +voltr.click +voltravia.cfd +vomoto.com +vorga.org +vortalis.cfd +voryxen.com +vothanhtuan.shop +votiputox.org +voxelcore.com +voxinh.net +vpbz.skin +vpii.beer +vpkv.skin +vpn.st +vpn64.de +vpnseat.com +vps30.com +vps79.com +vps911.net +vqdz.hair +vqdz.skin +vradportal.com +vremonte24-store.ru +vrjxk.com +vrmtr.com +vsdsd23gsdf.shop +vsimcard.com +vsmailpro.com +vssms.com +vtmpj.com +vtmpj.net +vtxmail.us +vuatrochoi.nl +vubby.com +vuiy.pw +vuket.org +vulca.sbs +vulcanpioneerjers.org +vupn.me +vusra.com +vutrugay.org +vuv.indevs.in +vvatxiy.com +vwagamlk.top +vwhins.com +vxsolar.com +vystella.cfd +vztc.com +w-asertun.ru +w154ed2.giize.com +w3internet.co.uk +wacold.com +waguriagent.codes +waisfoundation.com +waitbeqa.com +waivey.com +wakingupesther.com +walala.org +walkmail.net +walkmail.ru +wallm.com +wanai.biz.id +wanaofamouscar.com +wandouyu.run +wanko.be +wansnode-dice.site +wanting2work.org.uk +wanva.shop +wargravepreschool.uk +warlus.asso.st +warmwindow.homes +waroengku.cc +waroengmail.com +waroengpremium.com +warrity25k.io.vn +warsanmaintenance.com +warunkto.com +watch-harry-potter.com +watchever.biz +watchfull.net +watchironman3onlinefreefullmovie.com +waterisgone.com +waterpalace.pro +watersoftenersystemcost.com +watrf.com +watsawang.com +wattcottage.me +waventra.cfd +waw.indevs.in +wazabi.club +wbdev.tech +wbml.net +wbslxy.cc.cd +wdhu.skin +wdrd.beer +wearkeymail.site +wearvault.biz.id +weatherbx.xyz +weaxymt.loseyourip.com +web-contact.info +web-ideal.fr +web-inc.net +web-library.net +web-mail.pp.ua +web2mailco.com +webcamness.com +webcenterfairbanks.dedyn.io +webclub.infos.st +webcontact-france.eu +webemail.me +webhook.site +webinarmoa.com +webm4il.info +webmail24.top +webmailus.com +webofip.com +webscash.com +webstore.fr.nf +webtrip.ch +webui.cc.cd +webuser.in +wecanmakehit.win +wecp.ru +wecp.store +wee.my +weekendwok.me +weekfly.com +weekzs.icu +weeline.fun +wef.gr +weg-werf-email.de +wegoo.dpdns.org +wegwerf-email-addressen.de +wegwerf-email-adressen.de +wegwerf-email.at +wegwerf-email.de +wegwerf-email.net +wegwerf-emails.de +wegwerfadresse.de +wegwerfemail.com +wegwerfemail.de +wegwerfemail.info +wegwerfemail.net +wegwerfemail.org +wegwerfemailadresse.com +wegwerfmail.de +wegwerfmail.info +wegwerfmail.net +wegwerfmail.org +wegwerpmailadres.nl +wegwrfmail.de +wegwrfmail.net +wegwrfmail.org +weirdlytemp.sbs +weiruipingji.com +weizixu.com +wejedvv.giize.com +wekawa.com +welikecookies.com +wellsfargocomcardholders.com +wemel.top +wenkuu.com +wentcity.com +wenyuanshe.com +wep.email +were-w.top +wetrainbayarea.com +wetrainbayarea.org +weyword.cfd +wfgdfhj.tk +wfpe.autos +wg0.com +wh4f.org +whaaaaaaaaaat.com +whatagarbage.com +whatemi.de +whatever.za.net +whatiaas.com +whatifanalytics.com +whatpaas.com +whatsaas.com +whf222.top +whiffles.org +whirlygirlink.org +whispermail.org +whiteaircond.xyz +whiteairconfix.xyz +whiteamcservice.xyz +whitechiller.xyz +whitehousecalculator.com +whitehvacrepair.xyz +whitemistral.pro +whob31o.camdvr.org +whoopza.org +whoopza.store +whopy.com +whyspam.me +wibblesmith.com +wicfolhumanservices.org +wickmail.net +widaryanto.info +widget.gg +wiemei.com +wierie.tk +wifimaple.com +wifioak.com +wikfee.com +wikidocuslava.ru +wildan.tech +wildlinenlab.cfd +wilemail.com +willhackforfood.biz +willselfdestruct.com +wimsg.com +windsurfcom.shop +winemaven.info +wingsai.online +winocs.com +wins.com.br +wintersgf.store +wintersmail.site +wir-sind.com +wireconnected.com +wishy.fr +wivstore.com +wjah.hair +wjah.skin +wlist.ro +wlsom.com +wmail.cf +wmail.club +wmct.info +wmksuhd.cn +wnbaldwy.com +wohbc.co.uk +wokcy.com +wolfmail.ml +wolfsmail.tk +wollan.info +womp-wo.mp +woofgl.email +woofidog.fr.nf +woopros.com +workhorsefilms.com +workingtall.com +worldcoins.top +worldcricket.org.uk +worldlylife.store +worldspace.link +woshiemoman.cloud-ip.cc +wovoemj1119.icu +wpdork.com +wpg.im +wpnf.skin +wralawfirm.com +wrgee.com +writeme.us +wronghead.com +wrqj.top +wrxx.beer +ws.gy +wshu.net +wsvpsft.xyz +wsxnxce.online +wsym.de +wsypc.com +wtjinkintrust.co.uk +wtsl.hair +wudet.men +wudiai.shop +wuespdj.xyz +wupics.com +wusongdahu.cc.cd +wuuvo.com +wuzak.com +wuzup.net +wuzupmail.net +wvdg.skin +wvyt851.ddnsfree.com +wwc8.com +wwdskboiv.top +wwefd.top +wwej.cc.cd +wwjmp.com +wwtykkm.bond +wwvec.uno +wwvk.ru +wwvk.store +wwwnew.eu +wxcv.fr.nf +wxf07.shop +wxhp.hair +wxnw.net +wxxu.hair +wyoxafp.com +wywnxa.com +wzjpj.com +wzjyyds.com +wzofit.com +x-clone.asia +x-lab.net +x0bdu6n.mywire.org +x0q.net +x1ix.com +x24.com +x80.dpdns.org +x80la.shop +x8nxh3g.theworkpc.com +x9ad1.my +xagloo.co +xagloo.com +xandoria.cfd +xapimail.top +xazymarcie.space +xbaby69.top +xbrok.com +xcf.pet +xclone.asia +xcode.ro +xcodes.net +xcompress.com +xcoxc.com +xcp3iiv.ooguy.com +xcpy.com +xcsllajs.eu.cc +xcucngon.site +xcvuaylik.top +xcvv.xyz +xczv.hair +xdfrms.fun +xdnss.cc +xdpxdp.online +xehop.org +xelio.sbs +xelu.space +xemaps.com +xemne.com +xen-bypass.com +xenloria.cfd +xeno.gay +xenta.cfd +xents.com +xeovo.ru +xepa.ru +xeramail.com +xfavaj.com +xfft.beer +xgcpking.space +xgmail.bond +xgng.skin +xhke.hair +xhke.skin +xhotmail.cyou +xi2.cc +xiajspof.eu.cc +xiangshan.eu.cc +xiaoche.ggff.net +xiaoguaishou.icu +xiaohuangyu.ccwu.cc +xiaokong.site +xiaoting.cc +xib.icu +xidealx.com +xiiqtg.com +xiiqtg.vip +xikemail.com +ximenor.site +xingmeisofa.com +xirentha.cfd +xitler.top +xiwinnie.icu +xjau.homes +xjm.homes +xjoi.com +xkgm.hair +xktu.hair +xkx.me +xkxkud.com +xl.cx +xlcsh.icu +xmailer.be +xmailtm.com +xmaily.com +xmisom.help +xmlab.icu +xmyvgkvw.top +xn--5nx.cc +xn--9kq967o.com +xn--ai-ry2ck37oorv.com +xn--d-bga.net +xn--di5au2k.shop +xn--ihq4pool8g32cwxiiqcovaa9159jhvah03g.top +xn--jxsa73o.eu.org +xn--o38h.abrdns.com +xn--rhqv96g.tv +xn--yaho-sqa.com +xn-xp8h.bond +xo00wda.loseyourip.com +xojxe.com +xolic.me +xopmail.fun +xost.us +xoxo3.website +xoxox.cc +xperiae5.com +xpremium.pro +xpromail.xyz +xqmm.hair +xqqgegsd.eu.cc +xrap.de +xshop.bond +xsioap.eu.cc +xsnipersquad.com +xsnipersquad.site +xsnipersquad.space +xstyled.net +xswl.xyz +xt81.help +xtzg.beer +xunika.uk +xvx.us +xww.ro +xxhamsterxx.ga +xxi2.com +xxl.st +xxlocanto.us +xxmailedu.dpdns.org +xxolocanto.us +xxqx3802.com +xxvd.net +xxvk.ru +xxvk.store +xxxhi.cc +xxymail.me +xy9ce.tk +xylanta.cfd +xylar.ru +xylar.store +xyxy.app +xyzfree.net +xzcoot.com +xzsok.com +y0fwzc2.mywire.org +y0p8gli.loseyourip.com +y1dk5vk.giize.com +y4plv.cyou +y6jxjln.kozow.com +yabai-oppai.tk +yabes.ovh +yahmail.top +yahooproduct.net +yahoox.cyou +yaloo.fr.nf +yamail.win +yanet.me +yangzazhong.top +yangzhai.xyz +yangzhong-sfd.cc +yanhd-jkd.top +yannmail.win +yanxuan.eu.cc +yapped.net +yaqp.com +yarnpedia.ga +yasuo.sbs +yb9ye8c.kozow.com +ybidbccmv.top +yc08.cn +ycare.de +ycglobalmovement.com +ycn.ro +ydhfks.shop +ydns.eu +ydscontingencia.com +ye.vc +yearlyamctower.xyz +yecp.ru +yecp.store +yedi.org +yeezus.ru +yellofdf2.click +yenphandinhe.com +yep.it +yermail.net +yeummo.io.vn +yfhsdb.eu.cc +yfnc.skin +ygbelira.me +ygebjd8-ktyd.top +ygpa.autos +yhg.biz +yieldwillow.bond +yihacihuy.top +yilue.eu.org +ying-ge.com +yingzi321.shop +yiuogmq.loseyourip.com +yjlwcbrf.top +yl66.cfd +ymonthl.com +ynagjie-66.cc +ynmrealty.com +ynnord.top +yodwg.sbs +yodx.ro +yogamaven.com +yoggm.com +yogirt.com +yogo.beer +yomail.edu.pl +yomail.info +yomand.store +yondrix.cfd +yongdan-hstn.best +yoo.ro +yopm.zone.id +yopmail.com +yopmail.fr +yopmail.gq +yopmail.kro.kr +yopmail.loseyourip.com +yopmail.net +yopmail.ooguy.com +yopmail.pp.ua +yopmail.theworkpc.com +yopmail.webredirect.org +yoptruc.fr.nf +yordanmail.cf +yorushika.one +yotmail.fr.nf +you-spam.com +yougotgoated.com +youmail.ga +youmailr.com +youneedmore.info +youpymail.com +your5.ru +your5.store +yourdomain.com +youremail.cf +yourewronghereswhy.com +yourlms.biz +yours.tools +yourspamgoesto.space +yourtube.ml +yourwiseguide.com +youtube-com-watch-jtpdc8khnpi.accesscam.org +youtube-com-watch-jtpdc8khnpi.bond +youtube-com-watch-jtpdc8khnpi.cyou +youtube-com-watch-jtpdc8khnpi.dedyn.io +youtube-com-watch-jtpdc8khnpi.freeddns.org +youtube-com-watch-jtpdc8khnpi.gleeze.com +youtube-com-watch-jtpdc8khnpi.loseyourip.com +youtube-com-watch-jtpdc8khnpi.mywire.org +youtube-com-watch-jtpdc8khnpi.ooguy.com +youtube-com-watch-jtpdc8khnpi.theworkpc.com +youtube-com-watch-jtpdc8khnpi.webredirect.org +youxiang.dev +ypyb.hair +yralexchimera.fun +yroid.com +yrppwsekv.top +ysfuddr.top +ysgdjd.fun +yshdnhh.click +ysngdtw55n.top +yspend.com +ysuhd.art +yszmy.cn +ytkj.us.ci +ytnhy.com +ytoof.app +ytpayy.com +yugasandrika.com +yui.it +yujiehanjiao.cc +yuki.ren +yummymeow.eu +yummymeow.fr +yummymeow.org +yummymeow.store +yun.pics +yunxiangpnv.lol +yuoia.com +yurevia.cfd +yurovovault.shop +yuurok.com +ywiueryweqrwerqsdf.us.ci +ywzmb.top +yxdad.ru +yxdad.store +yxkm.skin +yxx1.ccwu.cc +yxxala.ccwu.cc +yxxawa.ccwu.cc +yxxawa.top +yxzx.net +yydsplus.top +yykzv53.theworkpc.com +yyolf.net +yyqzc8v.giize.com +yzcalo.com +yzm.de +z-o-e-v-a.ru +z0d.eu +z1p.biz +z86.ru +z8ebbq2.camdvr.org +zai.asia +zain.com.co +zain.site +zainmax.net +zaktouni.fr +zalesie.net.pl +zantrax.com +zapmail.one +zarabotokdoma11.ru +zarkbin.store +zasod.com +zauxpbp.cn +zaym-zaym.ru +zcdpbx.top +zcjzy.cc.cd +zcovz.ru +zcovz.store +zcrcd.com +zdenka.net +zdge.hair +ze.tc +zebins.com +zebins.eu +zefvo.com +zehnminuten.de +zehnminutenmail.de +zeldaa.ccwu.cc +zellatrix.cfd +zellio.yachts +zemzar.net +zenbada.com +zenbyul.com +zenithac.xyz +zenithaccare.xyz +zenithaircool.xyz +zenrepair365.xyz +zensurpirat.de +zenthara.cfd +zenthira.cfd +zenthranet.com +zenworksfast.xyz +zephyracpro.xyz +zephyrairconpro.xyz +zephyramcpro.xyz +zephyrhvac.xyz +zephyros.cfd +zepp.dk +zeppost.com +zeroai.sbs +zeronerbacomail.com +zeropolly.com +zetmail.com +zevionyx.com +zexic.cyou +zfymail.com +zgg0.help +zhaji.eu.org +zhanhuokma2.wang +zhaoqian.ninja +zhaoyuanedu.cn +zhcne.com +zhengwz.dpdns.org +zhewei88.com +zhizhiwei.fun +zhjjq.tech +zhorachu.com +zhousj.eu.org +ziell.my.id +zigzagpulse.buzz +zik.dj +zikzak.site +zimf.hair +zipcad.com +zipcatfish.com +ziping.me +zipmail.one +zipo1.gq +zippymail.info +zipsendtest.com +zira.my +ziragold.com +zivox.sbs +ziyoupi.asia +zizo7.com +zkfdwz.shop +zkfr.hair +zlqkuzx.ddnsfree.com +zlzu.skin +zmail.cam +zmnai.top +zmypxprb.sbs +znext.bond +zoaxe.com +zoemail.com +zoemail.net +zoemail.org +zoetropes.org +zohobillings.com +zolamin.com +zolmiu.cfd +zombie-hive.com +zomg.info +zoomintens.com +zorg.fr.nf +zouz.fr.nf +zovion.com +zozozo123.com +zpva4pd.mywire.org +zqjq.hair +zqwn.skin +zrpu.hair +zrufe.com +zsero.com +zsmj.cc.cd +zsts.top +zudpck.com +zuldev.live +zumnime.me +zumpul.com +zutomayo.best +zv68.com +zvvzuv.com +zw5pkjm.camdvr.org +zx81.ovh +zxb8bds.loseyourip.com +zxcv.com +zxcvbn123.cc.cd +zxcvbnm.com +zxhyzlwcp.top +zxqzin.cn +zxrey.club +zymuying.com +zyns.com +zypherin.cfd +zyranova.cfd +zyvenix.cfd +zzaidah.cloud +zzeu.us +zzi.us +zzrgg.com +zzz.com +zzzzzzzzzzzzzz-1090.dynv6.net +zzzzzzzzzzzzzz-2092.dynv6.net +zzzzzzzzzzzzzz-277.dynv6.net +zzzzzzzzzzzzzz-3294.dynv6.net +zzzzzzzzzzzzzz-3330.dynv6.net +zzzzzzzzzzzzzz-3535.dynv6.net +zzzzzzzzzzzzzz-3928.dynv6.net +zzzzzzzzzzzzzz-3940.dynv6.net +zzzzzzzzzzzzzz-4283.dynv6.net +zzzzzzzzzzzzzz-4904.dynv6.net +zzzzzzzzzzzzzz-5055.dynv6.net +zzzzzzzzzzzzzz-5246.dynv6.net +zzzzzzzzzzzzzz-546.dynv6.net +zzzzzzzzzzzzzz-739.dynv6.net +zzzzzzzzzzzzzz-7619.dynv6.net +zzzzzzzzzzzzzz-7911.dynv6.net +zzzzzzzzzzzzzz-8050.dynv6.net +zzzzzzzzzzzzzz-8079.dynv6.net +zzzzzzzzzzzzzz-8874.dynv6.net +zzzzzzzzzzzzzz-969.dynv6.net +zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.loseyourip.com +zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.ooguy.com diff --git a/internal/fcm/fcm.go b/internal/fcm/fcm.go new file mode 100644 index 0000000..65a3b1a --- /dev/null +++ b/internal/fcm/fcm.go @@ -0,0 +1,315 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +// Package fcm sends data messages to Android devices through Firebase Cloud Messaging's HTTP v1 API. +package fcm + +import ( + "bytes" + "context" + "crypto" + "crypto/rand" + "crypto/rsa" + "crypto/sha256" + "crypto/x509" + "encoding/base64" + "encoding/json" + "encoding/pem" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "os" + "strconv" + "strings" + "sync" + "time" + + "github.com/MeshCore-Beacon/beacon-push/internal/push" +) + +const ( + scope = "https://www.googleapis.com/auth/firebase.messaging" + sendBase = "https://fcm.googleapis.com" + callLimit = 10 * time.Second + sendLimit = 10 * time.Second // a whole Send: token, 401 retry and waits included + tokenRetryIn = 5 * time.Second // a failed token request is shared this long before the next try + maxReply = 64 << 10 + tokenLifetime = time.Hour + tokenRefreshIn = 2 * time.Minute // refresh this long before the access token expires +) + +// FCM obtains an access token from a service-account key (a signed JWT exchanged at the key's token endpoint) and +// caches it until shortly before it expires. Nothing it holds (key, access token, device tokens) is ever logged or +// put in an error. +type FCM struct { + projectID, clientEmail, tokenURL, sendBase string + key *rsa.PrivateKey + client *http.Client + now func() time.Time + sendLimit time.Duration + + refreshing chan struct{} // one token request at a time; a waiter gives up with its context + + mu sync.Mutex + access string + expiry time.Time + failErr error + failUntil time.Time +} + +type serviceAccount struct { + ProjectID string `json:"project_id"` + ClientEmail string `json:"client_email"` + PrivateKey string `json:"private_key"` + TokenURI string `json:"token_uri"` +} + +// Load reads a Google service-account JSON file. The error never includes the file's content. +func Load(path string) (*FCM, error) { + raw, err := os.ReadFile(path) + if err != nil { + return nil, errors.New("firebase credentials file cannot be read") + } + return Parse(raw) +} + +// Parse builds the sender from service-account JSON. +func Parse(raw []byte) (*FCM, error) { + var sa serviceAccount + if json.Unmarshal(raw, &sa) != nil || sa.ProjectID == "" || sa.ClientEmail == "" || sa.PrivateKey == "" { + return nil, errors.New("firebase credentials file is not a service-account key") + } + tokenURL := sa.TokenURI + if tokenURL == "" { + tokenURL = "https://oauth2.googleapis.com/token" + } + if u, err := url.Parse(tokenURL); err != nil || u.Scheme != "https" || u.Host == "" { + return nil, errors.New("firebase credentials token_uri must be an https URL") + } + block, _ := pem.Decode([]byte(sa.PrivateKey)) + if block == nil { + return nil, errors.New("firebase credentials private key is not PEM") + } + var key *rsa.PrivateKey + if k, err := x509.ParsePKCS8PrivateKey(block.Bytes); err == nil { + rk, ok := k.(*rsa.PrivateKey) + if !ok { + return nil, errors.New("firebase credentials private key is not RSA") + } + key = rk + } else if k, err := x509.ParsePKCS1PrivateKey(block.Bytes); err == nil { + key = k + } else { + return nil, errors.New("firebase credentials private key cannot be parsed") + } + return New(sa.ProjectID, sa.ClientEmail, tokenURL, sendBase, key, nil, nil), nil +} + +// New builds the sender from its parts; tests point tokenURL and base at a local server. +func New(projectID, clientEmail, tokenURL, base string, key *rsa.PrivateKey, client *http.Client, now func() time.Time) *FCM { + if client == nil { + client = &http.Client{Timeout: callLimit, CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }} + } + if now == nil { + now = time.Now + } + return &FCM{projectID: projectID, clientEmail: clientEmail, tokenURL: tokenURL, sendBase: strings.TrimRight(base, "/"), key: key, + client: client, now: now, sendLimit: sendLimit, refreshing: make(chan struct{}, 1)} +} + +func b64(b []byte) string { return base64.RawURLEncoding.EncodeToString(b) } + +func (f *FCM) assertion() (string, error) { + now := f.now() + hdr, _ := json.Marshal(map[string]string{"alg": "RS256", "typ": "JWT"}) + claims, _ := json.Marshal(map[string]any{"iss": f.clientEmail, "scope": scope, "aud": f.tokenURL, + "iat": now.Unix(), "exp": now.Add(tokenLifetime).Unix()}) + signing := b64(hdr) + "." + b64(claims) + sum := sha256.Sum256([]byte(signing)) + sig, err := rsa.SignPKCS1v15(rand.Reader, f.key, crypto.SHA256, sum[:]) + if err != nil { + return "", errors.New("fcm token request could not be signed") + } + return signing + "." + b64(sig), nil +} + +// cached is the usable access token, or the recent token failure every caller shares. +func (f *FCM) cached() (string, bool, error) { + f.mu.Lock() + defer f.mu.Unlock() + now := f.now() + if f.access != "" && now.Add(tokenRefreshIn).Before(f.expiry) { + return f.access, true, nil + } + if f.failErr != nil && now.Before(f.failUntil) { + return "", true, f.failErr + } + return "", false, nil +} + +// accessToken returns the cached access token, getting a new one when it is near expiry. +func (f *FCM) accessToken(ctx context.Context) (string, error) { + if tok, ok, err := f.cached(); ok { + return tok, err + } + select { + case f.refreshing <- struct{}{}: + case <-ctx.Done(): + return "", errors.New("fcm token request timed out") + } + defer func() { <-f.refreshing }() + // Whoever held the slot may have just refreshed, or failed. + if tok, ok, err := f.cached(); ok { + return tok, err + } + tok, expiresIn, err := f.requestToken(ctx) + f.mu.Lock() + defer f.mu.Unlock() + if err != nil { + if !errors.Is(ctx.Err(), context.Canceled) { + f.failErr, f.failUntil = err, f.now().Add(tokenRetryIn) + } + return "", err + } + f.access, f.expiry, f.failErr = tok, f.now().Add(expiresIn), nil + return tok, nil +} + +func (f *FCM) requestToken(ctx context.Context) (string, time.Duration, error) { + jwt, err := f.assertion() + if err != nil { + return "", 0, err + } + form := url.Values{"grant_type": {"urn:ietf:params:oauth:grant-type:jwt-bearer"}, "assertion": {jwt}} + ctx, cancel := context.WithTimeout(ctx, callLimit) + defer cancel() + req, err := http.NewRequestWithContext(ctx, http.MethodPost, f.tokenURL, strings.NewReader(form.Encode())) + if err != nil { + return "", 0, errors.New("fcm token request failed") + } + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + resp, err := f.client.Do(req) + if err != nil { + return "", 0, errors.New("fcm token endpoint unreachable") + } + defer resp.Body.Close() + body, _ := io.ReadAll(io.LimitReader(resp.Body, maxReply)) + var out struct { + AccessToken string `json:"access_token"` + ExpiresIn int64 `json:"expires_in"` + } + if resp.StatusCode != http.StatusOK || json.Unmarshal(body, &out) != nil || out.AccessToken == "" { + return "", 0, fmt.Errorf("fcm token endpoint answered %d", resp.StatusCode) + } + return out.AccessToken, time.Duration(out.ExpiresIn) * time.Second, nil +} + +func (f *FCM) forgetToken() { + f.mu.Lock() + f.access = "" + f.mu.Unlock() +} + +// body is the v1 message: data-only and high priority. +func (f *FCM) body(m push.Message) []byte { + android := map[string]any{"priority": "high", "ttl": strconv.FormatInt(int64(m.TTL/time.Second), 10) + "s"} + if m.CollapseKey != "" { + android["collapse_key"] = m.CollapseKey + } + b, _ := json.Marshal(map[string]any{"message": map[string]any{"token": m.Token, "data": m.Data, "android": android}}) + return b +} + +// Send posts one message. push.ErrUnregistered when Google says the device token is gone, otherwise a *push.Error for +// an FCM answer or a plain error when FCM could not be reached. +func (f *FCM) Send(ctx context.Context, m push.Message) error { + ctx, cancel := context.WithTimeout(ctx, f.sendLimit) + defer cancel() + body := f.body(m) + for attempt := 0; ; attempt++ { + access, err := f.accessToken(ctx) + if err != nil { + return err + } + cctx, cancel := context.WithTimeout(ctx, callLimit) + req, err := http.NewRequestWithContext(cctx, http.MethodPost, f.sendBase+"/v1/projects/"+url.PathEscape(f.projectID)+"/messages:send", bytes.NewReader(body)) + if err != nil { + cancel() + return errors.New("fcm request failed") + } + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Authorization", "Bearer "+access) + resp, err := f.client.Do(req) + if err != nil { + cancel() + return errors.New("fcm unreachable") + } + reply, _ := io.ReadAll(io.LimitReader(resp.Body, maxReply)) + resp.Body.Close() + cancel() + switch { + case resp.StatusCode == http.StatusOK: + return nil + case resp.StatusCode == http.StatusUnauthorized && attempt == 0: + f.forgetToken() // the cached access token went stale: get a new one once + continue + } + code, status := errorCode(reply) + if code == "UNREGISTERED" || (resp.StatusCode == http.StatusNotFound && (status == "NOT_FOUND" || status == "UNREGISTERED")) { + return push.ErrUnregistered + } + if code == "" { + code = status + } + e := &push.Error{Provider: push.FCM, Status: resp.StatusCode, Code: code, RetryAfter: push.RetryAfter(resp.Header.Get("Retry-After"), f.now())} + switch resp.StatusCode { + case http.StatusBadRequest: + if code == "INVALID_ARGUMENT" { + e.Kind = push.ErrInvalid + } + case http.StatusUnauthorized, http.StatusForbidden: + e.Kind = push.ErrAuth + case http.StatusTooManyRequests: + e.Kind = push.ErrThrottled + case http.StatusInternalServerError, http.StatusServiceUnavailable: + e.Kind = push.ErrUnavailable + } + return e + } +} + +// errorCode reads Google's error reply: the FCM errorCode from its details, and the Google status. +func errorCode(reply []byte) (code, status string) { + var e struct { + Error struct { + Status string `json:"status"` + Details []struct { + ErrorCode string `json:"errorCode"` + } `json:"details"` + } `json:"error"` + } + if json.Unmarshal(reply, &e) != nil { + return "", "" + } + for _, d := range e.Error.Details { + if d.ErrorCode != "" { + code = d.ErrorCode + break + } + } + // Only short upper-case words, so nothing odd from the reply reaches a log line. + clean := func(v string) string { + if len(v) > 40 { + return "" + } + for _, c := range v { + if (c < 'A' || c > 'Z') && c != '_' { + return "" + } + } + return v + } + return clean(code), clean(e.Error.Status) +} diff --git a/internal/fcm/fcm_test.go b/internal/fcm/fcm_test.go new file mode 100644 index 0000000..ada61a6 --- /dev/null +++ b/internal/fcm/fcm_test.go @@ -0,0 +1,379 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package fcm + +import ( + "context" + "crypto" + "crypto/rand" + "crypto/rsa" + "crypto/sha256" + "crypto/x509" + "encoding/base64" + "encoding/json" + "encoding/pem" + "errors" + "io" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strings" + "sync" + "sync/atomic" + "testing" + "time" + + "github.com/MeshCore-Beacon/beacon-push/internal/push" +) + +type fcmServer struct { + t *testing.T + key *rsa.PrivateKey + srv *httptest.Server + mu sync.Mutex + tokenHits int + sendHits int + lastSend map[string]any + lastAuth string + lastPath string + sendReply func(w http.ResponseWriter, hit int) + expiresIn int + + tokenDelay atomic.Int64 // nanoseconds the token endpoint waits before answering + tokenStatus atomic.Int64 // non-zero: the token endpoint answers this status +} + +func newFCMServer(t *testing.T) *fcmServer { + t.Helper() + key, err := rsa.GenerateKey(rand.Reader, 2048) + if err != nil { + t.Fatal(err) + } + f := &fcmServer{t: t, key: key, expiresIn: 3600} + f.srv = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path == "/token" { + _ = r.ParseForm() // read the body so a client that gives up cancels r.Context + select { + case <-time.After(time.Duration(f.tokenDelay.Load())): + case <-r.Context().Done(): + return + } + if st := f.tokenStatus.Load(); st != 0 { + f.mu.Lock() + f.tokenHits++ + f.mu.Unlock() + w.WriteHeader(int(st)) + return + } + } + f.mu.Lock() + defer f.mu.Unlock() + switch { + case r.URL.Path == "/token": + f.tokenHits++ + _ = r.ParseForm() + f.checkAssertion(r.PostForm.Get("assertion"), r.PostForm.Get("grant_type")) + _ = json.NewEncoder(w).Encode(map[string]any{"access_token": "access-" + string(rune('0'+f.tokenHits)), "expires_in": f.expiresIn}) + case strings.HasSuffix(r.URL.Path, "/messages:send"): + f.sendHits++ + f.lastAuth, f.lastPath = r.Header.Get("Authorization"), r.URL.Path + body, _ := io.ReadAll(r.Body) + f.lastSend = map[string]any{} + _ = json.Unmarshal(body, &f.lastSend) + if f.sendReply != nil { + f.sendReply(w, f.sendHits) + return + } + _, _ = w.Write([]byte(`{"name":"projects/p/messages/1"}`)) + default: + http.NotFound(w, r) + } + })) + t.Cleanup(f.srv.Close) + return f +} + +func (f *fcmServer) checkAssertion(jwt, grant string) { + f.t.Helper() + if grant != "urn:ietf:params:oauth:grant-type:jwt-bearer" { + f.t.Errorf("grant type %q", grant) + } + parts := strings.Split(jwt, ".") + if len(parts) != 3 { + f.t.Errorf("assertion %q", jwt) + return + } + sig, _ := base64.RawURLEncoding.DecodeString(parts[2]) + sum := sha256.Sum256([]byte(parts[0] + "." + parts[1])) + if err := rsa.VerifyPKCS1v15(&f.key.PublicKey, crypto.SHA256, sum[:], sig); err != nil { + f.t.Errorf("assertion signature: %v", err) + } + hdr, _ := base64.RawURLEncoding.DecodeString(parts[0]) + claims, _ := base64.RawURLEncoding.DecodeString(parts[1]) + var c map[string]any + _ = json.Unmarshal(claims, &c) + if !strings.Contains(string(hdr), "RS256") || c["iss"] != "svc@project.iam" || c["scope"] != "https://www.googleapis.com/auth/firebase.messaging" || + c["aud"] != f.srv.URL+"/token" || c["exp"].(float64)-c["iat"].(float64) != 3600 { + f.t.Errorf("claims %s header %s", claims, hdr) + } +} + +func (f *fcmServer) fcm(now func() time.Time) *FCM { + return New("my-project", "svc@project.iam", f.srv.URL+"/token", f.srv.URL, f.key, f.srv.Client(), now) +} + +var sampleMsg = push.Message{Platform: push.Android, Token: "device-token-abc", Data: map[string]string{"v": "1", "ct": "c2VjcmV0"}, CollapseKey: "inst_a:42", TTL: time.Hour, + AlertTitle: "Ottawa Mesh", AlertBody: "New alert"} + +func TestFCMSendsTheV1Message(t *testing.T) { + f := newFCMServer(t) + clock := time.Date(2026, 11, 17, 12, 0, 0, 0, time.UTC) + if err := f.fcm(func() time.Time { return clock }).Send(context.Background(), sampleMsg); err != nil { + t.Fatal(err) + } + m := f.lastSend["message"].(map[string]any) + data := m["data"].(map[string]any) + if f.lastPath != "/v1/projects/my-project/messages:send" || f.lastAuth != "Bearer access-1" || m["token"] != "device-token-abc" || + len(data) != 2 || data["ct"] != "c2VjcmV0" || m["notification"] != nil { + t.Fatalf("%s %s %+v", f.lastPath, f.lastAuth, f.lastSend) + } + android := m["android"].(map[string]any) + if android["priority"] != "high" || android["ttl"] != "3600s" || android["collapse_key"] != "inst_a:42" { + t.Fatalf("android %+v", android) + } + if m["apns"] != nil { + t.Fatalf("an Android message carries an apns block: %+v", m) + } +} + +func TestFCMOmitsAnEmptyCollapseKey(t *testing.T) { + f := newFCMServer(t) + msg := sampleMsg + msg.CollapseKey = "" + if err := f.fcm(nil).Send(context.Background(), msg); err != nil { + t.Fatal(err) + } + m := f.lastSend["message"].(map[string]any) + if _, ok := m["android"].(map[string]any)["collapse_key"]; ok { + t.Fatal("android collapse_key sent") + } +} + +func TestFCMCachesTheAccessTokenUntilNearExpiry(t *testing.T) { + f := newFCMServer(t) + clock := time.Date(2026, 11, 15, 12, 0, 0, 0, time.UTC) + c := f.fcm(func() time.Time { return clock }) + for i := 0; i < 3; i++ { + if err := c.Send(context.Background(), sampleMsg); err != nil { + t.Fatal(err) + } + } + if f.tokenHits != 1 || f.sendHits != 3 { + t.Fatalf("token hits %d send hits %d", f.tokenHits, f.sendHits) + } + clock = clock.Add(59 * time.Minute) // inside the two minute refresh margin of a one hour token + if err := c.Send(context.Background(), sampleMsg); err != nil { + t.Fatal(err) + } + if f.tokenHits != 2 || f.lastAuth != "Bearer access-2" { + t.Fatalf("not refreshed: hits %d auth %s", f.tokenHits, f.lastAuth) + } +} + +func TestFCMUnregisteredToken(t *testing.T) { + f := newFCMServer(t) + f.sendReply = func(w http.ResponseWriter, _ int) { + w.WriteHeader(404) + _, _ = w.Write([]byte(`{"error":{"code":404,"status":"NOT_FOUND","details":[{"@type":"x","errorCode":"UNREGISTERED"}]}}`)) + } + if err := f.fcm(nil).Send(context.Background(), sampleMsg); !errors.Is(err, push.ErrUnregistered) { + t.Fatalf("%v", err) + } + f.sendReply = func(w http.ResponseWriter, _ int) { + w.WriteHeader(400) + _, _ = w.Write([]byte(`{"error":{"code":400,"status":"INVALID_ARGUMENT","details":[{"errorCode":"UNREGISTERED"}]}}`)) + } + if err := f.fcm(nil).Send(context.Background(), sampleMsg); !errors.Is(err, push.ErrUnregistered) { + t.Fatalf("400 unregistered: %v", err) + } + f.sendReply = func(w http.ResponseWriter, _ int) { + w.WriteHeader(400) + _, _ = w.Write([]byte(`{"error":{"code":400,"status":"INVALID_ARGUMENT","message":"bad payload"}}`)) + } + if err := f.fcm(nil).Send(context.Background(), sampleMsg); !errors.Is(err, push.ErrInvalid) || errors.Is(err, push.ErrUnregistered) { + t.Fatalf("a plain 400 must be an invalid message, not an unregistered token: %v", err) + } + f.sendReply = func(w http.ResponseWriter, _ int) { + w.WriteHeader(400) + _, _ = w.Write([]byte(`{"error":{"code":400,"status":"INVALID_ARGUMENT","details":[{"errorCode":"INVALID_ARGUMENT"}]}}`)) + } + if err := f.fcm(nil).Send(context.Background(), sampleMsg); !errors.Is(err, push.ErrInvalid) { + t.Fatalf("400 INVALID_ARGUMENT detail: %v", err) + } +} + +func TestFCMKeepsTheBackoff(t *testing.T) { + f := newFCMServer(t) + for _, c := range []struct { + status int + header string + body string + want time.Duration + code string + kind error + }{ + {503, "3600", `{"error":{"code":503,"status":"UNAVAILABLE","details":[{"errorCode":"UNAVAILABLE"}]}}`, time.Hour, "UNAVAILABLE", push.ErrUnavailable}, + {429, "7", `{"error":{"code":429,"status":"RESOURCE_EXHAUSTED","details":[{"errorCode":"QUOTA_EXCEEDED"}]}}`, 7 * time.Second, "QUOTA_EXCEEDED", push.ErrThrottled}, + {500, "", `{"error":{"code":500,"status":"INTERNAL"}}`, 0, "INTERNAL", push.ErrUnavailable}, + {503, "Wed, 18 Nov 2026 12:00:30 GMT", ``, 30 * time.Second, "", push.ErrUnavailable}, + {502, "", ``, 0, "", nil}, + } { + f.sendReply = func(w http.ResponseWriter, _ int) { + if c.header != "" { + w.Header().Set("Retry-After", c.header) + } + w.WriteHeader(c.status) + _, _ = w.Write([]byte(c.body)) + } + now := func() time.Time { return time.Date(2026, 11, 18, 12, 0, 0, 0, time.UTC) } + err := f.fcm(now).Send(context.Background(), sampleMsg) + var fe *push.Error + if !errors.As(err, &fe) || fe.Provider != "fcm" || fe.Status != c.status || fe.RetryAfter != c.want || fe.Code != c.code || fe.Kind != c.kind { + t.Errorf("%d %q: %#v", c.status, c.header, err) + } + if errors.Is(err, push.ErrInvalid) || errors.Is(err, push.ErrUnregistered) { + t.Errorf("%d: %v", c.status, err) + } + } +} + +func TestFCMRetriesOnceAfterAStaleAccessToken(t *testing.T) { + f := newFCMServer(t) + f.sendReply = func(w http.ResponseWriter, hit int) { + if hit == 1 { + w.WriteHeader(401) + return + } + _, _ = w.Write([]byte(`{}`)) + } + if err := f.fcm(nil).Send(context.Background(), sampleMsg); err != nil { + t.Fatal(err) + } + if f.tokenHits != 2 || f.sendHits != 2 || f.lastAuth != "Bearer access-2" { + t.Fatalf("token hits %d, send hits %d, auth %s", f.tokenHits, f.sendHits, f.lastAuth) + } + f.sendReply = func(w http.ResponseWriter, _ int) { w.WriteHeader(401) } + if err := f.fcm(nil).Send(context.Background(), sampleMsg); !errors.Is(err, push.ErrAuth) { + t.Fatalf("a second 401 must fail as an auth error: %v", err) + } +} + +func TestFCMErrorsNeverCarrySecrets(t *testing.T) { + f := newFCMServer(t) + f.sendReply = func(w http.ResponseWriter, _ int) { + w.WriteHeader(500) + _, _ = w.Write([]byte(`{"error":"device-token-abc access-1 leaked"}`)) + } + err := f.fcm(nil).Send(context.Background(), sampleMsg) + if err == nil || strings.Contains(err.Error(), "device-token-abc") || strings.Contains(err.Error(), "access-1") || !strings.Contains(err.Error(), "500") { + t.Fatalf("%v", err) + } + // An unreachable token endpoint says so without the URL, the assertion or the key. + c := New("p", "svc@project.iam", "http://127.0.0.1:1/token", "http://127.0.0.1:1", f.key, nil, nil) + err = c.Send(context.Background(), sampleMsg) + if err == nil || strings.Contains(err.Error(), "127.0.0.1") || strings.Contains(err.Error(), "device-token-abc") { + t.Fatalf("%v", err) + } +} + +func serviceAccountJSON(t *testing.T, key *rsa.PrivateKey, tokenURI string) []byte { + t.Helper() + der, err := x509.MarshalPKCS8PrivateKey(key) + if err != nil { + t.Fatal(err) + } + pemKey := pem.EncodeToMemory(&pem.Block{Type: "PRIVATE KEY", Bytes: der}) + b, _ := json.Marshal(map[string]string{"project_id": "my-project", "client_email": "svc@project.iam", "private_key": string(pemKey), "token_uri": tokenURI}) + return b +} + +func TestLoad(t *testing.T) { + key, _ := rsa.GenerateKey(rand.Reader, 2048) + dir := t.TempDir() + write := func(name string, b []byte) string { + p := filepath.Join(dir, name) + if err := os.WriteFile(p, b, 0o600); err != nil { + t.Fatal(err) + } + return p + } + if _, err := Load(write("ok.json", serviceAccountJSON(t, key, "https://oauth2.example/token"))); err != nil { + t.Fatal(err) + } + // No token_uri falls back to Google's. + if f, err := Load(write("default.json", serviceAccountJSON(t, key, ""))); err != nil || f.tokenURL != "https://oauth2.googleapis.com/token" { + t.Fatalf("%v", err) + } + for name, content := range map[string][]byte{ + "http token": serviceAccountJSON(t, key, "http://oauth2.example/token"), + "not json": []byte("hunter2-secret"), + "missing key": []byte(`{"project_id":"p","client_email":"e"}`), + "bad pem": []byte(`{"project_id":"p","client_email":"e","private_key":"super-secret-material"}`), + "empty object": []byte(`{}`), + } { + _, err := Load(write(name+".json", content)) + if err == nil { + t.Errorf("%s accepted", name) + continue + } + for _, secret := range []string{"hunter2-secret", "super-secret-material", dir} { + if strings.Contains(err.Error(), secret) { + t.Errorf("%s: error leaks %q: %v", name, secret, err) + } + } + } + if _, err := Load(filepath.Join(dir, "missing.json")); err == nil || strings.Contains(err.Error(), dir) { + t.Errorf("missing file: %v", err) + } +} + +func TestFCMSendHasOneDeadline(t *testing.T) { + f := newFCMServer(t) + f.tokenDelay.Store(int64(5 * time.Second)) + c := f.fcm(nil) + c.sendLimit = 300 * time.Millisecond + start := time.Now() + if err := c.Send(context.Background(), sampleMsg); err == nil { + t.Fatal("a hanging token endpoint let the send through") + } + if took := time.Since(start); took > 2*time.Second { + t.Fatalf("send took %s with a 300 ms limit", took) + } +} + +func TestFCMSharesAFailedTokenRefresh(t *testing.T) { + f := newFCMServer(t) + f.tokenDelay.Store(int64(300 * time.Millisecond)) + f.tokenStatus.Store(503) + c := f.fcm(nil) + var wg sync.WaitGroup + start := time.Now() + for i := 0; i < 8; i++ { + wg.Add(1) + go func() { + defer wg.Done() + if err := c.Send(context.Background(), sampleMsg); err == nil { + t.Error("send passed without an access token") + } + }() + } + wg.Wait() + f.mu.Lock() + hits := f.tokenHits + f.mu.Unlock() + if took := time.Since(start); hits != 1 || took > 1500*time.Millisecond { + t.Fatalf("%d token requests in %s; waiting senders must share one failure", hits, took) + } +} diff --git a/internal/limit/limit.go b/internal/limit/limit.go new file mode 100644 index 0000000..a5a9794 --- /dev/null +++ b/internal/limit/limit.go @@ -0,0 +1,66 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +// Package limit counts requests per key in fixed time windows, in memory. A restart forgets the counts, which is +// fine for short windows; daily quotas are counted in the database instead. +package limit + +import ( + "sync" + "time" +) + +// Window allows at most a number of events per key in each window. +type Window struct { + every time.Duration + + mu sync.Mutex + slots map[string]*slot + sweep time.Time +} + +type slot struct { + start time.Time + n int +} + +// New returns a limiter with windows of the given length. +func New(every time.Duration) *Window { + return &Window{every: every, slots: map[string]*slot{}} +} + +// Allow counts one event for key and reports whether it fits under max. When it does not, it also returns how long +// until the window resets. max <= 0 refuses everything. +func (w *Window) Allow(key string, max int, now time.Time) (bool, time.Duration) { + w.mu.Lock() + defer w.mu.Unlock() + if now.Sub(w.sweep) > w.every { + for k, s := range w.slots { + if now.Sub(s.start) >= w.every { + delete(w.slots, k) + } + } + w.sweep = now + } + s := w.slots[key] + if s == nil || now.Sub(s.start) >= w.every { + s = &slot{start: now} + w.slots[key] = s + } + if s.n >= max { + return false, s.start.Add(w.every).Sub(now) + } + s.n++ + return true, 0 +} + +// Count returns how many events key has in its current window, without counting one. +func (w *Window) Count(key string, now time.Time) int { + w.mu.Lock() + defer w.mu.Unlock() + s := w.slots[key] + if s == nil || now.Sub(s.start) >= w.every { + return 0 + } + return s.n +} diff --git a/internal/limit/limit_test.go b/internal/limit/limit_test.go new file mode 100644 index 0000000..176f2f2 --- /dev/null +++ b/internal/limit/limit_test.go @@ -0,0 +1,35 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package limit + +import ( + "testing" + "time" +) + +func TestWindow(t *testing.T) { + w := New(time.Minute) + now := time.Date(2026, 11, 17, 12, 0, 0, 0, time.UTC) + for i := 0; i < 3; i++ { + if ok, _ := w.Allow("a", 3, now); !ok { + t.Fatalf("event %d refused", i) + } + } + ok, wait := w.Allow("a", 3, now.Add(20*time.Second)) + if ok || wait != 40*time.Second { + t.Fatalf("fourth event: ok %v wait %v", ok, wait) + } + if ok, _ := w.Allow("b", 3, now); !ok { + t.Fatal("keys must be counted apart") + } + if ok, _ := w.Allow("a", 3, now.Add(time.Minute)); !ok { + t.Fatal("a new window must start over") + } + if n := w.Count("a", now.Add(time.Minute)); n != 1 { + t.Fatalf("count %d", n) + } + if ok, _ := w.Allow("c", 0, now); ok { + t.Fatal("a zero limit must refuse") + } +} diff --git a/internal/mail/mail.go b/internal/mail/mail.go new file mode 100644 index 0000000..8097ef0 --- /dev/null +++ b/internal/mail/mail.go @@ -0,0 +1,62 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +// Package mail sends the plain-text messages the relay needs: registration links and admin notices. +package mail + +import ( + "context" + "log/slog" + "sync" +) + +// Message is one plain-text email. Text is UTF-8 with any line endings. +type Message struct { + To, Subject, Text string +} + +// Sender delivers a message or reports why it could not. +type Sender interface { + Send(ctx context.Context, m Message) error +} + +// Log is a Sender for dev mode: it writes the message to the log instead of sending it. +type Log struct{} + +func (Log) Send(_ context.Context, m Message) error { + slog.Info("mail (dev mode, not sent)", "component", "mail", "to", m.To, "subject", m.Subject, "text", m.Text) + return nil +} + +// Recorder is a Sender for tests: it keeps what it was given and can be told to fail. +// The zero value is ready and safe for concurrent use. +type Recorder struct { + mu sync.Mutex + msgs []Message + err error +} + +// Send records m, or returns the error set with FailWith without recording. +func (r *Recorder) Send(_ context.Context, m Message) error { + r.mu.Lock() + defer r.mu.Unlock() + if r.err != nil { + return r.err + } + r.msgs = append(r.msgs, m) + return nil +} + +// FailWith makes later sends return err; nil makes them succeed again. +func (r *Recorder) FailWith(err error) { + r.mu.Lock() + r.err = err + r.mu.Unlock() +} + +// Messages returns a copy of what was sent so far. +func (r *Recorder) Messages() []Message { + r.mu.Lock() + defer r.mu.Unlock() + return append([]Message(nil), r.msgs...) +} diff --git a/internal/mail/smtp.go b/internal/mail/smtp.go new file mode 100644 index 0000000..09c1e56 --- /dev/null +++ b/internal/mail/smtp.go @@ -0,0 +1,166 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package mail + +import ( + "context" + "crypto/rand" + "crypto/tls" + "encoding/hex" + "errors" + "fmt" + "mime" + "net" + "net/mail" + "net/smtp" + "strconv" + "strings" + "time" +) + +const smtpTimeout = 15 * time.Second + +type smtpSender struct { + host string + port int + username, password string + from string + startTLS bool + fromAddr *mail.Address + fromErr error +} + +// NewSMTP returns a Sender that talks to one SMTP server. With startTLS the send fails unless the +// server offers STARTTLS; it never falls back to plain text. A username turns on PLAIN auth. +func NewSMTP(host string, port int, username, password, from string, startTLS bool) Sender { + s := &smtpSender{host: host, port: port, username: username, password: password, from: from, startTLS: startTLS} + s.fromAddr, s.fromErr = mail.ParseAddress(from) + return s +} + +// WithDisplayName returns from with name as the display name when from is a bare address. An explicit display name +// is kept. The result is built by net/mail, so a name with special characters is quoted or encoded and can never +// carry a line break. An unparsable from is returned unchanged; NewSMTP reports it on send. +func WithDisplayName(from, name string) string { + a, err := mail.ParseAddress(from) + if err != nil || a.Name != "" || name == "" { + return from + } + a.Name = name + return a.String() +} + +func (s *smtpSender) Send(ctx context.Context, m Message) error { + if s.fromErr != nil { + return fmt.Errorf("mail: invalid from address: %w", s.fromErr) + } + for _, v := range []string{m.To, m.Subject} { + if strings.ContainsAny(v, "\r\n") { + return errors.New("mail: header value contains a line break") + } + } + to, err := mail.ParseAddress(m.To) + if err != nil { + return fmt.Errorf("mail: invalid recipient: %w", err) + } + msg := s.build(to, m) + + ctx, cancel := context.WithTimeout(ctx, smtpTimeout) + defer cancel() + addr := net.JoinHostPort(s.host, strconv.Itoa(s.port)) + conn, err := (&net.Dialer{Timeout: smtpTimeout}).DialContext(ctx, "tcp", addr) + if err != nil { + return fmt.Errorf("mail: connect: %w", err) + } + defer conn.Close() + // The deadline bounds every read and write; cancelling the context closes the connection. + deadline, _ := ctx.Deadline() + _ = conn.SetDeadline(deadline) + stop := context.AfterFunc(ctx, func() { _ = conn.Close() }) + defer stop() + + c, err := smtp.NewClient(conn, s.host) + if err != nil { + return fmt.Errorf("mail: greeting: %w", err) + } + defer c.Close() + if err := c.Hello("localhost"); err != nil { + return fmt.Errorf("mail: hello: %w", err) + } + if s.startTLS { + if ok, _ := c.Extension("STARTTLS"); !ok { + return errors.New("mail: server does not offer STARTTLS") + } + if err := c.StartTLS(&tls.Config{ServerName: s.host, MinVersion: tls.VersionTLS12}); err != nil { + return fmt.Errorf("mail: starttls: %w", err) + } + } + if s.username != "" { + if ok, _ := c.Extension("AUTH"); !ok { + return errors.New("mail: server does not offer AUTH") + } + if err := c.Auth(plainAuth{s.username, s.password, s.host}); err != nil { + return fmt.Errorf("mail: auth: %w", err) + } + } + if err := c.Mail(s.fromAddr.Address); err != nil { + return fmt.Errorf("mail: sender: %w", err) + } + if err := c.Rcpt(to.Address); err != nil { + return fmt.Errorf("mail: recipient: %w", err) + } + w, err := c.Data() + if err != nil { + return fmt.Errorf("mail: data: %w", err) + } + if _, err := w.Write(msg); err != nil { + return fmt.Errorf("mail: write: %w", err) + } + if err := w.Close(); err != nil { + return fmt.Errorf("mail: send: %w", err) + } + _ = c.Quit() + return nil +} + +func (s *smtpSender) build(to *mail.Address, m Message) []byte { + domain := "localhost" + if i := strings.LastIndex(s.fromAddr.Address, "@"); i >= 0 { + domain = s.fromAddr.Address[i+1:] + } + var id [12]byte + _, _ = rand.Read(id[:]) + body := strings.ReplaceAll(strings.ReplaceAll(m.Text, "\r\n", "\n"), "\n", "\r\n") + if !strings.HasSuffix(body, "\r\n") { + body += "\r\n" + } + var b strings.Builder + h := func(k, v string) { b.WriteString(k + ": " + v + "\r\n") } + h("Date", time.Now().Format(time.RFC1123Z)) + h("Message-ID", "<"+hex.EncodeToString(id[:])+"@"+domain+">") + h("From", s.fromAddr.String()) + h("To", to.String()) + h("Subject", mime.QEncoding.Encode("utf-8", m.Subject)) + h("MIME-Version", "1.0") + h("Content-Type", "text/plain; charset=UTF-8") + h("Content-Transfer-Encoding", "8bit") + b.WriteString("\r\n") + b.WriteString(body) + return []byte(b.String()) +} + +// plainAuth is PLAIN without net/smtp.PlainAuth's refusal to run over an unencrypted link, +// so that starttls false against a trusted relay can still authenticate. The caller chose that. +type plainAuth struct{ user, pass, host string } + +func (a plainAuth) Start(*smtp.ServerInfo) (string, []byte, error) { + return "PLAIN", []byte("\x00" + a.user + "\x00" + a.pass), nil +} + +func (a plainAuth) Next(_ []byte, more bool) ([]byte, error) { + if more { + return nil, errors.New("unexpected server challenge") + } + return nil, nil +} diff --git a/internal/push/push.go b/internal/push/push.go new file mode 100644 index 0000000..7d7daff --- /dev/null +++ b/internal/push/push.go @@ -0,0 +1,126 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +// Package push is what every push provider shares: the message, the sender and the errors the relay acts on. +package push + +import ( + "context" + "errors" + "fmt" + "log/slog" + "net/http" + "strconv" + "time" +) + +// Platforms and the provider each one goes through. +const ( + IOS = "ios" + Android = "android" + APNs = "apns" + FCM = "fcm" +) + +// APNs environments a device token belongs to. +const ( + Sandbox = "sandbox" + Production = "production" +) + +// Provider is the push service that delivers to a platform. +func Provider(platform string) string { + if platform == IOS { + return APNs + } + return FCM +} + +// Message is one notification for one device. Data is delivered as is; the app decrypts what it carries. On iOS the +// alert text is a placeholder the app's Notification Service Extension replaces after decrypting. +type Message struct { + Platform string // ios or android + Token string + APNsEnv string // sandbox or production, iOS only + Data map[string]string + CollapseKey string // at most 64 bytes; empty means none + TTL time.Duration + AlertTitle string // iOS placeholder + AlertBody string // iOS placeholder +} + +// Sender sends one message. +type Sender interface { + Send(ctx context.Context, m Message) error +} + +// What a provider's answer means for the relay. Match them with errors.Is; an *Error also carries the details. +var ( + ErrUnregistered = errors.New("push: token unregistered") // the handle should go + ErrInvalid = errors.New("push: message refused") // sending it again cannot work + ErrTooLarge = errors.New("push: message too large") // over the provider's payload limit + ErrThrottled = errors.New("push: device throttled") // too many messages for this device + ErrUnavailable = errors.New("push: provider unavailable") // an outage: back off from the whole provider + ErrAuth = errors.New("push: provider refused relay") // the relay's own credentials failed +) + +// Error is a provider's refusal. It keeps the status, the error code and the asked-for wait, never the token or the +// reply body. +type Error struct { + Provider string + Status int + Code string // the provider's reason; may be empty + RetryAfter time.Duration // 0 when the provider gave none + Kind error // one of the sentinels above, or nil +} + +func (e *Error) Error() string { + if e.Code != "" { + return fmt.Sprintf("%s answered %d %s", e.Provider, e.Status, e.Code) + } + return fmt.Sprintf("%s answered %d", e.Provider, e.Status) +} + +// Is matches the error's kind. +func (e *Error) Is(target error) bool { return e.Kind != nil && target == e.Kind } + +// Router sends iOS messages through IOS and Android ones through Android. +type Router struct { + IOS, Android Sender +} + +func (r Router) Send(ctx context.Context, m Message) error { + switch m.Platform { + case IOS: + return r.IOS.Send(ctx, m) + case Android: + return r.Android.Send(ctx, m) + } + return ErrInvalid +} + +// Log is a Sender for dev mode: it logs that a message would go out, without the token or the data. +type Log struct{} + +func (Log) Send(_ context.Context, m Message) error { + slog.Info("push (dev mode, not sent)", "component", Provider(m.Platform), "platform", m.Platform, "apns_env", m.APNsEnv, + "data_keys", len(m.Data), "collapse_key", m.CollapseKey) + return nil +} + +// RetryAfter reads a Retry-After header in seconds or as an HTTP date; 0 when absent or unreadable. +func RetryAfter(v string, now time.Time) time.Duration { + if v == "" { + return 0 + } + if n, err := strconv.ParseInt(v, 10, 64); err == nil { + if n <= 0 { + return 0 + } + return time.Duration(min(n, 86400)) * time.Second + } + if t, err := http.ParseTime(v); err == nil && t.After(now) { + return t.Sub(now) + } + return 0 +} diff --git a/internal/push/push_test.go b/internal/push/push_test.go new file mode 100644 index 0000000..b62c942 --- /dev/null +++ b/internal/push/push_test.go @@ -0,0 +1,51 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package push + +import ( + "context" + "errors" + "fmt" + "testing" +) + +type recorder struct{ got []Message } + +func (r *recorder) Send(_ context.Context, m Message) error { + r.got = append(r.got, m) + return nil +} + +func TestRouterSendsEachPlatformToItsProvider(t *testing.T) { + ios, android := &recorder{}, &recorder{} + r := Router{IOS: ios, Android: android} + for _, p := range []string{IOS, Android, Android} { + if err := r.Send(context.Background(), Message{Platform: p, Token: p}); err != nil { + t.Fatal(err) + } + } + if len(ios.got) != 1 || ios.got[0].Token != IOS || len(android.got) != 2 { + t.Fatalf("ios %+v android %+v", ios.got, android.got) + } + if err := r.Send(context.Background(), Message{Platform: "web"}); !errors.Is(err, ErrInvalid) { + t.Fatalf("unknown platform: %v", err) + } + if Provider(IOS) != APNs || Provider(Android) != FCM { + t.Fatal("provider names") + } +} + +func TestErrorMatchesItsKind(t *testing.T) { + err := fmt.Errorf("wrapped: %w", &Error{Provider: APNs, Status: 429, Code: "TooManyRequests", Kind: ErrThrottled}) + var pe *Error + if !errors.Is(err, ErrThrottled) || errors.Is(err, ErrUnavailable) || !errors.As(err, &pe) || pe.Status != 429 { + t.Fatalf("%v", err) + } + if err.Error() != "wrapped: apns answered 429 TooManyRequests" { + t.Fatalf("%q", err.Error()) + } + if errors.Is(&Error{Provider: FCM, Status: 502}, ErrUnavailable) { + t.Fatal("an error without a kind matched one") + } +} diff --git a/internal/relay/api.go b/internal/relay/api.go new file mode 100644 index 0000000..6acb106 --- /dev/null +++ b/internal/relay/api.go @@ -0,0 +1,483 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package relay + +import ( + "context" + "crypto/sha256" + "encoding/base64" + "errors" + "fmt" + "net/http" + "strconv" + "sync" + "sync/atomic" + "time" + + "github.com/MeshCore-Beacon/beacon-push/internal/push" + "github.com/MeshCore-Beacon/beacon-push/internal/store" +) + +// HelloResponse is what a server learns about itself at startup and every hour. +type HelloResponse struct { + PushID string `json:"pushId"` + Name string `json:"name"` + Status string `json:"status" enums:"active,suspended"` + Tier string `json:"tier" enums:"email,verified,custom"` + Limits Limits `json:"limits"` + URL string `json:"url,omitempty"` + DomainVerified bool `json:"domainVerified"` + TermsOutdated bool `json:"termsOutdated"` + Devices int `json:"devices"` +} + +// Limits are the send quotas that apply to a server. +type Limits struct { + PerMinute int `json:"perMinute"` + PerDay int `json:"perDay"` + PerDevicePerDay int `json:"perDevicePerDay"` +} + +func (s *Server) hello(w http.ResponseWriter, r *http.Request, inst store.Instance) { + now := s.now() + if inst.URL != "" && inst.Status == store.StatusActive && now.Sub(time.UnixMilli(inst.DomainCheckedAt)) >= DomainRecheck { + go s.checkDomainOnce(context.WithoutCancel(r.Context()), inst) + } + devices, err := s.store.CountHandles(r.Context(), inst.ID) + if err != nil { + s.log.Error("handle count failed", "component", "relay", "push_id", inst.ID, "err", err) + } + t := TierFor(inst) + writeJSON(w, http.StatusOK, HelloResponse{PushID: inst.ID, Name: inst.Name, Status: inst.Status, Tier: t.Name, + Limits: Limits{PerMinute: t.PerMinute, PerDay: t.PerDay, PerDevicePerDay: HandlePerDay}, URL: inst.URL, + DomainVerified: inst.DomainVerifiedAt != 0, TermsOutdated: inst.TermsVersion < TermsVersion, Devices: devices}) +} + +func (s *Server) verifyDomain(w http.ResponseWriter, r *http.Request, inst store.Instance) { + if inst.URL == "" { + writeError(w, http.StatusConflict, "no_url", "This server was registered without a public URL.") + return + } + if ok, wait := s.hour.Allow("domain:"+inst.ID, DomainChecksPerHour, s.now()); !ok { + rateLimited(w, wait) + return + } + if err := s.checkDomain(r.Context(), inst); err != nil { + writeJSON(w, http.StatusOK, map[string]any{"domainVerified": false, "reason": err.Error()}) + return + } + writeJSON(w, http.StatusOK, map[string]any{"domainVerified": true}) +} + +// SendRequest is a batch from one server. +type SendRequest struct { + Messages []SendItem `json:"messages"` +} + +// SendItem is one encrypted notification for one device handle. +type SendItem struct { + Handle string `json:"handle"` + Ciphertext string `json:"ciphertext"` // standard base64 + CollapseKey string `json:"collapseKey,omitempty"` // at most 40 of A-Z a-z 0-9 _ - . : + TTLSeconds int `json:"ttlSeconds,omitempty"` // default one day, at most 28 days + ID string `json:"id,omitempty"` // idempotency key, at most 64 of A-Z a-z 0-9 _ - . : +} + +// SendResult answers one item, in request order. +type SendResult struct { + MessageID string `json:"messageId,omitempty"` + Status string `json:"status" enums:"ok,rate_limited,invalid_handle,too_large,invalid,failed"` + RetryAfterSeconds int `json:"retryAfterSeconds,omitempty"` // on rate_limited, and failed after a provider outage +} + +// Send statuses. +const ( + StatusOK = "ok" + StatusRateLimited = "rate_limited" // not sent; retry after the wait, not an attempt + StatusInvalidHandle = "invalid_handle" // delete this device + StatusTooLarge = "too_large" + StatusInvalid = "invalid" + StatusFailed = "failed" // retry later +) + +// validKey is the alphabet of collapse keys and ids. +func validKey(k string, max int) bool { + if len(k) > max { + return false + } + for _, c := range k { + switch { + case c >= 'a' && c <= 'z', c >= 'A' && c <= 'Z', c >= '0' && c <= '9', c == '_', c == '-', c == '.', c == ':': + default: + return false + } + } + return true +} + +func dayStart(t time.Time) time.Time { + y, m, d := t.UTC().Date() + return time.Date(y, m, d, 0, 0, 0, 0, time.UTC) +} + +func writeSuspended(w http.ResponseWriter, status string) { + if status == store.StatusBanned { + writeError(w, http.StatusForbidden, "banned", "This server is banned from the push relay.") + return + } + writeError(w, http.StatusForbidden, "suspended", "This server is suspended from the push relay. Contact abuse@meshcorebeacon.ca.") +} + +// sendJob is an item that passed the checks and is ready to go to its push provider. +type sendJob struct { + i int + item SendItem + ct []byte + handle store.Handle +} + +// batch is what every item of one send shares. +type batch struct { + inst store.Instance + now time.Time + deadline time.Time // wall clock: items not started by then are deferred + db context.Context // outlives the request, so a reply already sent is still recorded + stop atomic.Bool // the store failed: start nothing more +} + +func (s *Server) send(w http.ResponseWriter, r *http.Request, inst store.Instance) { + if inst.Status != store.StatusActive { + writeSuspended(w, inst.Status) + return + } + var req SendRequest + if !decode(w, r, &req) { + return + } + if len(req.Messages) == 0 || len(req.Messages) > MaxBatch { + writeError(w, http.StatusBadRequest, "bad_request", "Send between 1 and 100 messages.") + return + } + ctx := r.Context() + // One batch per server at a time, so its harvesting count and limits see every earlier batch. + unlock, err := s.lockInstance(ctx, inst.ID) + if err != nil { + return + } + defer unlock() + // A batch that waited may be behind a suspension, ban or quota change. + inst, err = s.store.Instance(ctx, inst.ID) + if err != nil { + s.internal(w, "instance reload failed", err) + return + } + if inst.Status != store.StatusActive { + writeSuspended(w, inst.Status) + return + } + b := &batch{inst: inst, now: s.now(), deadline: time.Now().Add(s.batchDeadline), db: context.WithoutCancel(ctx)} + + results := make([]SendResult, len(req.Messages)) + var jobs []sendJob + for i, item := range req.Messages { + ct, err := base64.StdEncoding.DecodeString(item.Ciphertext) + switch { + case err != nil || len(ct) == 0 || !validKey(item.CollapseKey, MaxCollapseKey) || !validKey(item.ID, MaxClientID) || + item.TTLSeconds < 0 || int64(item.TTLSeconds) > int64(MaxTTL/time.Second): // compare seconds, a Duration product can overflow + results[i].Status = StatusInvalid + continue + case len(ct) > MaxCiphertext: + results[i].Status = StatusTooLarge + continue + } + // A repeat of a sent id gets its first answer, whatever has changed since: nothing is sent or counted. + if item.ID != "" { + st, msgID, _, err := s.store.SentByClientID(ctx, inst.ID, item.ID) + if err != nil && !errors.Is(err, store.ErrNotFound) { + s.internal(w, "send lookup failed", err) + return + } + if err == nil && st == store.SendOK { + results[i] = SendResult{MessageID: msgID, Status: StatusOK} + continue + } + } + + h, err := s.store.Handle(ctx, item.Handle) + if err != nil && !errors.Is(err, store.ErrNotFound) { + s.internal(w, "handle lookup failed", err) + return + } + // Only live handles count towards harvesting: a missing one may have been purged and reaches nobody, so it + // can neither prove harvesting nor dilute it. + live := err == nil && h.RevokedAt == 0 + foreign := live && h.InstanceID != inst.ID + if live && s.harvest.add(inst.ID, foreign, b.now) { + s.suspendForHarvesting(b.db, inst) + writeSuspended(w, store.StatusSuspended) + return + } + if !live || foreign { + results[i].Status = StatusInvalidHandle + s.bump(b, store.UsageInvalidHandle) + continue + } + jobs = append(jobs, sendJob{i: i, item: item, ct: ct, handle: h}) + } + + next := make(chan sendJob) + var wg sync.WaitGroup + for range min(s.sendWorkers, len(jobs)) { + wg.Add(1) + go func() { + defer wg.Done() + for j := range next { + results[j.i] = s.sendSafely(ctx, b, j) + } + }() + } + for _, j := range jobs { + next <- j + } + close(next) + wg.Wait() + + wait := 0 + for _, res := range results { + wait = max(wait, res.RetryAfterSeconds) + } + if wait > 0 { + w.Header().Set("Retry-After", strconv.Itoa(wait)) + } + writeJSON(w, http.StatusOK, map[string]any{"results": results}) +} + +func (s *Server) bump(b *batch, field string) { + if err := s.store.BumpUsage(b.db, b.inst.ID, b.now, field); err != nil { + s.log.Warn("usage not counted", "component", "relay", "push_id", b.inst.ID, "err", err) + } +} + +func (s *Server) limited(b *batch, d time.Duration) SendResult { + s.bump(b, store.UsageRateLimited) + return SendResult{Status: StatusRateLimited, RetryAfterSeconds: seconds(d)} +} + +// seconds rounds a wait up to whole seconds, at least one. +func seconds(d time.Duration) int { + return max(int((d+time.Second-1)/time.Second), 1) +} + +// storeFailed stops the batch: without durable accounting nothing more may go out. +func (s *Server) storeFailed(b *batch, what string, err error) SendResult { + s.log.Error(what, "component", "relay", "push_id", b.inst.ID, "err", err) + b.stop.Store(true) + return SendResult{Status: StatusFailed} +} + +// sendSafely is sendOne in a worker goroutine, where a panic would end the process: it fails only that item. +func (s *Server) sendSafely(ctx context.Context, b *batch, j sendJob) (res SendResult) { + defer func() { + if p := recover(); p != nil { + s.log.Error("send panicked", "component", "relay", "push_id", b.inst.ID, "panic", fmt.Sprint(p)) + res = SendResult{Status: StatusFailed} + } + }() + return s.sendOne(ctx, b, j) +} + +// sendOne reserves quota for one item, hands it to the push provider and records the answer. +func (s *Server) sendOne(ctx context.Context, b *batch, j sendJob) SendResult { + inst, h := b.inst, j.handle + if b.stop.Load() { + return SendResult{Status: StatusFailed} + } + // An id another worker of this batch already sent gets that answer before anything is spent, and one still in + // flight waits without spending a rate limit. Reserve decides for real. + if j.item.ID != "" { + st, msgID, at, err := s.store.SentByClientID(b.db, inst.ID, j.item.ID) + switch { + case err == nil && st == store.SendOK: + return SendResult{MessageID: msgID, Status: StatusOK} + case err == nil && st == store.SendPending && b.now.Sub(at) < store.PendingTimeout: + return s.limited(b, InFlightRetry) + case err != nil && !errors.Is(err, store.ErrNotFound): + return s.storeFailed(b, "send lookup failed", err) + } + } + if time.Now().After(b.deadline) || ctx.Err() != nil { + return s.limited(b, DeferredRetry) + } + provider := push.Provider(h.Platform) + if d := s.pausedFor(provider, s.now()); d > 0 { + return s.limited(b, d) + } + if d := s.cooledFor(h.Handle, s.now()); d > 0 { + return s.limited(b, d) + } + // The current row, so a quota changed mid-batch applies to what has not gone out yet. + cur, err := s.store.Instance(b.db, inst.ID) + if err != nil { + return s.storeFailed(b, "instance reload failed", err) + } + if cur.Status != store.StatusActive { + b.stop.Store(true) + return SendResult{Status: StatusFailed} + } + if ok, d := s.minute.Allow("inst:"+inst.ID, TierFor(cur).PerMinute, b.now); !ok { + return s.limited(b, d) + } + if ok, d := s.minute.Allow("handle:"+h.Handle, HandlePerMinute, b.now); !ok { + return s.limited(b, d) + } + + sum := sha256.Sum256(j.ct) + outcome, msgID, err := s.store.Reserve(b.db, store.Reservation{MessageID: "m_" + randomString(16), InstanceID: inst.ID, + Handle: h.Handle, ClientID: j.item.ID, At: b.now, Size: len(j.ct), CiphertextSHA256: sum[:], + DayLimit: func(i store.Instance) int { return TierFor(i).PerDay }, GlobalPerDay: GlobalPerDay, HandlePerDay: HandlePerDay}) + if err != nil { + return s.storeFailed(b, "send not reserved", err) + } + untilTomorrow := dayStart(b.now).Add(24 * time.Hour).Sub(b.now) + switch outcome { + case store.AlreadySent: + return SendResult{MessageID: msgID, Status: StatusOK} + case store.InFlight: + return s.limited(b, InFlightRetry) + case store.OverGlobalDay: + s.log.Warn("global daily push limit reached", "component", "relay", "limit", GlobalPerDay) + return s.limited(b, untilTomorrow) + case store.OverInstanceDay, store.OverHandleDay: + return s.limited(b, untilTomorrow) + case store.NotActive: + b.stop.Store(true) + return SendResult{Status: StatusFailed} + } + + ttl := DefaultTTL + if j.item.TTLSeconds > 0 { + ttl = time.Duration(j.item.TTLSeconds) * time.Second + } + collapse := "" + if j.item.CollapseKey != "" { + collapse = inst.ID + ":" + j.item.CollapseKey + } + // Not cancelled with the request, which would leave the outcome unknown, but bounded as a whole. + sctx, scancel := context.WithTimeout(b.db, s.sendLimit) + err = s.push.Send(sctx, push.Message{ + Platform: h.Platform, Token: h.Token, APNsEnv: h.APNsEnv, + Data: map[string]string{"v": "1", "pushId": inst.ID, "serverName": inst.Name, "messageId": msgID, + "ct": base64.StdEncoding.EncodeToString(j.ct)}, + CollapseKey: collapse, TTL: ttl, AlertTitle: inst.Name, AlertBody: "New alert", + }) + scancel() + if ferr := s.finishSend(b, msgID, err == nil); ferr != nil { + s.log.Error("send outcome not recorded", "component", "relay", "push_id", inst.ID, "err", ferr) + if err == nil { + // Unrecorded, an ok could not be repeated for this id, so the sender must not count on it. + b.stop.Store(true) + return SendResult{Status: StatusFailed} + } + } + var pe *push.Error + errors.As(err, &pe) + switch { + case err == nil: + s.providerRecovered(provider, s.now()) + return SendResult{MessageID: msgID, Status: StatusOK} + case errors.Is(err, push.ErrUnregistered): + uctx, ucancel := context.WithTimeout(b.db, finishSendTimeout) + defer ucancel() + return s.unregistered(uctx, b, h) + case errors.Is(err, push.ErrInvalid): + return SendResult{Status: StatusInvalid} + case errors.Is(err, push.ErrTooLarge): + return SendResult{Status: StatusTooLarge} + case errors.Is(err, push.ErrThrottled): + var d time.Duration + if pe != nil { + d = min(pe.RetryAfter, ProviderWaitMax) + } + if d <= 0 { + d = ThrottleRetry + } + now := s.now() + return s.limited(b, s.coolHandle(h.Handle, now.Add(d), now).Sub(now)) + case errors.Is(err, push.ErrUnavailable): + var asked time.Duration + status := 0 + if pe != nil { + asked, status = pe.RetryAfter, pe.Status + } + d := s.pauseProvider(provider, s.now(), asked) + s.log.Warn("push provider unavailable, its sends paused", "component", "relay", "provider", provider, "status", status, "pause", d.String()) + return SendResult{Status: StatusFailed, RetryAfterSeconds: seconds(d)} + case errors.Is(err, push.ErrAuth): + s.log.Error("push provider refused the relay's credentials", "component", "relay", "provider", provider, "err", err) + return SendResult{Status: StatusFailed} + } + s.log.Warn("push not delivered", "component", "relay", "push_id", inst.ID, "provider", provider, "err", err) + return SendResult{Status: StatusFailed} +} + +// finishSend records the provider's answer on a context of its own, trying a few times before giving up. +func (s *Server) finishSend(b *batch, msgID string, ok bool) error { + ctx, cancel := context.WithTimeout(b.db, finishSendTimeout) + defer cancel() + var err error + for attempt := 1; attempt <= 3; attempt++ { + if err = s.store.FinishSend(ctx, msgID, ok, s.now()); err == nil || errors.Is(err, store.ErrNotFound) { + return err + } + select { + case <-time.After(time.Duration(attempt) * 100 * time.Millisecond): + case <-ctx.Done(): + return err + } + } + return err +} + +// unregistered revokes a handle its provider no longer knows, unless the app refreshed or registered it again +// meanwhile. +func (s *Server) unregistered(ctx context.Context, b *batch, h store.Handle) SendResult { + err := s.store.RevokeHandleToken(ctx, h, s.now()) + if errors.Is(err, store.ErrNotFound) { + cur, cerr := s.store.Handle(ctx, h.Handle) + switch { + case errors.Is(cerr, store.ErrNotFound), cerr == nil && cur.RevokedAt != 0 && cur.Token == h.Token: + err = nil // already gone for this token + case cerr == nil: + return SendResult{Status: StatusFailed} // a newer registration: retry reaches it + default: + err = cerr + } + } + if err != nil { + s.log.Warn("handle not revoked", "component", "relay", "push_id", b.inst.ID, "err", err) + return SendResult{Status: StatusFailed} + } + s.bump(b, store.UsageInvalidHandle) + return SendResult{Status: StatusInvalidHandle} +} + +func (s *Server) suspendForHarvesting(ctx context.Context, inst store.Instance) { + done, err := s.store.SuspendIfActive(ctx, inst.ID) + if err != nil { + s.log.Error("automatic suspension failed", "component", "relay", "push_id", inst.ID, "err", err) + return + } + if !done { + return // banned or suspended meanwhile + } + s.log.Warn("server suspended automatically: too many unknown device handles", "component", "relay", "push_id", inst.ID) + go s.notifyAdmin(ctx, "Push server suspended automatically: "+inst.ID, + "Server "+inst.ID+" ("+inst.Name+", "+inst.Email+") addressed too many device handles that are not its own in an hour,\n"+ + "which looks like harvested handles. It is suspended until you run:\n\n beacon-push admin unsuspend "+inst.ID+"\n") +} + +func (s *Server) internal(w http.ResponseWriter, what string, err error) { + s.log.Error(what, "component", "relay", "err", err) + writeError(w, http.StatusInternalServerError, "internal", "Something went wrong.") +} diff --git a/internal/relay/domain.go b/internal/relay/domain.go new file mode 100644 index 0000000..5d9cdb8 --- /dev/null +++ b/internal/relay/domain.go @@ -0,0 +1,158 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package relay + +import ( + "context" + "crypto/hmac" + "crypto/sha256" + "encoding/hex" + "encoding/json" + "errors" + "fmt" + "io" + "net" + "net/http" + "net/netip" + "net/url" + "syscall" + "time" + + "github.com/MeshCore-Beacon/beacon-push/internal/store" +) + +// ChallengePath is where beacon-server answers the domain check. +const ChallengePath = "/.well-known/beacon-push" + +// ChallengeMAC is the answer a server gives: hex HMAC-SHA256 keyed with SHA-256 of its push secret, over +// "beacon-push-challenge::". The relay only stores that hash, so it is the key both sides hold. +func ChallengeMAC(secretHash []byte, pushID, challenge string) string { + m := hmac.New(sha256.New, secretHash) + m.Write([]byte("beacon-push-challenge:" + pushID + ":" + challenge)) + return hex.EncodeToString(m.Sum(nil)) +} + +var errBlockedAddress = errors.New("address not allowed") + +// blockedPrefixes are ranges the domain check must never reach, beyond what netip already classes as private, +// loopback or link-local: the relay runs next to other services. +var blockedPrefixes = []netip.Prefix{ + netip.MustParsePrefix("0.0.0.0/8"), + netip.MustParsePrefix("100.64.0.0/10"), + netip.MustParsePrefix("192.0.0.0/24"), + netip.MustParsePrefix("198.18.0.0/15"), + netip.MustParsePrefix("240.0.0.0/4"), + netip.MustParsePrefix("64:ff9b::/96"), + netip.MustParsePrefix("64:ff9b:1::/48"), // local-use translation, RFC 8215 + netip.MustParsePrefix("2002::/16"), // 6to4 can wrap a private IPv4 + netip.MustParsePrefix("2001::/32"), // Teredo + netip.MustParsePrefix("2001:db8::/32"), // documentation + netip.MustParsePrefix("3fff::/20"), // documentation, RFC 9637 + netip.MustParsePrefix("100::/64"), // discard-only +} + +func publicAddr(a netip.Addr) bool { + a = a.Unmap() + if !a.IsGlobalUnicast() || a.IsPrivate() || a.IsLoopback() || a.IsLinkLocalUnicast() { + return false + } + for _, p := range blockedPrefixes { + if p.Contains(a) { + return false + } + } + return true +} + +// challengeClient reaches only public addresses over https, follows no redirects and gives up quickly. Dev mode +// lifts the address rule so a local beacon-server can be checked. +func challengeClient(dev bool) *http.Client { + dialer := &net.Dialer{Timeout: 5 * time.Second} + if !dev { + dialer.Control = func(_, address string, _ syscall.RawConn) error { + ap, err := netip.ParseAddrPort(address) + if err != nil || !publicAddr(ap.Addr()) { + return errBlockedAddress + } + return nil + } + } + return &http.Client{ + Timeout: 8 * time.Second, + Transport: &http.Transport{DialContext: dialer.DialContext, TLSHandshakeTimeout: 5 * time.Second, + ResponseHeaderTimeout: 5 * time.Second, MaxIdleConns: 4, IdleConnTimeout: 30 * time.Second}, + CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }, + } +} + +// checkDomainOnce runs a check unless one for the server is already under way. +func (s *Server) checkDomainOnce(ctx context.Context, inst store.Instance) { + if _, busy := s.checking.LoadOrStore(inst.ID, struct{}{}); busy { + return + } + defer s.checking.Delete(inst.ID) + if err := s.checkDomain(ctx, inst); err != nil { + s.log.Info("domain check failed", "component", "relay", "push_id", inst.ID, "reason", err.Error()) + } +} + +// checkDomain asks the server's URL to prove it holds the push secret and records the outcome. The error is safe to +// show the operator. +func (s *Server) checkDomain(ctx context.Context, inst store.Instance) error { + err := s.challengeURL(ctx, inst) + passed := err == nil + if rerr := s.store.SetDomainCheck(ctx, inst.ID, passed, s.now()); rerr != nil { + s.log.Error("domain check not recorded", "component", "relay", "push_id", inst.ID, "err", rerr) + } + if !passed && inst.DomainVerifiedAt != 0 { + s.log.Warn("domain check failed after passing before", "component", "relay", "push_id", inst.ID, "reason", err.Error()) + s.notifyAdmin(ctx, "Push server lost its domain verification: "+inst.ID, + "Server "+inst.ID+" ("+inst.Name+", "+inst.Email+") at "+inst.URL+" no longer passes the domain check: "+err.Error()+ + ".\nIt is back on the email tier until it passes again.\n") + } + return err +} + +func (s *Server) challengeURL(ctx context.Context, inst store.Instance) error { + base, err := url.Parse(inst.URL) + if err != nil || (base.Scheme != "https" && !s.cfg.DevMode) { + return errors.New("the registered URL is not https") + } + challenge := randomString(18) + u := *base + u.Path = base.Path + ChallengePath + u.RawQuery = url.Values{"challenge": {challenge}}.Encode() + ctx, cancel := context.WithTimeout(ctx, 10*time.Second) + defer cancel() + req, err := http.NewRequestWithContext(ctx, http.MethodGet, u.String(), nil) + if err != nil { + return errors.New("the registered URL cannot be requested") + } + req.Header.Set("User-Agent", "beacon-push/1 (domain check)") + req.Header.Set("Accept", "application/json") + resp, err := s.challenge.Do(req) + if err != nil { + if errors.Is(err, errBlockedAddress) { + return errors.New("the registered URL does not resolve to a public address") + } + return errors.New("the server could not be reached") + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("%s answered %d", ChallengePath, resp.StatusCode) + } + var answer struct { + PushID string `json:"pushId"` + MAC string `json:"mac"` + } + if err := json.NewDecoder(io.LimitReader(resp.Body, 1024)).Decode(&answer); err != nil { + return fmt.Errorf("%s did not answer with JSON", ChallengePath) + } + got, _ := hex.DecodeString(answer.MAC) + want, _ := hex.DecodeString(ChallengeMAC(inst.SecretHash, inst.ID, challenge)) + if answer.PushID != inst.ID || !hmac.Equal(got, want) { + return errors.New("the answer does not match this push ID and secret") + } + return nil +} diff --git a/internal/relay/domain_test.go b/internal/relay/domain_test.go new file mode 100644 index 0000000..fb8cae1 --- /dev/null +++ b/internal/relay/domain_test.go @@ -0,0 +1,33 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package relay + +import ( + "net/netip" + "testing" +) + +func TestPublicAddrRefusesSpecialPurposeIPv6(t *testing.T) { + for _, a := range []string{ + "64:ff9b::a00:1", // well-known NAT64 + "64:ff9b:1::a00:1", // local-use translation, RFC 8215 + "2002:a00:1::1", // 6to4 wrapping 10.0.0.1 + "2001:0:a00:1::1", // Teredo + "2001:db8::1", // documentation + "3fff::1", // documentation, RFC 9637 + "100::1", // discard-only + "fd00::1", + "fe80::1", + "::ffff:10.0.0.1", + } { + if publicAddr(netip.MustParseAddr(a)) { + t.Errorf("%s counted as public", a) + } + } + for _, a := range []string{"2606:4700::1111", "1.1.1.1", "2a00:1450::1"} { + if !publicAddr(netip.MustParseAddr(a)) { + t.Errorf("%s refused", a) + } + } +} diff --git a/internal/relay/handles.go b/internal/relay/handles.go new file mode 100644 index 0000000..89cf34c --- /dev/null +++ b/internal/relay/handles.go @@ -0,0 +1,220 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package relay + +import ( + "crypto/subtle" + "errors" + "fmt" + "net/http" + "strings" + + "github.com/go-chi/chi/v5" + + "github.com/MeshCore-Beacon/beacon-push/internal/push" + "github.com/MeshCore-Beacon/beacon-push/internal/store" +) + +// HandleRequest registers a device with one server. +type HandleRequest struct { + PushID string `json:"pushId"` + Platform string `json:"platform" enums:"ios,android"` + Token string `json:"token"` // APNs device token on iOS, FCM token on Android + APNSEnvironment string `json:"apnsEnvironment,omitempty" enums:"sandbox,production"` // iOS only, required there +} + +// HandleResponse is the device's handle for that server and the secret that lets the app change or delete it. +type HandleResponse struct { + Handle string `json:"handle"` + HandleSecret string `json:"handleSecret"` +} + +// HandleUpdate is the app proving it owns a handle, with the current token (and APNs environment on iOS) on a refresh. +type HandleUpdate struct { + HandleSecret string `json:"handleSecret"` + Token string `json:"token,omitempty"` + APNSEnvironment string `json:"apnsEnvironment,omitempty" enums:"sandbox,production"` +} + +// validToken takes the characters FCM registration tokens are made of, so a mangled token is refused up front. +func validToken(t string) bool { + if t == "" || len(t) > 4096 { + return false + } + for i := 0; i < len(t); i++ { + c := t[i] + switch { + case c >= 'a' && c <= 'z', c >= 'A' && c <= 'Z', c >= '0' && c <= '9', c == '_', c == '-', c == ':': + default: + return false + } + } + return true +} + +// validAPNsToken takes an APNs device token: hex, a whole number of bytes, 32 to 100 of them. +func validAPNsToken(t string) bool { + if len(t) < 64 || len(t) > 200 || len(t)%2 != 0 { + return false + } + for i := 0; i < len(t); i++ { + c := t[i] + if (c < '0' || c > '9') && (c < 'a' || c > 'f') && (c < 'A' || c > 'F') { + return false + } + } + return true +} + +// checkDevice validates a token and APNs environment for the platform, answering 400 when they do not fit. It +// returns the token as stored. +func checkDevice(w http.ResponseWriter, platform, token, env string) (string, bool) { + if platform == push.IOS { + if env != push.Sandbox && env != push.Production { + writeError(w, http.StatusBadRequest, "bad_apns_environment", "apnsEnvironment must be sandbox or production on iOS.") + return "", false + } + if !validAPNsToken(token) { + writeError(w, http.StatusBadRequest, "bad_token", "token is missing or not an APNs device token.") + return "", false + } + return strings.ToLower(token), true + } + if env != "" { + writeError(w, http.StatusBadRequest, "bad_apns_environment", "apnsEnvironment is only for iOS.") + return "", false + } + if !validToken(token) { + writeError(w, http.StatusBadRequest, "bad_token", "token is missing or malformed.") + return "", false + } + return token, true +} + +func (s *Server) createHandle(w http.ResponseWriter, r *http.Request) { + now := s.now() + if ok, wait := s.hour.Allow("handle-create:"+s.clientIP(r), HandleCreatesPerHour, now); !ok { + rateLimited(w, wait) + return + } + var req HandleRequest + if !decode(w, r, &req) { + return + } + if req.Platform != push.IOS && req.Platform != push.Android { + writeError(w, http.StatusBadRequest, "bad_platform", "platform must be ios or android.") + return + } + token, ok := checkDevice(w, req.Platform, req.Token, req.APNSEnvironment) + if !ok { + return + } + inst, err := s.store.Instance(r.Context(), req.PushID) + if errors.Is(err, store.ErrNotFound) { + writeError(w, http.StatusNotFound, "unknown_server", "This server is not registered with the push relay.") + return + } + if err != nil { + s.internal(w, "instance lookup failed", err) + return + } + if inst.Status != store.StatusActive { + writeError(w, http.StatusForbidden, "server_unavailable", "This server cannot send push notifications right now.") + return + } + secret := randomString(32) + handle, err := s.store.UpsertHandle(r.Context(), "h_"+randomString(16), inst.ID, req.Platform, token, req.APNSEnvironment, hash(secret), now) + if err != nil { + s.internal(w, "handle not stored", err) + return + } + s.reviewDeviceCount(r, inst) + writeJSON(w, http.StatusOK, HandleResponse{Handle: handle, HandleSecret: secret}) +} + +// reviewDeviceCount tells the admin, once, when an email-tier server passes the device count worth a look. +func (s *Server) reviewDeviceCount(r *http.Request, inst store.Instance) { + if TierFor(inst).Name != "email" { + return + } + if _, done := s.reviewed.Load(inst.ID); done { + return + } + n, err := s.store.CountHandles(r.Context(), inst.ID) + if err != nil || n < HandleReviewThreshold { + return + } + if _, done := s.reviewed.LoadOrStore(inst.ID, struct{}{}); done { + return + } + go s.notifyAdmin(r.Context(), "Push server worth a review: "+inst.ID, + fmt.Sprintf("Server %s (%s, %s) is on the email tier and now has %d devices. Nothing was refused.\n"+ + "Check it with: beacon-push admin show %s\n", inst.ID, inst.Name, inst.Email, n, inst.ID)) +} + +// ownedHandle loads the handle in the path and checks the secret. Unknown handles and wrong secrets get the same +// answer. +func (s *Server) ownedHandle(w http.ResponseWriter, r *http.Request, secret string) (store.Handle, bool) { + h, err := s.store.Handle(r.Context(), chi.URLParam(r, "handle")) + if err != nil && !errors.Is(err, store.ErrNotFound) { + s.internal(w, "handle lookup failed", err) + return store.Handle{}, false + } + if err != nil || h.RevokedAt != 0 || secret == "" || subtle.ConstantTimeCompare(hash(secret), h.SecretHash) != 1 { + writeError(w, http.StatusNotFound, "unknown_handle", "No such handle, or the handle secret is wrong.") + return store.Handle{}, false + } + return h, true +} + +func (s *Server) refreshHandle(w http.ResponseWriter, r *http.Request) { + now := s.now() + if ok, wait := s.hour.Allow("handle-update:"+s.clientIP(r), HandleUpdatesPerHour, now); !ok { + rateLimited(w, wait) + return + } + var req HandleUpdate + if !decode(w, r, &req) { + return + } + h, ok := s.ownedHandle(w, r, req.HandleSecret) + if !ok { + return + } + // The handle's platform decides what a valid token is, so ownership is checked first. + token, ok := checkDevice(w, h.Platform, req.Token, req.APNSEnvironment) + if !ok { + return + } + if err := s.store.RefreshHandleToken(r.Context(), h.Handle, h.InstanceID, token, req.APNSEnvironment, now); err != nil { + if errors.Is(err, store.ErrNotFound) { + writeError(w, http.StatusNotFound, "unknown_handle", "No such handle, or the handle secret is wrong.") + return + } + s.internal(w, "handle not refreshed", err) + return + } + w.WriteHeader(http.StatusNoContent) +} + +func (s *Server) deleteHandle(w http.ResponseWriter, r *http.Request) { + now := s.now() + if ok, wait := s.hour.Allow("handle-update:"+s.clientIP(r), HandleUpdatesPerHour, now); !ok { + rateLimited(w, wait) + return + } + var req HandleUpdate + if !decode(w, r, &req) { + return + } + h, ok := s.ownedHandle(w, r, req.HandleSecret) + if !ok { + return + } + if err := s.store.RevokeHandle(r.Context(), h.Handle, now); err != nil && !errors.Is(err, store.ErrNotFound) { + s.internal(w, "handle not revoked", err) + return + } + w.WriteHeader(http.StatusNoContent) +} diff --git a/internal/relay/maintenance.go b/internal/relay/maintenance.go new file mode 100644 index 0000000..ed44e03 --- /dev/null +++ b/internal/relay/maintenance.go @@ -0,0 +1,45 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package relay + +import ( + "context" + "time" +) + +// MaintenanceEvery is how often retention cleanup and due domain checks run. +const MaintenanceEvery = time.Hour + +// RunMaintenance cleans up expired data and re-checks domains once now and then every hour, until ctx ends. +func (s *Server) RunMaintenance(ctx context.Context) { + t := time.NewTicker(MaintenanceEvery) + defer t.Stop() + for { + s.Maintain(ctx) + select { + case <-ctx.Done(): + return + case <-t.C: + } + } +} + +// Maintain runs one round: retention cleanup, then the domain checks that are due. +func (s *Server) Maintain(ctx context.Context) { + now := s.now() + if err := s.store.Cleanup(ctx, now); err != nil { + s.log.Error("cleanup failed", "component", "maintenance", "err", err) + } + due, err := s.store.DueForDomainCheck(ctx, now.Add(-DomainRecheck)) + if err != nil { + s.log.Error("domain check list failed", "component", "maintenance", "err", err) + return + } + for _, inst := range due { + if ctx.Err() != nil { + return + } + s.checkDomainOnce(ctx, inst) + } +} diff --git a/internal/relay/manage.go b/internal/relay/manage.go new file mode 100644 index 0000000..b0e25f0 --- /dev/null +++ b/internal/relay/manage.go @@ -0,0 +1,286 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package relay + +import ( + "context" + "errors" + "net/http" + "strings" + + "github.com/MeshCore-Beacon/beacon-push/internal/store" +) + +// The manage pages let an operator who lost a Push secret, or wants a slot back, act on their servers through an +// emailed link. The link opens a short session; each action uses it up and the list page hands out a fresh one. + +const ( + purposeManage = "manage" + purposeManageSession = "manage-session" +) + +// managedServer is one row on the manage list. +type managedServer struct { + PushID, Name, URL, Status, Tier string + // Usage, already formatted with thousands separators. + Devices, SentToday, PerMinute, PerDay string + WeekSent, WeekRateLimited, WeekInvalid string + // For the meter. + TodayN, PerDayN int + NearLimit bool +} + +// usageWindow is how many days, today included, the usage line on the manage list covers. +const usageWindow = 7 + +// managed builds a list row with the server's usage. Today's count is the one the daily quota checks. +func (s *Server) managed(ctx context.Context, i store.Instance) (managedServer, error) { + now := s.now() + devices, err := s.store.CountHandles(ctx, i.ID) + if err != nil { + return managedServer{}, err + } + today, err := s.store.SentToday(ctx, i.ID, now) + if err != nil { + return managedServer{}, err + } + days, err := s.store.UsageFor(ctx, i.ID, usageWindow) + if err != nil { + return managedServer{}, err + } + from := store.Day(now.AddDate(0, 0, 1-usageWindow)) + var sent, limited, invalid int + for _, d := range days { + if d.Day >= from { + sent, limited, invalid = sent+d.Sent, limited+d.RateLimited, invalid+d.InvalidHandles + } + } + t := TierFor(i) + return managedServer{PushID: i.ID, Name: i.Name, URL: i.URL, Status: i.Status, Tier: t.Name, + Devices: thousands(devices), SentToday: thousands(today), PerMinute: thousands(t.PerMinute), PerDay: thousands(t.PerDay), + WeekSent: thousands(sent), WeekRateLimited: thousands(limited), WeekInvalid: thousands(invalid), + TodayN: today, PerDayN: t.PerDay, NearLimit: today*5 >= t.PerDay*4}, nil +} + +const somethingWrong = "Something went wrong. Try again later." + +func (s *Server) manage(w http.ResponseWriter, r *http.Request) { + r.Body = http.MaxBytesReader(w, r.Body, 4<<10) + if err := r.ParseForm(); err != nil { + s.render(w, http.StatusBadRequest, "manage", pageData{Error: "The form could not be read."}) + return + } + raw := r.PostForm.Get("email") + if r.PostForm.Get("website") != "" { + s.render(w, http.StatusOK, "manage-sent", pageData{Email: raw}) + return + } + email, ok := cleanEmail(raw) + if !ok { + s.render(w, http.StatusBadRequest, "manage", pageData{Error: "Enter one email address, like you@example.org.", Form: registerForm{Email: raw}}) + return + } + now := s.now() + if ok, _ := s.hour.Allow("manage:"+s.clientIP(r), ManagePerHourPerIP, now); !ok { + s.render(w, http.StatusTooManyRequests, "manage", pageData{Error: "Too many requests from your address. Try again in an hour.", Form: registerForm{Email: raw}}) + return + } + + // From here on the page always says the same thing, so it cannot tell anyone which addresses hold servers. + sent := func() { s.render(w, http.StatusOK, "manage-sent", pageData{Email: email}) } + if ok, _ := s.hour.Allow("link:"+email, LinkMailsPerHour, now); !ok { + sent() + return + } + ctx := r.Context() + list, err := s.manageable(ctx, email) + if err != nil { + s.log.Error("manage lookup failed", "component", "web", "err", err) + s.render(w, http.StatusInternalServerError, "manage", pageData{Error: somethingWrong, Form: registerForm{Email: raw}}) + return + } + if len(list) == 0 { + sent() + return + } + token := randomString(32) + if err := s.store.CreateEmailToken(ctx, hash(token), purposeManage, email, "{}", now.Add(ManageLinkLifetime)); err != nil { + s.log.Error("link not stored", "component", "web", "err", err) + s.render(w, http.StatusInternalServerError, "manage", pageData{Error: somethingWrong, Form: registerForm{Email: raw}}) + return + } + link := s.cfg.PublicURL.String() + "/manage/open#token=" + token + s.sendMail(ctx, email, "Manage your Beacon push servers", + "Someone, hopefully you, asked to manage the Beacon push servers registered with this address.\n\n"+ + "Open this link within an hour to get a new Push secret or remove a server:\n\n"+link+"\n\n"+ + "If this wasn't you, ignore this email and nothing changes.\n") + sent() +} + +// manageable lists the servers an email may act on: none while the email is banned, never a banned server. +func (s *Server) manageable(ctx context.Context, email string) ([]store.Instance, error) { + banned, err := s.store.EmailBanned(ctx, EmailHash(email)) + if err != nil || banned { + return nil, err + } + all, err := s.store.InstancesByEmail(ctx, email) + if err != nil { + return nil, err + } + var out []store.Instance + for _, i := range all { + if i.Status != store.StatusBanned { + out = append(out, i) + } + } + return out, nil +} + +func (s *Server) manageOpen(w http.ResponseWriter, r *http.Request) { + r.Body = http.MaxBytesReader(w, r.Body, 4<<10) + if err := r.ParseForm(); err != nil { + s.render(w, http.StatusBadRequest, "manage-open", pageData{Error: "The form could not be read."}) + return + } + now := s.now() + if ok, _ := s.hour.Allow("verify:"+s.clientIP(r), VerifyPerHourPerIP, now); !ok { + s.render(w, http.StatusTooManyRequests, "manage-open", pageData{Error: "Too many attempts from your address. Try again in an hour."}) + return + } + token := strings.TrimSpace(r.PostForm.Get("token")) + if token == "" { + token = strings.TrimSpace(strings.TrimPrefix(r.PostForm.Get("token_manual"), "token=")) + } + email, _, err := s.store.ConsumeEmailToken(r.Context(), hash(token), purposeManage, now) + if errors.Is(err, store.ErrNotFound) { + s.render(w, http.StatusBadRequest, "manage-open", pageData{Error: "This link has expired or was already used. Ask for a new one."}) + return + } + if err != nil { + s.log.Error("link not consumed", "component", "web", "err", err) + s.render(w, http.StatusInternalServerError, "manage-open", pageData{Error: somethingWrong}) + return + } + s.renderList(w, r, email, "") +} + +// renderList shows the email's servers with a fresh session for the next action. +func (s *Server) renderList(w http.ResponseWriter, r *http.Request, email, notice string) { + ctx := r.Context() + list, err := s.manageable(ctx, email) + if err != nil { + s.log.Error("manage lookup failed", "component", "web", "err", err) + s.render(w, http.StatusInternalServerError, "manage-list", pageData{Error: somethingWrong}) + return + } + data := pageData{Notice: notice, Email: email} + if len(list) > 0 { + session := randomString(32) + if err := s.store.CreateEmailToken(ctx, hash(session), purposeManageSession, email, "{}", s.now().Add(ManageSessionLifetime)); err != nil { + s.log.Error("session not stored", "component", "web", "err", err) + s.render(w, http.StatusInternalServerError, "manage-list", pageData{Error: somethingWrong}) + return + } + data.Session = session + } + for _, i := range list { + row, err := s.managed(ctx, i) + if err != nil { + s.log.Error("usage lookup failed", "component", "web", "push_id", i.ID, "err", err) + s.render(w, http.StatusInternalServerError, "manage-list", pageData{Error: somethingWrong}) + return + } + data.Servers = append(data.Servers, row) + } + s.render(w, http.StatusOK, "manage-list", data) +} + +// manageTarget uses up the session in the form and returns the server it names, locked against sends. It renders +// the error itself and returns ok false when the session or server is not good. +func (s *Server) manageTarget(w http.ResponseWriter, r *http.Request) (inst store.Instance, unlock func(), ok bool) { + r.Body = http.MaxBytesReader(w, r.Body, 4<<10) + if err := r.ParseForm(); err != nil { + s.render(w, http.StatusBadRequest, "manage-list", pageData{Error: "The form could not be read."}) + return inst, nil, false + } + ctx := r.Context() + email, _, err := s.store.ConsumeEmailToken(ctx, hash(r.PostForm.Get("session")), purposeManageSession, s.now()) + if errors.Is(err, store.ErrNotFound) { + s.render(w, http.StatusBadRequest, "manage-list", pageData{Error: "This page has expired or was already used. Ask for a new link."}) + return inst, nil, false + } + if err != nil { + s.log.Error("session not consumed", "component", "web", "err", err) + s.render(w, http.StatusInternalServerError, "manage-list", pageData{Error: somethingWrong}) + return inst, nil, false + } + refuse := func() { + s.render(w, http.StatusForbidden, "manage-list", pageData{Error: "This server cannot be managed from here."}) + } + banned, err := s.store.EmailBanned(ctx, EmailHash(email)) + if err != nil || banned { + refuse() + return inst, nil, false + } + // Check the server before locking, so the lock map only ever holds real push IDs. + inst, err = s.store.Instance(ctx, r.PostForm.Get("push_id")) + if err != nil || inst.Email != email || inst.Status == store.StatusBanned { + refuse() + return inst, nil, false + } + unlock, err = s.lockInstance(ctx, inst.ID) + if err != nil { + s.render(w, http.StatusServiceUnavailable, "manage-list", pageData{Error: somethingWrong}) + return inst, nil, false + } + return inst, unlock, true +} + +func (s *Server) manageSecret(w http.ResponseWriter, r *http.Request) { + inst, unlock, ok := s.manageTarget(w, r) + if !ok { + return + } + defer unlock() + ctx := r.Context() + secret := randomString(32) + if err := s.store.SetSecret(ctx, inst.ID, hash(secret)); err != nil { + s.log.Error("secret not changed", "component", "web", "push_id", inst.ID, "err", err) + s.render(w, http.StatusInternalServerError, "manage-list", pageData{Error: somethingWrong}) + return + } + s.log.Info("push secret changed", "component", "web", "push_id", inst.ID) + s.sendMail(ctx, inst.Email, "Your Beacon Push secret was changed", + "The Push secret for the Beacon server \""+inst.Name+"\" ("+inst.ID+") was changed from the manage page.\n"+ + "The old secret no longer works.\n\n"+ + "If this wasn't you, write to abuse@meshcorebeacon.ca.\n") + go s.notifyAdmin(ctx, "Push secret changed: "+inst.Name, "Push ID: "+inst.ID+"\nEmail: "+inst.Email+"\n") + s.render(w, http.StatusOK, "verified", pageData{Reset: true, + Result: ®istered{PushID: inst.ID, Secret: secret, Name: inst.Name, URL: inst.URL}}) +} + +func (s *Server) manageRemove(w http.ResponseWriter, r *http.Request) { + inst, unlock, ok := s.manageTarget(w, r) + if !ok { + return + } + defer unlock() + ctx := r.Context() + if r.PostForm.Get("confirm") != "on" { + s.renderList(w, r, inst.Email, "Tick the box to confirm removing "+inst.Name+".") + return + } + if err := s.store.DeleteInstance(ctx, inst.ID); err != nil { + s.log.Error("server not removed", "component", "web", "push_id", inst.ID, "err", err) + s.render(w, http.StatusInternalServerError, "manage-list", pageData{Error: somethingWrong}) + return + } + s.log.Info("server removed", "component", "web", "push_id", inst.ID) + s.sendMail(ctx, inst.Email, "Your Beacon push server was removed", + "The Beacon server \""+inst.Name+"\" ("+inst.ID+") was removed from the push relay from the manage page.\n"+ + "Its devices no longer get notifications through it.\n\n"+ + "If this wasn't you, write to abuse@meshcorebeacon.ca.\n") + go s.notifyAdmin(ctx, "Push server removed: "+inst.Name, "Push ID: "+inst.ID+"\nEmail: "+inst.Email+"\n") + s.renderList(w, r, inst.Email, inst.Name+" was removed.") +} diff --git a/internal/relay/manage_test.go b/internal/relay/manage_test.go new file mode 100644 index 0000000..72e1f8b --- /dev/null +++ b/internal/relay/manage_test.go @@ -0,0 +1,179 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package relay + +import ( + "context" + "net/url" + "regexp" + "strings" + "testing" + "time" + + "github.com/MeshCore-Beacon/beacon-push/internal/store" +) + +var ( + manageLinkRe = regexp.MustCompile(`/manage/open#token=([A-Za-z0-9_-]+)`) + sessionRe = regexp.MustCompile(`name="session" value="([A-Za-z0-9_-]+)"`) +) + +// manageLink asks for a manage link and returns its token, or "" when no mail went out. +func (h *harness) manageLink(email string) string { + h.t.Helper() + before := len(h.mail.Messages()) + if code, body := h.form("/manage", h.nextIP(), url.Values{"email": {email}}); code != 200 || !strings.Contains(body, "Check your email") { + h.t.Fatalf("manage %d: %s", code, body) + } + msgs := h.mail.Messages() + if len(msgs) == before { + return "" + } + m := manageLinkRe.FindStringSubmatch(msgs[len(msgs)-1].Text) + if m == nil { + h.t.Fatalf("no link in %q", msgs[len(msgs)-1].Text) + } + return m[1] +} + +// openManage follows a manage link and returns the list page and its session. +func (h *harness) openManage(email string) (string, string) { + h.t.Helper() + token := h.manageLink(email) + if token == "" { + h.t.Fatal("no manage mail") + } + code, body := h.form("/manage/open", h.nextIP(), url.Values{"token": {token}}) + m := sessionRe.FindStringSubmatch(body) + if code != 200 || m == nil { + h.t.Fatalf("open %d: %s", code, body) + } + return body, m[1] +} + +func TestManageNewSecret(t *testing.T) { + h := newHarness(t) + id, oldAuth := h.register("A", "a@example.org", "") + dev := h.handle(id, "tok") + h.send(oldAuth, SendItem{Handle: dev.Handle, Ciphertext: ct}) + list, session := h.openManage("A@example.org") + if !strings.Contains(list, id) { + t.Fatalf("server not listed: %s", list) + } + for _, want := range []string{"1 sent today of 500", ``, + "Up to 30 a minute on the email tier", "
Phones
1
", "
Sent in 7 days
1
"} { + if !strings.Contains(list, want) { + t.Errorf("usage %q missing", want) + } + } + code, body := h.form("/manage/secret", h.nextIP(), url.Values{"session": {session}, "push_id": {id}}) + secret := secretRe.FindStringSubmatch(body) + if code != 200 || secret == nil || !strings.Contains(body, "New secret for A") { + t.Fatalf("secret %d: %s", code, body) + } + if resp := h.api("POST", "/v1/hello", oldAuth, nil, nil); resp.StatusCode != 401 { + t.Fatalf("old secret still works: %d", resp.StatusCode) + } + newAuth := id + "." + secret[1] + if res, resp := h.send(newAuth, SendItem{Handle: dev.Handle, Ciphertext: ct}); resp.StatusCode != 200 || res[0].Status != StatusOK { + t.Fatalf("new secret send: %d %+v", resp.StatusCode, res) + } + noticed := false + for _, m := range h.mail.Messages() { + noticed = noticed || (m.To == "a@example.org" && strings.Contains(m.Subject, "secret was changed")) + } + if !noticed { + t.Fatal("no change notice mailed") + } + // The session is used up. + if code, _ := h.form("/manage/secret", h.nextIP(), url.Values{"session": {session}, "push_id": {id}}); code != 400 { + t.Fatalf("session reused: %d", code) + } +} + +func TestManageRemoveFreesTheSlot(t *testing.T) { + h := newHarness(t) + one, _ := h.register("One", "op@example.org", "") + h.register("Two", "op@example.org", "") + _, session := h.openManage("op@example.org") + + // Without the box ticked nothing goes, and a fresh session comes back. + code, body := h.form("/manage/remove", h.nextIP(), url.Values{"session": {session}, "push_id": {one}}) + m := sessionRe.FindStringSubmatch(body) + if code != 200 || m == nil || !strings.Contains(body, "Tick the box") { + t.Fatalf("unconfirmed remove %d: %s", code, body) + } + code, body = h.form("/manage/remove", h.nextIP(), url.Values{"session": {m[1]}, "push_id": {one}, "confirm": {"on"}}) + if code != 200 || !strings.Contains(body, "One was removed") || strings.Contains(body, one) { + t.Fatalf("remove %d: %s", code, body) + } + if _, err := h.store.Instance(context.Background(), one); err != store.ErrNotFound { + t.Fatalf("still there: %v", err) + } + h.register("Three", "op@example.org", "") +} + +func TestManageRefusals(t *testing.T) { + h := newHarness(t) + ctx := context.Background() + idA, _ := h.register("A", "a@example.org", "") + idB, _ := h.register("B", "b@example.org", "") + + // Unknown addresses get the same page and no mail. + if h.manageLink("nobody@example.org") != "" { + t.Fatal("mail sent to an address with no servers") + } + // The honeypot sends nothing. + before := len(h.mail.Messages()) + if code, _ := h.form("/manage", h.nextIP(), url.Values{"email": {"a@example.org"}, "website": {"x"}}); code != 200 || len(h.mail.Messages()) != before { + t.Fatal("honeypot sent mail") + } + + // A's session cannot touch B's server. + _, session := h.openManage("a@example.org") + if code, _ := h.form("/manage/secret", h.nextIP(), url.Values{"session": {session}, "push_id": {idB}}); code != 403 { + t.Fatalf("cross-account secret: %d", code) + } + + // Sessions expire. + _, session = h.openManage("a@example.org") + h.clock.add(ManageSessionLifetime + time.Second) + if code, _ := h.form("/manage/secret", h.nextIP(), url.Values{"session": {session}, "push_id": {idA}}); code != 400 { + t.Fatalf("expired session: %d", code) + } + + // Links are single use and expire. + token := h.manageLink("a@example.org") + h.form("/manage/open", h.nextIP(), url.Values{"token": {token}}) + if code, _ := h.form("/manage/open", h.nextIP(), url.Values{"token": {token}}); code != 400 { + t.Fatalf("link reused: %d", code) + } + token = h.manageLink("a@example.org") + h.clock.add(ManageLinkLifetime + time.Second) + if code, _ := h.form("/manage/open", h.nextIP(), url.Values{"token_manual": {"token=" + token}}); code != 400 { + t.Fatalf("late link: %d", code) + } + + // A banned server's email gets nothing, and an open session stops working. + _, session = h.openManage("b@example.org") + if err := h.store.SetStatus(ctx, idB, store.StatusBanned, EmailHash("b@example.org"), h.clock.now()); err != nil { + t.Fatal(err) + } + if code, _ := h.form("/manage/remove", h.nextIP(), url.Values{"session": {session}, "push_id": {idB}, "confirm": {"on"}}); code != 403 { + t.Fatalf("banned remove: %d", code) + } + if h.manageLink("b@example.org") != "" { + t.Fatal("banned email got a link") + } +} + +func TestManageRateLimit(t *testing.T) { + h := newHarness(t) + for i := 0; i < ManagePerHourPerIP; i++ { + h.form("/manage", "198.51.100.9", url.Values{"email": {"x@example.org"}}) + } + if code, _ := h.form("/manage", "198.51.100.9", url.Values{"email": {"x@example.org"}}); code != 429 { + t.Fatalf("limit: %d", code) + } +} diff --git a/internal/relay/relay_test.go b/internal/relay/relay_test.go new file mode 100644 index 0000000..981a714 --- /dev/null +++ b/internal/relay/relay_test.go @@ -0,0 +1,693 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package relay + +import ( + "bytes" + "context" + "encoding/base64" + "encoding/json" + "fmt" + "io" + "net/http" + "net/http/httptest" + "net/url" + "path/filepath" + "regexp" + "strings" + "sync" + "sync/atomic" + "testing" + "time" + + "github.com/MeshCore-Beacon/beacon-push/internal/config" + "github.com/MeshCore-Beacon/beacon-push/internal/mail" + "github.com/MeshCore-Beacon/beacon-push/internal/push" + "github.com/MeshCore-Beacon/beacon-push/internal/store" +) + +// fakePush records what would go to a push provider. It can refuse a token, answer an error, wait, or run a hook first. +type fakePush struct { + mu sync.Mutex + sent []push.Message + gone map[string]bool + errs map[string]error + delay time.Duration + hook func(push.Message) error + calls atomic.Int64 +} + +func (f *fakePush) Send(ctx context.Context, m push.Message) error { + f.calls.Add(1) + f.mu.Lock() + gone, err, delay, hook := f.gone[m.Token], f.errs[m.Token], f.delay, f.hook + f.mu.Unlock() + select { + case <-time.After(delay): + case <-ctx.Done(): + return ctx.Err() + } + if hook != nil { + if err := hook(m); err != nil { + return err + } + } + if gone { + return push.ErrUnregistered + } + if err != nil { + return err + } + f.mu.Lock() + f.sent = append(f.sent, m) + f.mu.Unlock() + return nil +} + +func (f *fakePush) set(fn func(f *fakePush)) { + f.mu.Lock() + fn(f) + f.mu.Unlock() +} + +func (f *fakePush) messages() []push.Message { + f.mu.Lock() + defer f.mu.Unlock() + return append([]push.Message(nil), f.sent...) +} + +type clock struct { + mu sync.Mutex + t time.Time +} + +func (c *clock) now() time.Time { c.mu.Lock(); defer c.mu.Unlock(); return c.t } +func (c *clock) add(d time.Duration) { + c.mu.Lock() + c.t = c.t.Add(d) + c.mu.Unlock() +} + +type harness struct { + t *testing.T + srv *httptest.Server + relay *Server + store *store.Store + push *fakePush + mail *mail.Recorder + clock *clock + ip atomic.Int64 +} + +func newHarness(t *testing.T) *harness { + t.Helper() + st, err := store.Open(context.Background(), filepath.Join(t.TempDir(), "relay.db")) + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { st.Close() }) + u, _ := url.Parse("https://push.test") + h := &harness{t: t, store: st, push: &fakePush{gone: map[string]bool{}, errs: map[string]error{}}, mail: &mail.Recorder{}, + clock: &clock{t: time.Date(2026, 11, 17, 12, 0, 0, 0, time.UTC)}} + h.relay = New(Options{Config: config.Config{PublicURL: u, TrustProxy: true, DevMode: true, AdminEmail: "admin@test.example"}, + Store: st, Push: h.push, Mail: h.mail, Now: h.clock.now}) + h.srv = httptest.NewServer(h.relay.Handler()) + t.Cleanup(h.srv.Close) + return h +} + +// nextIP gives each request its own client address, so per-IP limits only bite where a test means them to. +func (h *harness) nextIP() string { + return fmt.Sprintf("203.0.113.%d", h.ip.Add(1)%250+1) +} + +func (h *harness) form(path, ip string, v url.Values) (int, string) { + h.t.Helper() + req, _ := http.NewRequest(http.MethodPost, h.srv.URL+path, strings.NewReader(v.Encode())) + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + req.Header.Set("X-Forwarded-For", ip) + resp, err := http.DefaultClient.Do(req) + if err != nil { + h.t.Fatal(err) + } + defer resp.Body.Close() + b, _ := io.ReadAll(resp.Body) + return resp.StatusCode, string(b) +} + +func (h *harness) api(method, path, auth string, body any, out any) *http.Response { + h.t.Helper() + var r io.Reader + if body != nil { + b, _ := json.Marshal(body) + r = bytes.NewReader(b) + } + req, _ := http.NewRequest(method, h.srv.URL+path, r) + req.Header.Set("Content-Type", "application/json") + req.Header.Set("X-Forwarded-For", h.nextIP()) + if auth != "" { + req.Header.Set("Authorization", "Bearer "+auth) + } + resp, err := http.DefaultClient.Do(req) + if err != nil { + h.t.Fatal(err) + } + defer resp.Body.Close() + if out != nil { + _ = json.NewDecoder(resp.Body).Decode(out) + } + return resp +} + +var ( + linkRe = regexp.MustCompile(`/verify#token=([A-Za-z0-9_-]+)`) + idRe = regexp.MustCompile(`id: (inst_[a-z0-9]+)`) + secretRe = regexp.MustCompile(`BEACON_PUSH_SECRET=([A-Za-z0-9_-]+)`) +) + +func registration(name, email, serverURL string) url.Values { + return url.Values{"name": {name}, "email": {email}, "url": {serverURL}, "terms": {"on"}} +} + +// register runs the whole flow and returns the push ID and "id.secret" credentials. +func (h *harness) register(name, email, serverURL string) (string, string) { + h.t.Helper() + before := len(h.mail.Messages()) + if code, body := h.form("/register", h.nextIP(), registration(name, email, serverURL)); code != 200 || !strings.Contains(body, "Check your email") { + h.t.Fatalf("register %d: %s", code, body) + } + msgs := h.mail.Messages() + if len(msgs) != before+1 { + h.t.Fatalf("expected one mail, have %d", len(msgs)-before) + } + m := linkRe.FindStringSubmatch(msgs[len(msgs)-1].Text) + if m == nil { + h.t.Fatalf("no link in %q", msgs[len(msgs)-1].Text) + } + code, body := h.form("/verify", h.nextIP(), url.Values{"token": {m[1]}}) + id, secret := idRe.FindStringSubmatch(body), secretRe.FindStringSubmatch(body) + if code != 200 || id == nil || secret == nil { + h.t.Fatalf("verify %d: %s", code, body) + } + return id[1], id[1] + "." + secret[1] +} + +func (h *harness) handle(pushID, token string) HandleResponse { + h.t.Helper() + var out HandleResponse + if resp := h.api("POST", "/v1/handles", "", HandleRequest{PushID: pushID, Platform: "android", Token: token}, &out); resp.StatusCode != 200 { + h.t.Fatalf("handle: %d", resp.StatusCode) + } + return out +} + +var ct = base64.StdEncoding.EncodeToString([]byte("nonce-and-ciphertext")) + +func (h *harness) send(auth string, items ...SendItem) ([]SendResult, *http.Response) { + h.t.Helper() + var out struct { + Results []SendResult `json:"results"` + } + resp := h.api("POST", "/v1/send", auth, SendRequest{Messages: items}, &out) + return out.Results, resp +} + +func TestRegisterHelloHandleSend(t *testing.T) { + h := newHarness(t) + id, auth := h.register("Ottawa Mesh", "Op@Example.org", "") + if !strings.HasPrefix(id, "inst_") { + t.Fatalf("push id %q", id) + } + inst, err := h.store.Instance(context.Background(), id) + if err != nil || inst.Email != "op@example.org" || inst.Name != "Ottawa Mesh" || inst.TermsVersion != TermsVersion { + t.Fatalf("%+v %v", inst, err) + } + + var hello HelloResponse + if resp := h.api("POST", "/v1/hello", auth, nil, &hello); resp.StatusCode != 200 { + t.Fatalf("hello %d", resp.StatusCode) + } + if hello.PushID != id || hello.Name != "Ottawa Mesh" || hello.Status != "active" || hello.Tier != "email" || + hello.Limits.PerDay != EmailTierPerDay || hello.DomainVerified || hello.TermsOutdated { + t.Fatalf("%+v", hello) + } + + dev := h.handle(id, "fcm-token-1") + again := h.handle(id, "fcm-token-1") + if dev.Handle == "" || again.Handle != dev.Handle || again.HandleSecret == dev.HandleSecret { + t.Fatalf("the same token must keep its handle with a new secret: %+v %+v", dev, again) + } + + res, _ := h.send(auth, SendItem{Handle: dev.Handle, Ciphertext: ct, CollapseKey: "42", TTLSeconds: 600}) + if len(res) != 1 || res[0].Status != StatusOK || !strings.HasPrefix(res[0].MessageID, "m_") { + t.Fatalf("%+v", res) + } + sent := h.push.messages() + if len(sent) != 1 { + t.Fatalf("%d pushes", len(sent)) + } + m := sent[0] + if m.Token != "fcm-token-1" || m.Data["pushId"] != id || m.Data["serverName"] != "Ottawa Mesh" || m.Data["ct"] != ct || + m.Data["messageId"] != res[0].MessageID || m.CollapseKey != id+":42" || m.TTL != 10*time.Minute || m.AlertTitle != "Ottawa Mesh" { + t.Fatalf("%+v", m) + } + if n, _ := h.store.SentToday(context.Background(), id, h.clock.now()); n != 1 { + t.Fatalf("usage %d", n) + } +} + +func TestAuthFailures(t *testing.T) { + h := newHarness(t) + id, auth := h.register("A", "a@example.org", "") + for name, cred := range map[string]string{"none": "", "no dot": id, "wrong secret": id + ".nope", "unknown id": "inst_zzzzzzzzzz.x"} { + if resp := h.api("POST", "/v1/hello", cred, nil, nil); resp.StatusCode != 401 { + t.Errorf("%s: %d", name, resp.StatusCode) + } + } + if resp := h.api("POST", "/v1/hello", auth, nil, nil); resp.StatusCode != 200 { + t.Fatalf("good credentials: %d", resp.StatusCode) + } +} + +func TestRegistrationRules(t *testing.T) { + h := newHarness(t) + + // The honeypot pretends success and sends nothing. + v := registration("Bot", "bot@example.org", "") + v.Set("website", "spam") + if code, _ := h.form("/register", h.nextIP(), v); code != 200 || len(h.mail.Messages()) != 0 { + t.Fatalf("honeypot: %d, %d mails", code, len(h.mail.Messages())) + } + for name, v := range map[string]url.Values{ + "disposable": registration("X", "x@mailinator.com", ""), + "no terms": {"name": {"X"}, "email": {"x@example.org"}}, + "bad email": registration("X", "x at example", ""), + "long name": registration(strings.Repeat("n", 41), "x@example.org", ""), + "angle name": registration("", "x@example.org", ""), + "bidi name": registration("Ottawa\u202eMesh", "x@example.org", ""), + "zwj name": registration("Otta\u200dwa", "x@example.org", ""), + "http url": registration("X", "x@example.org", "ftp://example.org"), + } { + if code, body := h.form("/register", h.nextIP(), v); code != 400 || !strings.Contains(body, `class="error"`) { + t.Errorf("%s: %d", name, code) + } + } + + // Two servers per email; the third ask gets a mail saying so and creates nothing. + h.register("One", "op@example.org", "") + h.register("Two", "op@example.org", "") + before := len(h.mail.Messages()) + if code, body := h.form("/register", h.nextIP(), registration("Three", "op@example.org", "")); code != 200 || !strings.Contains(body, "Check your email") { + t.Fatalf("third: %d", code) + } + msgs := h.mail.Messages() + if len(msgs) <= before || !strings.Contains(msgs[len(msgs)-1].Text, "already has the most servers") || linkRe.MatchString(msgs[len(msgs)-1].Text) { + t.Fatalf("third registration mail: %+v", msgs[len(msgs)-1]) + } + + // Per-IP limit, which mistakes do not use up. + for i := 0; i < 5; i++ { + h.form("/register", "198.51.100.7", registration("", "l@example.org", "")) + } + for i := 0; i < RegisterPerHourPerIP; i++ { + h.form("/register", "198.51.100.7", registration("L", fmt.Sprintf("l%d@example.org", i), "")) + } + if code, _ := h.form("/register", "198.51.100.7", registration("L", "l9@example.org", "")); code != 429 { + t.Fatalf("per-IP limit: %d", code) + } +} + +func TestVerifyLinkIsSingleUseAndExpires(t *testing.T) { + h := newHarness(t) + h.form("/register", h.nextIP(), registration("A", "a@example.org", "")) + token := linkRe.FindStringSubmatch(h.mail.Messages()[0].Text)[1] + if code, _ := h.form("/verify", h.nextIP(), url.Values{"token": {token}}); code != 200 { + t.Fatalf("first use: %d", code) + } + if code, _ := h.form("/verify", h.nextIP(), url.Values{"token": {token}}); code != 400 { + t.Fatalf("second use: %d", code) + } + h.form("/register", h.nextIP(), registration("B", "b@example.org", "")) + msgs := h.mail.Messages() + late := linkRe.FindStringSubmatch(msgs[len(msgs)-1].Text)[1] + h.clock.add(LinkLifetime + time.Minute) + if code, _ := h.form("/verify", h.nextIP(), url.Values{"token_manual": {"token=" + late}}); code != 400 { + t.Fatalf("expired link: %d", code) + } +} + +func TestHandlesBelongToOneServer(t *testing.T) { + h := newHarness(t) + idA, authA := h.register("A", "a@example.org", "") + _, authB := h.register("B", "b@example.org", "") + dev := h.handle(idA, "tok-a") + + res, _ := h.send(authB, SendItem{Handle: dev.Handle, Ciphertext: ct}, SendItem{Handle: "h_unknown", Ciphertext: ct}) + if res[0].Status != StatusInvalidHandle || res[1].Status != StatusInvalidHandle || len(h.push.messages()) != 0 { + t.Fatalf("another server's handle: %+v", res) + } + if res, _ := h.send(authA, SendItem{Handle: dev.Handle, Ciphertext: ct}); res[0].Status != StatusOK { + t.Fatalf("own handle: %+v", res) + } +} + +func TestHandleRefreshAndDelete(t *testing.T) { + h := newHarness(t) + id, auth := h.register("A", "a@example.org", "") + dev := h.handle(id, "tok-1") + path := "/v1/handles/" + dev.Handle + + if resp := h.api("PUT", path, "", HandleUpdate{HandleSecret: "wrong", Token: "tok-2"}, nil); resp.StatusCode != 404 { + t.Fatalf("wrong secret: %d", resp.StatusCode) + } + if resp := h.api("PUT", path, "", HandleUpdate{HandleSecret: dev.HandleSecret, Token: "tok-2"}, nil); resp.StatusCode != 204 { + t.Fatalf("refresh: %d", resp.StatusCode) + } + h.send(auth, SendItem{Handle: dev.Handle, Ciphertext: ct}) + if sent := h.push.messages(); len(sent) != 1 || sent[0].Token != "tok-2" { + t.Fatalf("refreshed token not used: %+v", sent) + } + if resp := h.api("DELETE", path, "", HandleUpdate{HandleSecret: dev.HandleSecret}, nil); resp.StatusCode != 204 { + t.Fatalf("delete: %d", resp.StatusCode) + } + if res, _ := h.send(auth, SendItem{Handle: dev.Handle, Ciphertext: ct}); res[0].Status != StatusInvalidHandle { + t.Fatalf("deleted handle: %+v", res) + } + // Registering the token again gives a fresh handle. + if again := h.handle(id, "tok-2"); again.Handle == dev.Handle { + t.Fatal("a revoked handle must not come back") + } +} + +func TestUnregisteredTokenRevokesTheHandle(t *testing.T) { + h := newHarness(t) + id, auth := h.register("A", "a@example.org", "") + dev := h.handle(id, "tok-gone") + h.push.set(func(f *fakePush) { f.gone["tok-gone"] = true }) + if res, _ := h.send(auth, SendItem{Handle: dev.Handle, Ciphertext: ct}); res[0].Status != StatusInvalidHandle { + t.Fatalf("%+v", res) + } + if hd, _ := h.store.Handle(context.Background(), dev.Handle); hd.RevokedAt == 0 { + t.Fatal("handle not revoked") + } +} + +func TestBadItems(t *testing.T) { + h := newHarness(t) + id, auth := h.register("A", "a@example.org", "") + dev := h.handle(id, "tok") + big := base64.StdEncoding.EncodeToString(make([]byte, MaxCiphertext+1)) + res, _ := h.send(auth, + SendItem{Handle: dev.Handle, Ciphertext: "not base64!"}, + SendItem{Handle: dev.Handle, Ciphertext: big}, + SendItem{Handle: dev.Handle, Ciphertext: ct, CollapseKey: "has space"}, + SendItem{Handle: dev.Handle, Ciphertext: ct, TTLSeconds: int(MaxTTL/time.Second) + 1}, + SendItem{Handle: dev.Handle, Ciphertext: ""}, + ) + want := []string{StatusInvalid, StatusTooLarge, StatusInvalid, StatusInvalid, StatusInvalid} + for i, w := range want { + if res[i].Status != w { + t.Errorf("item %d: %s, want %s", i, res[i].Status, w) + } + } + if len(h.push.messages()) != 0 { + t.Fatal("a bad item was sent") + } + if _, resp := h.send(auth); resp.StatusCode != 400 { + t.Fatalf("empty batch: %d", resp.StatusCode) + } +} + +func TestRateLimits(t *testing.T) { + h := newHarness(t) + id, auth := h.register("A", "a@example.org", "") + dev := h.handle(id, "tok") + items := make([]SendItem, HandlePerMinute+1) + for i := range items { + items[i] = SendItem{Handle: dev.Handle, Ciphertext: ct} + } + // Items go out concurrently, so which one is refused is not fixed. + res, resp := h.send(auth, items...) + if count(res, StatusOK) != HandlePerMinute || count(res, StatusRateLimited) != 1 || resp.Header.Get("Retry-After") == "" { + t.Fatalf("per-device minute: %+v retry %q", res, resp.Header.Get("Retry-After")) + } + + // A daily quota override stops the server for the rest of the UTC day. + if err := h.store.SetQuota(context.Background(), id, 0, HandlePerMinute+2); err != nil { + t.Fatal(err) + } + h.clock.add(time.Minute) + other := h.handle(id, "tok-2") + res, _ = h.send(auth, SendItem{Handle: other.Handle, Ciphertext: ct}, SendItem{Handle: other.Handle, Ciphertext: ct}, + SendItem{Handle: other.Handle, Ciphertext: ct}) + if count(res, StatusOK) != 2 || count(res, StatusRateLimited) != 1 { + t.Fatalf("daily quota: %+v", res) + } + var hello HelloResponse + h.api("POST", "/v1/hello", auth, nil, &hello) + if hello.Tier != "custom" || hello.Limits.PerDay != HandlePerMinute+2 || hello.Limits.PerMinute != EmailTierPerMinute { + t.Fatalf("%+v", hello) + } + h.clock.add(24 * time.Hour) + if res, _ := h.send(auth, SendItem{Handle: other.Handle, Ciphertext: ct}); res[0].Status != StatusOK { + t.Fatalf("next day: %+v", res) + } +} + +func TestSuspendAndBan(t *testing.T) { + h := newHarness(t) + ctx := context.Background() + id, auth := h.register("A", "a@example.org", "") + dev := h.handle(id, "tok") + if err := h.store.SetStatus(ctx, id, store.StatusSuspended, nil, h.clock.now()); err != nil { + t.Fatal(err) + } + var hello HelloResponse + if resp := h.api("POST", "/v1/hello", auth, nil, &hello); resp.StatusCode != 200 || hello.Status != "suspended" { + t.Fatalf("suspended hello: %d %+v", resp.StatusCode, hello) + } + if _, resp := h.send(auth, SendItem{Handle: dev.Handle, Ciphertext: ct}); resp.StatusCode != 403 { + t.Fatalf("suspended send: %d", resp.StatusCode) + } + if resp := h.api("POST", "/v1/handles", "", HandleRequest{PushID: id, Platform: "android", Token: "t2"}, nil); resp.StatusCode != 403 { + t.Fatalf("suspended handle: %d", resp.StatusCode) + } + + if err := h.store.SetStatus(ctx, id, store.StatusBanned, EmailHash("A@example.org"), h.clock.now()); err != nil { + t.Fatal(err) + } + if resp := h.api("POST", "/v1/hello", auth, nil, nil); resp.StatusCode != 403 { + t.Fatalf("banned hello: %d", resp.StatusCode) + } + before := len(h.mail.Messages()) + if code, body := h.form("/register", h.nextIP(), registration("Again", "a@example.org", "")); code != 200 || !strings.Contains(body, "Check your email") { + t.Fatalf("banned email register: %d", code) + } + if len(h.mail.Messages()) != before { + t.Fatal("a banned email must get no link") + } +} + +func TestHarvestingSuspends(t *testing.T) { + h := newHarness(t) + victimID, _ := h.register("Victim", "v@example.org", "") + id, auth := h.register("A", "a@example.org", "") + + // Handles that do not exist are only refused: they may have been purged, and they reach nobody. + unknown := make([]SendItem, MaxBatch) + for i := range unknown { + unknown[i] = SendItem{Handle: fmt.Sprintf("h_gone%d", i), Ciphertext: ct} + } + if res, resp := h.send(auth, unknown...); resp.StatusCode != 200 || res[0].Status != StatusInvalidHandle { + t.Fatalf("unknown handles: %d %+v", resp.StatusCode, res) + } + if inst, _ := h.store.Instance(context.Background(), id); inst.Status != store.StatusActive { + t.Fatalf("suspended for unknown handles: %s", inst.Status) + } + + // Another server's live handles are harvesting. + h.clock.add(time.Hour) + items := make([]SendItem, MaxBatch) + for i := range items { + items[i] = SendItem{Handle: h.handle(victimID, fmt.Sprintf("victim-tok-%d", i)).Handle, Ciphertext: ct} + } + if _, resp := h.send(auth, items...); resp.StatusCode != 403 { + t.Fatalf("harvesting batch: %d", resp.StatusCode) + } + if inst, _ := h.store.Instance(context.Background(), id); inst.Status != store.StatusSuspended { + t.Fatalf("status %s", inst.Status) + } +} + +// beaconServer answers the domain check the way beacon-server will. +func beaconServer(t *testing.T, pushID string, secretHash []byte, tamper bool) *httptest.Server { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path != ChallengePath { + http.NotFound(w, r) + return + } + mac := ChallengeMAC(secretHash, pushID, r.URL.Query().Get("challenge")) + if tamper { + mac = ChallengeMAC(secretHash, pushID, "something else") + } + _ = json.NewEncoder(w).Encode(map[string]string{"pushId": pushID, "mac": mac}) + })) + t.Cleanup(srv.Close) + return srv +} + +func TestDomainCheck(t *testing.T) { + h := newHarness(t) + ctx := context.Background() + // Register with a placeholder URL, then point it at a local server that knows the secret. + id, auth := h.register("A", "a@example.org", "https://beacon.example.org") + secret := strings.SplitN(auth, ".", 2)[1] + good := beaconServer(t, id, hash(secret), false) + if _, err := h.store.Instance(ctx, id); err != nil { + t.Fatal(err) + } + setURL := func(u string) { + t.Helper() + if _, err := h.store.DB().ExecContext(ctx, `UPDATE instances SET url = ? WHERE id = ?`, u, id); err != nil { + t.Fatal(err) + } + } + setURL(good.URL) + + var out map[string]any + h.api("POST", "/v1/verify-domain", auth, nil, &out) + if out["domainVerified"] != true { + t.Fatalf("good answer: %+v", out) + } + var hello HelloResponse + h.api("POST", "/v1/hello", auth, nil, &hello) + if !hello.DomainVerified || hello.Tier != "verified" || hello.Limits.PerDay != VerifiedTierPerDay { + t.Fatalf("%+v", hello) + } + + bad := beaconServer(t, id, hash(secret), true) + setURL(bad.URL) + h.api("POST", "/v1/verify-domain", auth, nil, &out) + if out["domainVerified"] != false || !strings.Contains(fmt.Sprint(out["reason"]), "does not match") { + t.Fatalf("tampered answer: %+v", out) + } + if inst, _ := h.store.Instance(ctx, id); inst.DomainVerifiedAt != 0 { + t.Fatal("a failed check must clear the verification") + } +} + +func TestChallengeClientRefusesPrivateAddresses(t *testing.T) { + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte("{}")) })) + defer srv.Close() + if _, err := challengeClient(false).Get(srv.URL); err == nil { + t.Fatal("the production client reached a loopback address") + } + if resp, err := challengeClient(true).Get(srv.URL); err != nil { + t.Fatalf("dev client: %v", err) + } else { + resp.Body.Close() + } +} + +func TestPages(t *testing.T) { + h := newHarness(t) + for _, p := range []string{"/", "/register", "/verify", "/manage", "/manage/open", "/terms", "/privacy", "/static/site.css", "/static/verify.js", "/static/copy.js", + "/static/favicon.svg", "/static/fonts/inter-latin-400-normal.woff2", "/favicon.ico", "/healthz"} { + resp, err := http.Get(h.srv.URL + p) + if err != nil { + t.Fatal(err) + } + resp.Body.Close() + if resp.StatusCode != 200 { + t.Errorf("%s: %d", p, resp.StatusCode) + } + if !strings.Contains(resp.Header.Get("Content-Security-Policy"), "default-src 'none'") { + t.Errorf("%s: no CSP", p) + } + } +} + +func TestConcurrentBatchesKeepTheDailyQuota(t *testing.T) { + h := newHarness(t) + id, auth := h.register("A", "a@example.org", "") + if err := h.store.SetQuota(context.Background(), id, 1000, 5); err != nil { + t.Fatal(err) + } + devs := make([]HandleResponse, 8) + for i := range devs { + devs[i] = h.handle(id, fmt.Sprintf("tok-%d", i)) + } + var wg sync.WaitGroup + for _, d := range devs { + wg.Add(1) + go func(handle string) { + defer wg.Done() + h.send(auth, SendItem{Handle: handle, Ciphertext: ct}, SendItem{Handle: handle, Ciphertext: ct}) + }(d.Handle) + } + wg.Wait() + if n := len(h.push.messages()); n != 5 { + t.Fatalf("sent %d, the daily quota is 5", n) + } +} + +func TestClientIPTakesTheProxysEntry(t *testing.T) { + s := New(Options{Config: config.Config{TrustProxy: true}}) + r := httptest.NewRequest("GET", "/", nil) + r.RemoteAddr = "10.0.0.2:4000" + r.Header.Add("X-Forwarded-For", "1.1.1.1") + r.Header.Add("X-Forwarded-For", "9.9.9.9, 203.0.113.5") + if ip := s.clientIP(r); ip != "203.0.113.5" { + t.Fatalf("%s", ip) + } + s = New(Options{Config: config.Config{}}) + if ip := s.clientIP(r); ip != "10.0.0.2" { + t.Fatalf("without TrustProxy: %s", ip) + } +} + +func TestPagesShowTierLimits(t *testing.T) { + h := newHarness(t) + m, d, vm, vd := thousands(EmailTierPerMinute), thousands(EmailTierPerDay), thousands(VerifiedTierPerMinute), thousands(VerifiedTierPerDay) + verified := fmt.Sprintf("Raises your limits from %s to %s a minute and %s to %s a day", m, vm, d, vd) + resp, err := http.Get(h.srv.URL + "/register") + if err != nil { + t.Fatal(err) + } + body, _ := io.ReadAll(resp.Body) + resp.Body.Close() + if page := strings.Join(strings.Fields(string(body)), " "); !strings.Contains(page, verified) { + t.Errorf("register page has no tier limits:\n%s", page) + } + + verifiedPage := func(email, serverURL string) string { + t.Helper() + h.form("/register", h.nextIP(), registration("A", email, serverURL)) + msgs := h.mail.Messages() + m := linkRe.FindStringSubmatch(msgs[len(msgs)-1].Text) + code, body := h.form("/verify", h.nextIP(), url.Values{"token": {m[1]}}) + if code != 200 { + t.Fatalf("verify %d", code) + } + return strings.Join(strings.Fields(body), " ") + } + page := verifiedPage("u@example.org", "https://beacon.example.org") + withURL := fmt.Sprintf("%s a minute and %s a day until the daily check passes, then %s and %s.", m, d, vm, vd) + for _, want := range []string{withURL, "route /.well-known/beacon-push to beacon-server"} { + if !strings.Contains(page, want) { + t.Errorf("verified page with a URL lacks %q:\n%s", want, page) + } + } + page = verifiedPage("n@example.org", "") + noURL := fmt.Sprintf("%s a minute and %s a day. Register with a public URL for %s and %s.", m, d, vm, vd) + if !strings.Contains(page, noURL) { + t.Errorf("verified page without a URL lacks %q:\n%s", noURL, page) + } + if strings.Contains(page, ".well-known") { + t.Error("verified page without a URL talks about the check path") + } + if thousands(10000) != "10,000" || thousands(500) != "500" || thousands(1234567) != "1,234,567" { + t.Error("thousands") + } +} diff --git a/internal/relay/send_test.go b/internal/relay/send_test.go new file mode 100644 index 0000000..3ffc0ab --- /dev/null +++ b/internal/relay/send_test.go @@ -0,0 +1,872 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package relay + +import ( + "bytes" + "context" + "encoding/base64" + "encoding/json" + "fmt" + "net/http" + "strings" + "sync" + "testing" + "time" + + "github.com/MeshCore-Beacon/beacon-push/internal/push" + "github.com/MeshCore-Beacon/beacon-push/internal/store" +) + +func TestValidTokenTakesOnlyFCMCharacters(t *testing.T) { + good := "dXk3Hn_Q-1E:APA91bF" + strings.Repeat("a1B2_-", 20) + if !validToken(good) { + t.Fatalf("real-looking token refused") + } + for _, bad := range []string{"", "tok!", "tok +{{template "foot"}} diff --git a/internal/relay/templates/manage-sent.html b/internal/relay/templates/manage-sent.html new file mode 100644 index 0000000..d0c976c --- /dev/null +++ b/internal/relay/templates/manage-sent.html @@ -0,0 +1,5 @@ +{{template "head" "Check your email"}} +

Check your email

+

If {{.Email}} has servers registered, a link is on its way. It works for one hour.

+

Not there? Check spam.

+{{template "foot"}} diff --git a/internal/relay/templates/manage.html b/internal/relay/templates/manage.html new file mode 100644 index 0000000..7638928 --- /dev/null +++ b/internal/relay/templates/manage.html @@ -0,0 +1,18 @@ +{{template "head" "Manage your servers"}} +

Manage your servers

+

Lost a Push secret, or need a slot back? We'll email a link to the address you registered with.

+{{template "error" .Error}} +
+
+ + +
+ + + + +
+{{template "foot"}} diff --git a/internal/relay/templates/privacy.html b/internal/relay/templates/privacy.html new file mode 100644 index 0000000..030fe71 --- /dev/null +++ b/internal/relay/templates/privacy.html @@ -0,0 +1,18 @@ +{{template "head" "Privacy"}} +

Privacy notice

+

Server operators

+

When you register a server we keep its name, your email address, the public URL if you gave one, the address you +registered from, and when you accepted the terms. Your Push secret is stored only as a one-way hash. We use your +email to confirm the registration and to contact you about the server. We do not share it.

+

App users

+

When the Beacon app turns on notifications for a server, it gives the relay its push token (Apple's on iPhone, Google +Firebase's on Android) and gets back a handle that only that server can use. The server never sees the push token.

+

For each notification the relay keeps the sending server, the time, the device handle, the size and a fingerprint +(hash) of the encrypted content, for 30 days. It cannot read the content: that is encrypted between the server and +the app. Daily totals per server are kept for about a year.

+

Notifications to iPhones go through Apple's push service, to Android phones through Google Firebase Cloud +Messaging.

+

Deleting data

+

Removing a server or signing out in the app deletes its handle. Removed handles are erased after 30 days. To have +a registered server deleted, email abuse@meshcorebeacon.ca.

+{{template "foot"}} diff --git a/internal/relay/templates/register.html b/internal/relay/templates/register.html new file mode 100644 index 0000000..b0b461e --- /dev/null +++ b/internal/relay/templates/register.html @@ -0,0 +1,36 @@ +{{template "head" "Register a server"}} +

Register a server

+

We'll email you a link to your Push ID and secret. Up to two servers per email.

+{{template "error" .Error}} +
+
+ + +

Shown on every notification.

+
+ +
+ + +

Only for the link and notices about this server.

+
+ +
+ + +

Raises your limits from {{.Tiers.EmailPerMinute}} to {{.Tiers.VerifiedPerMinute}} a minute and +{{.Tiers.EmailPerDay}} to {{.Tiers.VerifiedPerDay}} a day, once a daily check confirms the server is yours.

+
+ + + + + + +
+

Lost a Push secret? Manage your servers.

+{{template "foot"}} diff --git a/internal/relay/templates/sent.html b/internal/relay/templates/sent.html new file mode 100644 index 0000000..71056b4 --- /dev/null +++ b/internal/relay/templates/sent.html @@ -0,0 +1,5 @@ +{{template "head" "Check your email"}} +

Check your email

+

If {{.Email}} can register another server, a link is on its way. It works for 24 hours.

+

Not there? Check spam.

+{{template "foot"}} diff --git a/internal/relay/templates/terms.html b/internal/relay/templates/terms.html new file mode 100644 index 0000000..97c7ff4 --- /dev/null +++ b/internal/relay/templates/terms.html @@ -0,0 +1,19 @@ +{{template "head" "Terms"}} +

Terms for push servers

+

Version 1.

+

The MeshCore Beacon push relay is a free service of the MeshCore Beacon project. It delivers notifications from +registered beacon-server instances to the Beacon app. By registering a server you agree that:

+
    +
  1. You run, or are allowed to register, the server you name, and the email you give is yours and reachable.
  2. +
  3. Your server sends only the alerts its users asked for, through an unmodified or compatible beacon-server.
  4. +
  5. You do not try to reach devices that did not register with your server, get around rate limits, or send +anything misleading.
  6. +
  7. The relay records which server sent each notification, when, to which device handle and how large it was, and +enforces rate limits. See the privacy notice.
  8. +
  9. We may rate-limit, suspend or ban a server, and refuse new registrations from its email, if it breaks these +terms or puts the service at risk.
  10. +
  11. The service comes with no warranty and no promise of uptime. We may change these terms; a new version is +shown to you before it applies.
  12. +
+

Questions or reports: abuse@meshcorebeacon.ca.

+{{template "foot"}} diff --git a/internal/relay/templates/verified.html b/internal/relay/templates/verified.html new file mode 100644 index 0000000..33cd054 --- /dev/null +++ b/internal/relay/templates/verified.html @@ -0,0 +1,35 @@ +{{template "head" "Your Push ID"}} +{{if .Reset}}

New secret for {{.Result.Name}}

{{else}}

{{.Result.Name}} is registered

{{end}} +

Copy the secret now. It won't be shown again.

+ +
+
config.yaml
+
alerts:
+  push:
+    enabled: true
+    id: {{.Result.PushID}}
+
+ +
+
.env
+
BEACON_PUSH_SECRET={{.Result.Secret}}
+
+ +{{if .Reset}} +

Put the new secret in .env and restart beacon-server. Until then its notifications are refused.

+{{if .Result.URL}}

If a daily check runs first, the server drops to {{.Tiers.EmailPerMinute}} a minute +until the next check passes.

{{end}} +{{else}} +

Restart beacon-server.

+{{if .Result.URL}} +

{{.Tiers.EmailPerMinute}} a minute and {{.Tiers.EmailPerDay}} a day until the daily check passes, then +{{.Tiers.VerifiedPerMinute}} and {{.Tiers.VerifiedPerDay}}. Behind a proxy, route /.well-known/beacon-push +to beacon-server.

+{{else}} +

{{.Tiers.EmailPerMinute}} a minute and {{.Tiers.EmailPerDay}} a day. Register with a public URL for +{{.Tiers.VerifiedPerMinute}} and {{.Tiers.VerifiedPerDay}}.

+{{end}} +{{end}} +

Lose a secret later? Manage your servers.

+ +{{template "foot"}} diff --git a/internal/relay/templates/verify.html b/internal/relay/templates/verify.html new file mode 100644 index 0000000..850016b --- /dev/null +++ b/internal/relay/templates/verify.html @@ -0,0 +1,16 @@ +{{template "head" "Confirm your server"}} +

Confirm your server

+{{template "error" .Error}} +
+ + +

Your secret is shown once, on the next page.

+ +
+ +{{template "foot"}} diff --git a/internal/relay/web.go b/internal/relay/web.go new file mode 100644 index 0000000..ea6cfab --- /dev/null +++ b/internal/relay/web.go @@ -0,0 +1,324 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package relay + +import ( + "context" + "embed" + "encoding/json" + "errors" + "html/template" + "io/fs" + "net/http" + "net/mail" + "net/url" + "strconv" + "strings" + "time" + "unicode" + "unicode/utf8" + + "github.com/MeshCore-Beacon/beacon-push/internal/disposable" + mailer "github.com/MeshCore-Beacon/beacon-push/internal/mail" + "github.com/MeshCore-Beacon/beacon-push/internal/store" +) + +//go:embed templates/*.html +var templateFS embed.FS + +//go:embed static +var staticFS embed.FS + +var pages = template.Must(template.ParseFS(templateFS, "templates/*.html")) + +func staticFiles() http.Handler { + sub, _ := fs.Sub(staticFS, "static") + files := http.StripPrefix("/static/", http.FileServer(http.FS(sub))) + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + // Fonts never change; the rest may on any deploy. + if strings.HasPrefix(r.URL.Path, "/static/fonts/") { + w.Header().Set("Cache-Control", "public, max-age=2592000") + } + files.ServeHTTP(w, r) + }) +} + +// favicon answers browsers that ask for /favicon.ico without reading the page's icon link. +func favicon(w http.ResponseWriter, _ *http.Request) { + b, _ := staticFS.ReadFile("static/favicon.svg") + w.Header().Set("Content-Type", "image/svg+xml") + w.Header().Set("Cache-Control", "public, max-age=86400") + _, _ = w.Write(b) +} + +// pageData is what every page template gets. +type pageData struct { + Error string + Form registerForm + Result *registered + Email string + Tiers tierText + // The manage pages. + Servers []managedServer + Session string + Notice string + Reset bool +} + +// tierText is the tier limits as the pages show them, taken from the constants so the copy cannot drift. +type tierText struct { + EmailPerMinute, EmailPerDay, VerifiedPerMinute, VerifiedPerDay string +} + +var tiers = tierText{thousands(EmailTierPerMinute), thousands(EmailTierPerDay), thousands(VerifiedTierPerMinute), thousands(VerifiedTierPerDay)} + +// thousands writes n with comma separators, like 10,000. +func thousands(n int) string { + s := strconv.Itoa(n) + for i := len(s) - 3; i > 0; i -= 3 { + s = s[:i] + "," + s[i:] + } + return s +} + +type registerForm struct { + Name, Email, URL string +} + +type registered struct { + PushID, Secret, Name, URL string +} + +func (s *Server) render(w http.ResponseWriter, status int, name string, data pageData) { + w.Header().Set("Content-Type", "text/html; charset=utf-8") + w.Header().Set("Cache-Control", "no-store") + w.WriteHeader(status) + data.Tiers = tiers + if err := pages.ExecuteTemplate(w, name+".html", data); err != nil { + s.log.Error("page not rendered", "component", "web", "page", name, "err", err) + } +} + +func (s *Server) page(name string) http.HandlerFunc { + return func(w http.ResponseWriter, _ *http.Request) { s.render(w, http.StatusOK, name, pageData{}) } +} + +func (s *Server) registerForm(w http.ResponseWriter, _ *http.Request) { + s.render(w, http.StatusOK, "register", pageData{}) +} + +// cleanName is the display name shown on notifications: 1 to 40 printable characters, spaces collapsed. Format +// characters (bidi overrides, zero-width joiners and the like) are refused, so one name cannot be made to look like +// another. +func cleanName(raw string) (string, bool) { + name := strings.Join(strings.FieldsFunc(raw, unicode.IsSpace), " ") + if name == "" || utf8.RuneCountInString(name) > 40 { + return "", false + } + for _, r := range name { + if !unicode.IsPrint(r) || r == '<' || r == '>' { + return "", false + } + } + return name, true +} + +// cleanEmail accepts one bare address and returns it lower-cased. +func cleanEmail(raw string) (string, bool) { + raw = strings.TrimSpace(raw) + a, err := mail.ParseAddress(raw) + if err != nil || a.Address != raw || len(raw) > 254 || !strings.Contains(raw, "@") { + return "", false + } + return strings.ToLower(raw), true +} + +// cleanURL accepts an https base URL (http in dev mode) with no credentials, query or fragment, without a trailing +// slash. Empty is allowed: the URL is optional. +func (s *Server) cleanURL(raw string) (string, bool) { + raw = strings.TrimRight(strings.TrimSpace(raw), "/") + if raw == "" { + return "", true + } + u, err := url.Parse(raw) + if err != nil || u.Host == "" || u.User != nil || u.RawQuery != "" || u.Fragment != "" || len(raw) > 200 { + return "", false + } + if u.Scheme != "https" && !(s.cfg.DevMode && u.Scheme == "http") { + return "", false + } + return u.String(), true +} + +type linkPayload struct { + Name string `json:"name"` + URL string `json:"url"` + IP string `json:"ip"` +} + +const purposeRegister = "register" + +func (s *Server) register(w http.ResponseWriter, r *http.Request) { + r.Body = http.MaxBytesReader(w, r.Body, 16<<10) + if err := r.ParseForm(); err != nil { + s.render(w, http.StatusBadRequest, "register", pageData{Error: "The form could not be read."}) + return + } + form := registerForm{Name: r.PostForm.Get("name"), Email: r.PostForm.Get("email"), URL: r.PostForm.Get("url")} + fail := func(msg string) { s.render(w, http.StatusBadRequest, "register", pageData{Error: msg, Form: form}) } + + // Bots fill the hidden field; tell them it worked and do nothing. + if r.PostForm.Get("website") != "" { + s.render(w, http.StatusOK, "sent", pageData{Email: form.Email}) + return + } + name, ok := cleanName(form.Name) + if !ok { + fail("Give the server a name of 1 to 40 characters, without < or >.") + return + } + email, ok := cleanEmail(form.Email) + if !ok { + fail("Enter one email address, like you@example.org.") + return + } + if disposable.Blocked(email[strings.LastIndexByte(email, '@')+1:]) { + fail("Use a permanent email address. We need to be able to reach you about this server.") + return + } + serverURL, ok := s.cleanURL(form.URL) + if !ok { + fail("The public URL must be an https address like https://beacon.example.org, or left empty.") + return + } + if r.PostForm.Get("terms") != "on" { + fail("You need to accept the terms to register.") + return + } + // Only complete forms count against the address, so a typo does not lock anyone out. + now := s.now() + ip := s.clientIP(r) + if ok, _ := s.hour.Allow("register:"+ip, RegisterPerHourPerIP, now); !ok { + s.render(w, http.StatusTooManyRequests, "register", pageData{Error: "Too many registrations from your address. Try again in an hour.", Form: form}) + return + } + + // From here on the page always says the same thing, so it cannot tell anyone which addresses hold servers. + sent := func() { s.render(w, http.StatusOK, "sent", pageData{Email: email}) } + if ok, _ := s.hour.Allow("link:"+email, LinkMailsPerHour, now); !ok { + sent() + return + } + ctx := r.Context() + banned, err := s.store.EmailBanned(ctx, EmailHash(email)) + if err != nil { + s.log.Error("ban check failed", "component", "web", "err", err) + s.render(w, http.StatusInternalServerError, "register", pageData{Error: "Something went wrong. Try again later.", Form: form}) + return + } + if banned { + sent() + return + } + n, err := s.store.CountInstancesByEmail(ctx, email) + if err != nil { + s.log.Error("server count failed", "component", "web", "err", err) + s.render(w, http.StatusInternalServerError, "register", pageData{Error: "Something went wrong. Try again later.", Form: form}) + return + } + if n >= MaxServersPerEmail { + s.sendMail(ctx, email, "Your Beacon push registration", + "Someone asked to register the Beacon server \""+name+"\" for push notifications with this address.\n\n"+ + "This address already has the most servers allowed (2), so nothing was registered.\n"+ + "If you need more, write to abuse@meshcorebeacon.ca.\n") + sent() + return + } + token := randomString(32) + payload, _ := json.Marshal(linkPayload{Name: name, URL: serverURL, IP: ip}) + if err := s.store.CreateEmailToken(ctx, hash(token), purposeRegister, email, string(payload), now.Add(LinkLifetime)); err != nil { + s.log.Error("link not stored", "component", "web", "err", err) + s.render(w, http.StatusInternalServerError, "register", pageData{Error: "Something went wrong. Try again later.", Form: form}) + return + } + link := s.cfg.PublicURL.String() + "/verify#token=" + token + s.sendMail(ctx, email, "Confirm your Beacon push server", + "Someone, hopefully you, asked to register the Beacon server \""+name+"\" for push notifications.\n\n"+ + "Open this link within 24 hours to get its Push ID and Push secret:\n\n"+link+"\n\n"+ + "If this wasn't you, ignore this email and nothing happens.\n") + sent() +} + +func (s *Server) sendMail(ctx context.Context, to, subject, text string) { + ctx, cancel := context.WithTimeout(ctx, 30*time.Second) + defer cancel() + if err := s.mail.Send(ctx, mailer.Message{To: to, Subject: subject, Text: text}); err != nil { + domain := to[strings.LastIndexByte(to, '@')+1:] + s.log.Warn("mail not sent", "component", "web", "subject", subject, "recipient_domain", domain, "err", err) + } +} + +func (s *Server) verify(w http.ResponseWriter, r *http.Request) { + r.Body = http.MaxBytesReader(w, r.Body, 4<<10) + if err := r.ParseForm(); err != nil { + s.render(w, http.StatusBadRequest, "verify", pageData{Error: "The form could not be read."}) + return + } + now := s.now() + if ok, _ := s.hour.Allow("verify:"+s.clientIP(r), VerifyPerHourPerIP, now); !ok { + s.render(w, http.StatusTooManyRequests, "verify", pageData{Error: "Too many attempts from your address. Try again in an hour."}) + return + } + token := strings.TrimSpace(r.PostForm.Get("token")) + if token == "" { + token = strings.TrimSpace(strings.TrimPrefix(r.PostForm.Get("token_manual"), "token=")) + } + ctx := r.Context() + email, raw, err := s.store.ConsumeEmailToken(ctx, hash(token), purposeRegister, now) + if errors.Is(err, store.ErrNotFound) { + s.render(w, http.StatusBadRequest, "verify", pageData{Error: "This link has expired or was already used. Register again to get a new one."}) + return + } + if err != nil { + s.log.Error("link not consumed", "component", "web", "err", err) + s.render(w, http.StatusInternalServerError, "verify", pageData{Error: "Something went wrong. Try again later."}) + return + } + var p linkPayload + _ = json.Unmarshal([]byte(raw), &p) + if banned, err := s.store.EmailBanned(ctx, EmailHash(email)); err != nil || banned { + s.render(w, http.StatusForbidden, "verify", pageData{Error: "This server cannot be registered."}) + return + } + secret := randomString(32) + inst := store.Instance{Name: p.Name, Email: email, URL: p.URL, SecretHash: hash(secret), TermsVersion: TermsVersion, + TermsAcceptedAt: store.Ms(now), CreatedAt: store.Ms(now), CreatedIP: p.IP} + for attempt := 0; ; attempt++ { + inst.ID = newInstanceID() + err = s.store.CreateInstance(ctx, inst, MaxServersPerEmail) + if err == nil || errors.Is(err, store.ErrLimit) || attempt == 3 { + break + } + } + if errors.Is(err, store.ErrLimit) { + s.render(w, http.StatusConflict, "verify", pageData{Error: "This email address already has the most servers allowed (2)."}) + return + } + if err != nil { + s.log.Error("server not created", "component", "web", "err", err) + s.render(w, http.StatusInternalServerError, "verify", pageData{Error: "Something went wrong. Register again to get a new link."}) + return + } + s.log.Info("server registered", "component", "web", "push_id", inst.ID, "has_url", inst.URL != "") + go s.notifyAdmin(ctx, "New push server: "+inst.Name, + "Push ID: "+inst.ID+"\nName: "+inst.Name+"\nEmail: "+inst.Email+"\nURL: "+orNone(inst.URL)+"\nIP: "+inst.CreatedIP+"\n") + s.render(w, http.StatusOK, "verified", pageData{Result: ®istered{PushID: inst.ID, Secret: secret, Name: inst.Name, URL: inst.URL}}) +} + +func orNone(s string) string { + if s == "" { + return "(none)" + } + return s +} diff --git a/internal/store/store.go b/internal/store/store.go new file mode 100644 index 0000000..bff5942 --- /dev/null +++ b/internal/store/store.go @@ -0,0 +1,828 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +// Package store keeps the relay's state in one SQLite file: registered servers, registration links, device handles, +// the send log and daily usage. Times are Unix milliseconds. Secrets are stored only as SHA-256 hashes. +package store + +import ( + "context" + "database/sql" + "errors" + "fmt" + "time" + + _ "modernc.org/sqlite" +) + +// ErrNotFound is returned when a row does not exist. +var ErrNotFound = errors.New("store: not found") + +// ErrLimit is returned when an email already has the most servers it may register. +var ErrLimit = errors.New("store: server limit reached") + +// Instance statuses. +const ( + StatusActive = "active" + StatusSuspended = "suspended" + StatusBanned = "banned" +) + +// Store is the relay database. One connection: SQLite serialises writes anyway, and this keeps transactions simple. +type Store struct { + db *sql.DB +} + +var migrations = []string{ + `CREATE TABLE instances ( + id TEXT PRIMARY KEY, + name TEXT NOT NULL, + email TEXT NOT NULL, + url TEXT NOT NULL DEFAULT '', + status TEXT NOT NULL DEFAULT 'active' CHECK (status IN ('active', 'suspended', 'banned')), + secret_hash BLOB NOT NULL, + domain_verified_at INTEGER NOT NULL DEFAULT 0, + domain_checked_at INTEGER NOT NULL DEFAULT 0, + quota_per_minute INTEGER NOT NULL DEFAULT 0, + quota_per_day INTEGER NOT NULL DEFAULT 0, + terms_version INTEGER NOT NULL, + terms_accepted_at INTEGER NOT NULL, + created_at INTEGER NOT NULL, + created_ip TEXT NOT NULL DEFAULT '' + ); + CREATE INDEX idx_instances_email ON instances (email); + CREATE TABLE email_tokens ( + token_hash BLOB PRIMARY KEY, + purpose TEXT NOT NULL, + email TEXT NOT NULL, + payload TEXT NOT NULL DEFAULT '{}', + expires_at INTEGER NOT NULL, + used_at INTEGER + ); + CREATE TABLE banned_emails ( + email_hash BLOB PRIMARY KEY, + banned_at INTEGER NOT NULL + ); + CREATE TABLE handles ( + handle TEXT PRIMARY KEY, + secret_hash BLOB NOT NULL, + instance_id TEXT NOT NULL REFERENCES instances(id) ON DELETE CASCADE, + platform TEXT NOT NULL CHECK (platform IN ('ios', 'android')), + fcm_token TEXT NOT NULL, + created_at INTEGER NOT NULL, + refreshed_at INTEGER NOT NULL, + last_sent_at INTEGER NOT NULL DEFAULT 0, + revoked_at INTEGER NOT NULL DEFAULT 0, + UNIQUE (instance_id, fcm_token) + ); + CREATE TABLE send_log ( + message_id TEXT PRIMARY KEY, + instance_id TEXT NOT NULL, + handle TEXT NOT NULL, + at INTEGER NOT NULL, + size INTEGER NOT NULL, + ciphertext_sha256 BLOB NOT NULL, + status TEXT NOT NULL + ); + CREATE INDEX idx_send_log_handle ON send_log (handle, at); + CREATE INDEX idx_send_log_at ON send_log (at); + CREATE TABLE usage_daily ( + instance_id TEXT NOT NULL, + day TEXT NOT NULL, + sent INTEGER NOT NULL DEFAULT 0, + rate_limited INTEGER NOT NULL DEFAULT 0, + invalid_handle INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (instance_id, day) + );`, + // client_id is the sender's idempotency key; status is pending until the provider answers, then ok or failed. + `ALTER TABLE send_log ADD COLUMN client_id TEXT; + CREATE UNIQUE INDEX idx_send_log_client ON send_log (instance_id, client_id) WHERE client_id IS NOT NULL;`, + // Keeps the search for abandoned pending sends cheap enough to run on every reservation. + `CREATE INDEX idx_send_log_pending ON send_log (at) WHERE status = 'pending';`, + // iOS goes straight to APNs: fcm_token becomes token, and an iOS handle names its APNs environment. Live iOS + // handles from before hold FCM tokens APNs cannot use, so they are revoked and the app registers again. + `CREATE TABLE handles_new ( + handle TEXT PRIMARY KEY, + secret_hash BLOB NOT NULL, + instance_id TEXT NOT NULL REFERENCES instances(id) ON DELETE CASCADE, + platform TEXT NOT NULL CHECK (platform IN ('ios', 'android')), + token TEXT NOT NULL, + apns_env TEXT, + created_at INTEGER NOT NULL, + refreshed_at INTEGER NOT NULL, + last_sent_at INTEGER NOT NULL DEFAULT 0, + revoked_at INTEGER NOT NULL DEFAULT 0, + UNIQUE (instance_id, token), + CHECK ((platform = 'android' AND apns_env IS NULL) OR (platform = 'ios' AND + (coalesce(apns_env, '') IN ('sandbox', 'production') OR (apns_env IS NULL AND revoked_at <> 0)))) + ); + INSERT INTO handles_new (handle, secret_hash, instance_id, platform, token, apns_env, created_at, refreshed_at, + last_sent_at, revoked_at) + SELECT handle, secret_hash, instance_id, platform, fcm_token, NULL, created_at, refreshed_at, last_sent_at, + CASE WHEN platform = 'ios' AND revoked_at = 0 THEN CAST(strftime('%s', 'now') AS INTEGER) * 1000 ELSE revoked_at END + FROM handles; + DROP TABLE handles; + ALTER TABLE handles_new RENAME TO handles;`, +} + +// Open opens (creating if needed) the database at path and brings its schema up to date. +func Open(ctx context.Context, path string) (*Store, error) { + db, err := sql.Open("sqlite", "file:"+path+"?_pragma=busy_timeout(5000)&_pragma=journal_mode(WAL)&_pragma=foreign_keys(1)&_pragma=synchronous(NORMAL)") + if err != nil { + return nil, err + } + db.SetMaxOpenConns(1) + s := &Store{db: db} + if err := s.migrate(ctx); err != nil { + db.Close() + return nil, err + } + return s, nil +} + +// DB is the underlying database, for tests and one-off repairs. +func (s *Store) DB() *sql.DB { return s.db } + +// Backup writes a consistent copy of the database to path, which must not exist yet. +func (s *Store) Backup(ctx context.Context, path string) error { + _, err := s.db.ExecContext(ctx, `VACUUM INTO ?`, path) + return err +} + +// Close closes the database. +func (s *Store) Close() error { return s.db.Close() } + +func (s *Store) migrate(ctx context.Context) error { + var version int + if err := s.db.QueryRowContext(ctx, "PRAGMA user_version").Scan(&version); err != nil { + return fmt.Errorf("store: read schema version: %w", err) + } + for i := version; i < len(migrations); i++ { + tx, err := s.db.BeginTx(ctx, nil) + if err != nil { + return err + } + if _, err := tx.ExecContext(ctx, migrations[i]); err != nil { + tx.Rollback() + return fmt.Errorf("store: migration %d: %w", i+1, err) + } + if _, err := tx.ExecContext(ctx, fmt.Sprintf("PRAGMA user_version = %d", i+1)); err != nil { + tx.Rollback() + return err + } + if err := tx.Commit(); err != nil { + return err + } + } + return nil +} + +// Ms is t as Unix milliseconds. +func Ms(t time.Time) int64 { return t.UnixMilli() } + +// Day is the UTC calendar day of t, the key of daily usage. +func Day(t time.Time) string { return t.UTC().Format("2006-01-02") } + +// ── Registration links ────────────────────────────────────────────────────────────────────────── + +// CreateEmailToken stores a one-time link token by its hash. +func (s *Store) CreateEmailToken(ctx context.Context, hash []byte, purpose, email, payload string, expires time.Time) error { + _, err := s.db.ExecContext(ctx, `INSERT INTO email_tokens (token_hash, purpose, email, payload, expires_at) VALUES (?, ?, ?, ?, ?)`, + hash, purpose, email, payload, Ms(expires)) + return err +} + +// ConsumeEmailToken marks an unused, unexpired token used and returns its email and payload. ErrNotFound otherwise. +func (s *Store) ConsumeEmailToken(ctx context.Context, hash []byte, purpose string, now time.Time) (email, payload string, err error) { + err = s.db.QueryRowContext(ctx, `UPDATE email_tokens SET used_at = ? + WHERE token_hash = ? AND purpose = ? AND used_at IS NULL AND expires_at > ? + RETURNING email, payload`, Ms(now), hash, purpose, Ms(now)).Scan(&email, &payload) + if errors.Is(err, sql.ErrNoRows) { + return "", "", ErrNotFound + } + return email, payload, err +} + +// ── Instances ─────────────────────────────────────────────────────────────────────────────────── + +// Instance is one registered beacon-server. +type Instance struct { + ID, Name, Email, URL, Status string + SecretHash []byte + DomainVerifiedAt int64 // 0: not verified + DomainCheckedAt int64 + QuotaPerMinute, QuotaPerDay int // 0: the tier default + TermsVersion int + TermsAcceptedAt, CreatedAt int64 + CreatedIP string +} + +const instanceCols = `id, name, email, url, status, secret_hash, domain_verified_at, domain_checked_at, quota_per_minute, + quota_per_day, terms_version, terms_accepted_at, created_at, created_ip` + +func scanInstance(row interface{ Scan(...any) error }) (Instance, error) { + var i Instance + err := row.Scan(&i.ID, &i.Name, &i.Email, &i.URL, &i.Status, &i.SecretHash, &i.DomainVerifiedAt, &i.DomainCheckedAt, + &i.QuotaPerMinute, &i.QuotaPerDay, &i.TermsVersion, &i.TermsAcceptedAt, &i.CreatedAt, &i.CreatedIP) + if errors.Is(err, sql.ErrNoRows) { + return Instance{}, ErrNotFound + } + return i, err +} + +// EmailBanned reports whether the email's hash is on the ban list. +func (s *Store) EmailBanned(ctx context.Context, emailHash []byte) (bool, error) { + var n int + err := s.db.QueryRowContext(ctx, `SELECT count(*) FROM banned_emails WHERE email_hash = ?`, emailHash).Scan(&n) + return n > 0, err +} + +// CountInstancesByEmail counts every server the email holds, banned and suspended ones included. +func (s *Store) CountInstancesByEmail(ctx context.Context, email string) (int, error) { + var n int + err := s.db.QueryRowContext(ctx, `SELECT count(*) FROM instances WHERE email = ?`, email).Scan(&n) + return n, err +} + +// CreateInstance inserts the server unless its email already holds max servers (ErrLimit), in one transaction so +// two links clicked at once cannot both pass the check. +func (s *Store) CreateInstance(ctx context.Context, i Instance, max int) error { + tx, err := s.db.BeginTx(ctx, nil) + if err != nil { + return err + } + defer tx.Rollback() + var n int + if err := tx.QueryRowContext(ctx, `SELECT count(*) FROM instances WHERE email = ?`, i.Email).Scan(&n); err != nil { + return err + } + if n >= max { + return ErrLimit + } + if _, err := tx.ExecContext(ctx, `INSERT INTO instances (`+instanceCols+`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, + i.ID, i.Name, i.Email, i.URL, StatusActive, i.SecretHash, 0, 0, 0, 0, i.TermsVersion, i.TermsAcceptedAt, i.CreatedAt, i.CreatedIP); err != nil { + return err + } + return tx.Commit() +} + +// Instance returns the server with the ID, or ErrNotFound. +func (s *Store) Instance(ctx context.Context, id string) (Instance, error) { + return scanInstance(s.db.QueryRowContext(ctx, `SELECT `+instanceCols+` FROM instances WHERE id = ?`, id)) +} + +// Instances lists every server, newest first. +func (s *Store) Instances(ctx context.Context) ([]Instance, error) { + rows, err := s.db.QueryContext(ctx, `SELECT `+instanceCols+` FROM instances ORDER BY created_at DESC`) + if err != nil { + return nil, err + } + defer rows.Close() + var out []Instance + for rows.Next() { + i, err := scanInstance(rows) + if err != nil { + return nil, err + } + out = append(out, i) + } + return out, rows.Err() +} + +// InstancesByEmail lists the servers an email holds, oldest first. +func (s *Store) InstancesByEmail(ctx context.Context, email string) ([]Instance, error) { + rows, err := s.db.QueryContext(ctx, `SELECT `+instanceCols+` FROM instances WHERE email = ? ORDER BY created_at`, email) + if err != nil { + return nil, err + } + defer rows.Close() + var out []Instance + for rows.Next() { + i, err := scanInstance(rows) + if err != nil { + return nil, err + } + out = append(out, i) + } + return out, rows.Err() +} + +// DueForDomainCheck lists active servers with a URL whose domain was last checked before the time. +func (s *Store) DueForDomainCheck(ctx context.Context, checkedBefore time.Time) ([]Instance, error) { + rows, err := s.db.QueryContext(ctx, `SELECT `+instanceCols+` FROM instances + WHERE status = 'active' AND url <> '' AND domain_checked_at < ? ORDER BY domain_checked_at`, Ms(checkedBefore)) + if err != nil { + return nil, err + } + defer rows.Close() + var out []Instance + for rows.Next() { + i, err := scanInstance(rows) + if err != nil { + return nil, err + } + out = append(out, i) + } + return out, rows.Err() +} + +func (s *Store) exec1(ctx context.Context, q string, args ...any) error { + res, err := s.db.ExecContext(ctx, q, args...) + if err != nil { + return err + } + if n, _ := res.RowsAffected(); n == 0 { + return ErrNotFound + } + return nil +} + +// SetStatus changes a server's status. Banning also adds its email hash to the ban list. +func (s *Store) SetStatus(ctx context.Context, id, status string, emailHash []byte, now time.Time) error { + if err := s.exec1(ctx, `UPDATE instances SET status = ? WHERE id = ?`, status, id); err != nil { + return err + } + if status == StatusBanned && emailHash != nil { + _, err := s.db.ExecContext(ctx, `INSERT OR IGNORE INTO banned_emails (email_hash, banned_at) VALUES (?, ?)`, emailHash, Ms(now)) + return err + } + return nil +} + +// SuspendIfActive suspends a server only while it is active, so it never overwrites a ban. It reports whether it did. +func (s *Store) SuspendIfActive(ctx context.Context, id string) (bool, error) { + err := s.exec1(ctx, `UPDATE instances SET status = 'suspended' WHERE id = ? AND status = 'active'`, id) + if errors.Is(err, ErrNotFound) { + return false, nil + } + return err == nil, err +} + +// SetSecret replaces a server's Push secret hash. The old secret stops working at once. +func (s *Store) SetSecret(ctx context.Context, id string, secretHash []byte) error { + return s.exec1(ctx, `UPDATE instances SET secret_hash = ? WHERE id = ?`, secretHash, id) +} + +// SetQuota overrides a server's limits; 0 restores the tier default. +func (s *Store) SetQuota(ctx context.Context, id string, perMinute, perDay int) error { + return s.exec1(ctx, `UPDATE instances SET quota_per_minute = ?, quota_per_day = ? WHERE id = ?`, perMinute, perDay, id) +} + +// SetDomainCheck records a domain check. A pass keeps the first verification time; a failure clears it. +func (s *Store) SetDomainCheck(ctx context.Context, id string, passed bool, now time.Time) error { + if passed { + return s.exec1(ctx, `UPDATE instances SET domain_checked_at = ?, + domain_verified_at = CASE WHEN domain_verified_at = 0 THEN ? ELSE domain_verified_at END WHERE id = ?`, Ms(now), Ms(now), id) + } + return s.exec1(ctx, `UPDATE instances SET domain_checked_at = ?, domain_verified_at = 0 WHERE id = ?`, Ms(now), id) +} + +// DeleteInstance removes a server and everything kept for it, in one transaction. Its email is not banned and +// gets the registration slot back. ErrNotFound when there is no such server. +func (s *Store) DeleteInstance(ctx context.Context, id string) error { + tx, err := s.db.BeginTx(ctx, nil) + if err != nil { + return err + } + defer tx.Rollback() + // Handles would cascade, but deleting them here does not depend on the foreign_keys pragma. + for _, q := range []string{ + `DELETE FROM send_log WHERE instance_id = ?`, + `DELETE FROM usage_daily WHERE instance_id = ?`, + `DELETE FROM handles WHERE instance_id = ?`, + } { + if _, err := tx.ExecContext(ctx, q, id); err != nil { + return err + } + } + res, err := tx.ExecContext(ctx, `DELETE FROM instances WHERE id = ?`, id) + if err != nil { + return err + } + if n, _ := res.RowsAffected(); n == 0 { + return ErrNotFound + } + return tx.Commit() +} + +// ── Handles ───────────────────────────────────────────────────────────────────────────────────── + +// Handle is one device's registration with one server. +type Handle struct { + Handle, InstanceID, Platform, Token string + APNsEnv string // sandbox or production on iOS, empty on Android + SecretHash []byte + CreatedAt, RefreshedAt int64 + LastSentAt, RevokedAt int64 // 0: never / not revoked +} + +// Handle returns the handle, or ErrNotFound. +func (s *Store) Handle(ctx context.Context, handle string) (Handle, error) { + var h Handle + err := s.db.QueryRowContext(ctx, `SELECT handle, instance_id, platform, token, coalesce(apns_env, ''), secret_hash, created_at, + refreshed_at, last_sent_at, revoked_at FROM handles WHERE handle = ?`, handle). + Scan(&h.Handle, &h.InstanceID, &h.Platform, &h.Token, &h.APNsEnv, &h.SecretHash, &h.CreatedAt, &h.RefreshedAt, &h.LastSentAt, &h.RevokedAt) + if errors.Is(err, sql.ErrNoRows) { + return Handle{}, ErrNotFound + } + return h, err +} + +// nullable stores an empty string as NULL. +func nullable(v string) any { + if v == "" { + return nil + } + return v +} + +// UpsertHandle registers a device token with a server. The same token on the same server keeps its handle and gets +// the new secret; a revoked registration is replaced by a fresh handle. It returns the handle in use. apnsEnv is +// sandbox or production for iOS and empty for Android. +func (s *Store) UpsertHandle(ctx context.Context, newHandle, instanceID, platform, token, apnsEnv string, secretHash []byte, now time.Time) (string, error) { + tx, err := s.db.BeginTx(ctx, nil) + if err != nil { + return "", err + } + defer tx.Rollback() + var existing string + var revoked int64 + err = tx.QueryRowContext(ctx, `SELECT handle, revoked_at FROM handles WHERE instance_id = ? AND token = ?`, instanceID, token).Scan(&existing, &revoked) + switch { + case err == nil && revoked == 0: + if _, err := tx.ExecContext(ctx, `UPDATE handles SET secret_hash = ?, platform = ?, apns_env = ?, refreshed_at = ? WHERE handle = ?`, + secretHash, platform, nullable(apnsEnv), Ms(now), existing); err != nil { + return "", err + } + return existing, tx.Commit() + case err == nil: + if _, err := tx.ExecContext(ctx, `DELETE FROM handles WHERE handle = ?`, existing); err != nil { + return "", err + } + case !errors.Is(err, sql.ErrNoRows): + return "", err + } + if _, err := tx.ExecContext(ctx, `INSERT INTO handles (handle, secret_hash, instance_id, platform, token, apns_env, created_at, refreshed_at) + VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, newHandle, secretHash, instanceID, platform, token, nullable(apnsEnv), Ms(now), Ms(now)); err != nil { + return "", err + } + return newHandle, tx.Commit() +} + +// RefreshHandleToken moves a handle to a new device token and, on iOS, APNs environment. Another registration of +// that token with the same server is dropped, since the device now answers to this handle. +func (s *Store) RefreshHandleToken(ctx context.Context, handle, instanceID, token, apnsEnv string, now time.Time) error { + tx, err := s.db.BeginTx(ctx, nil) + if err != nil { + return err + } + defer tx.Rollback() + if _, err := tx.ExecContext(ctx, `DELETE FROM handles WHERE instance_id = ? AND token = ? AND handle <> ?`, instanceID, token, handle); err != nil { + return err + } + res, err := tx.ExecContext(ctx, `UPDATE handles SET token = ?, apns_env = ?, refreshed_at = ? WHERE handle = ? AND revoked_at = 0`, + token, nullable(apnsEnv), Ms(now), handle) + if err != nil { + return err + } + if n, _ := res.RowsAffected(); n == 0 { + return ErrNotFound + } + return tx.Commit() +} + +// RevokeHandle stops a handle from receiving anything. +func (s *Store) RevokeHandle(ctx context.Context, handle string, now time.Time) error { + return s.exec1(ctx, `UPDATE handles SET revoked_at = ? WHERE handle = ? AND revoked_at = 0`, Ms(now), handle) +} + +// RevokeHandleToken revokes a handle only while it is still the registration a send went to: same token, APNs +// environment and refresh time. A late failure cannot revoke what the app has since refreshed or registered again. +// ErrNotFound when the row changed or the handle is gone. +func (s *Store) RevokeHandleToken(ctx context.Context, sent Handle, now time.Time) error { + return s.exec1(ctx, `UPDATE handles SET revoked_at = ? WHERE handle = ? AND token = ? AND coalesce(apns_env, '') = ? + AND refreshed_at = ? AND revoked_at = 0`, Ms(now), sent.Handle, sent.Token, sent.APNsEnv, sent.RefreshedAt) +} + +// CountHandles counts a server's live handles. +func (s *Store) CountHandles(ctx context.Context, instanceID string) (int, error) { + var n int + err := s.db.QueryRowContext(ctx, `SELECT count(*) FROM handles WHERE instance_id = ? AND revoked_at = 0`, instanceID).Scan(&n) + return n, err +} + +// ── Sends and usage ───────────────────────────────────────────────────────────────────────────── + +// Send-log statuses. A pending row holds its quota until the push provider answers. +const ( + SendPending = "pending" + SendOK = "ok" + SendFailed = "failed" +) + +// PendingTimeout is how long a pending send holds its idempotency key; after that it counts as failed. +const PendingTimeout = 2 * time.Minute + +// Usage field names for BumpUsage. +const ( + UsageSent = "sent" + UsageRateLimited = "rate_limited" + UsageInvalidHandle = "invalid_handle" +) + +// Reservation asks to count one send before it goes to its push provider. The ciphertext itself is never stored, only its hash. +type Reservation struct { + MessageID, InstanceID, Handle string + ClientID string // the sender's idempotency key; empty for none + At time.Time + Size int + CiphertextSHA256 []byte + InstancePerDay, GlobalPerDay int + HandlePerDay int + // DayLimit, when set, gives the server's daily quota from its row as read in the transaction, so a quota + // change made mid-batch applies at once. It replaces InstancePerDay. + DayLimit func(Instance) int +} + +// Reserve outcomes. +type Outcome int + +const ( + Reserved Outcome = iota + AlreadySent // the client ID went out before; the message ID is the earlier one + InFlight // the client ID is being sent right now + OverInstanceDay // the server's daily quota is used up + OverGlobalDay // the relay's daily quota is used up + OverHandleDay // the device's daily quota is used up + NotActive // the server is no longer active +) + +// Reserve checks the server's status, the client ID and every daily quota, and counts the send as pending, all in +// one transaction so concurrent batches cannot pass the same count. It returns the message ID in use. +func (s *Store) Reserve(ctx context.Context, r Reservation) (Outcome, string, error) { + tx, err := s.db.BeginTx(ctx, nil) + if err != nil { + return 0, "", err + } + defer tx.Rollback() + inst, err := scanInstance(tx.QueryRowContext(ctx, `SELECT `+instanceCols+` FROM instances WHERE id = ?`, r.InstanceID)) + if errors.Is(err, ErrNotFound) { + return NotActive, "", nil + } + if err != nil { + return 0, "", err + } + if inst.Status != StatusActive { + return NotActive, "", nil + } + if err := releaseStale(ctx, tx, r.At); err != nil { + return 0, "", err + } + dayCap := r.InstancePerDay + if r.DayLimit != nil { + dayCap = r.DayLimit(inst) + } + var clientID any + if r.ClientID != "" { + clientID = r.ClientID + var msgID, st string + var at int64 + err := tx.QueryRowContext(ctx, `SELECT message_id, status, at FROM send_log WHERE instance_id = ? AND client_id = ?`, + r.InstanceID, r.ClientID).Scan(&msgID, &st, &at) + switch { + case errors.Is(err, sql.ErrNoRows): + case err != nil: + return 0, "", err + case st == SendOK: + return AlreadySent, msgID, nil + case st == SendPending && Ms(r.At)-at < PendingTimeout.Milliseconds(): + return InFlight, "", nil + default: + // A failed or abandoned earlier try: release it and send again. + if st == SendPending { + if err := release(ctx, tx, msgID); err != nil { + return 0, "", err + } + } + if _, err := tx.ExecContext(ctx, `UPDATE send_log SET client_id = NULL WHERE message_id = ?`, msgID); err != nil { + return 0, "", err + } + } + } + day := Day(r.At) + var mine, all, toHandle int + if err := tx.QueryRowContext(ctx, `SELECT coalesce(sum(sent), 0) FROM usage_daily WHERE instance_id = ? AND day = ?`, r.InstanceID, day).Scan(&mine); err != nil { + return 0, "", err + } + if err := tx.QueryRowContext(ctx, `SELECT coalesce(sum(sent), 0) FROM usage_daily WHERE day = ?`, day).Scan(&all); err != nil { + return 0, "", err + } + y, m, d := r.At.UTC().Date() + since := time.Date(y, m, d, 0, 0, 0, 0, time.UTC) + if err := tx.QueryRowContext(ctx, `SELECT count(*) FROM send_log WHERE handle = ? AND at >= ? AND status IN ('pending', 'ok')`, + r.Handle, Ms(since)).Scan(&toHandle); err != nil { + return 0, "", err + } + switch { + case all >= r.GlobalPerDay: + return OverGlobalDay, "", nil + case mine >= dayCap: + return OverInstanceDay, "", nil + case toHandle >= r.HandlePerDay: + return OverHandleDay, "", nil + } + if _, err := tx.ExecContext(ctx, `INSERT INTO send_log (message_id, instance_id, handle, at, size, ciphertext_sha256, status, client_id) + VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, r.MessageID, r.InstanceID, r.Handle, Ms(r.At), r.Size, r.CiphertextSHA256, SendPending, clientID); err != nil { + return 0, "", err + } + if err := bump(ctx, tx, r.InstanceID, day, UsageSent); err != nil { + return 0, "", err + } + return Reserved, r.MessageID, tx.Commit() +} + +// FinishSend records the provider's answer for a reserved send. A send that did not go out gives its quota back. +func (s *Store) FinishSend(ctx context.Context, messageID string, ok bool, at time.Time) error { + tx, err := s.db.BeginTx(ctx, nil) + if err != nil { + return err + } + defer tx.Rollback() + if ok { + var handle string + err := tx.QueryRowContext(ctx, `UPDATE send_log SET status = 'ok' WHERE message_id = ? AND status = 'pending' RETURNING handle`, + messageID).Scan(&handle) + if errors.Is(err, sql.ErrNoRows) { + return ErrNotFound + } + if err != nil { + return err + } + if _, err := tx.ExecContext(ctx, `UPDATE handles SET last_sent_at = ? WHERE handle = ?`, Ms(at), handle); err != nil { + return err + } + } else if err := release(ctx, tx, messageID); err != nil { + return err + } + return tx.Commit() +} + +// release marks a pending send failed and takes it off its day's count. +func release(ctx context.Context, tx *sql.Tx, messageID string) error { + var instanceID string + var at int64 + err := tx.QueryRowContext(ctx, `UPDATE send_log SET status = 'failed' WHERE message_id = ? AND status = 'pending' + RETURNING instance_id, at`, messageID).Scan(&instanceID, &at) + if errors.Is(err, sql.ErrNoRows) { + return ErrNotFound + } + if err != nil { + return err + } + _, err = tx.ExecContext(ctx, `UPDATE usage_daily SET sent = max(sent - 1, 0) WHERE instance_id = ? AND day = ?`, + instanceID, Day(time.UnixMilli(at))) + return err +} + +// releaseStale gives back the quota of pending sends older than PendingTimeout, whose outcome is unknown (the relay +// stopped or a send panicked). Their ids, if any, can be sent again. +func releaseStale(ctx context.Context, tx *sql.Tx, now time.Time) error { + rows, err := tx.QueryContext(ctx, `SELECT message_id FROM send_log WHERE status = 'pending' AND at < ?`, + Ms(now.Add(-PendingTimeout))) + if err != nil { + return err + } + var ids []string + for rows.Next() { + var id string + if err := rows.Scan(&id); err != nil { + rows.Close() + return err + } + ids = append(ids, id) + } + rows.Close() + if err := rows.Err(); err != nil { + return err + } + for _, id := range ids { + if err := release(ctx, tx, id); err != nil { + return err + } + } + return nil +} + +// SentByClientID is the status and message ID of the send a client ID last named, or ErrNotFound. A cheap look +// before rate limits are spent; Reserve decides for real. +func (s *Store) SentByClientID(ctx context.Context, instanceID, clientID string) (status, messageID string, at time.Time, err error) { + var ms int64 + err = s.db.QueryRowContext(ctx, `SELECT status, message_id, at FROM send_log WHERE instance_id = ? AND client_id = ?`, + instanceID, clientID).Scan(&status, &messageID, &ms) + if errors.Is(err, sql.ErrNoRows) { + return "", "", time.Time{}, ErrNotFound + } + return status, messageID, time.UnixMilli(ms), err +} + +// BumpUsage adds one to a server's counter for the day. +func (s *Store) BumpUsage(ctx context.Context, instanceID string, at time.Time, field string) error { + return bump(ctx, s.db, instanceID, Day(at), field) +} + +func bump(ctx context.Context, db interface { + ExecContext(context.Context, string, ...any) (sql.Result, error) +}, instanceID, day, field string) error { + switch field { + case UsageSent, UsageRateLimited, UsageInvalidHandle: + default: + return fmt.Errorf("store: unknown usage field %q", field) + } + _, err := db.ExecContext(ctx, `INSERT INTO usage_daily (instance_id, day, `+field+`) VALUES (?, ?, 1) + ON CONFLICT (instance_id, day) DO UPDATE SET `+field+` = `+field+` + 1`, instanceID, day) + return err +} + +// Usage is one server's counters for one day. +type Usage struct { + Day string + Sent, RateLimited, InvalidHandles int +} + +// UsageFor returns a server's counters for the most recent days, newest first. +func (s *Store) UsageFor(ctx context.Context, instanceID string, days int) ([]Usage, error) { + rows, err := s.db.QueryContext(ctx, `SELECT day, sent, rate_limited, invalid_handle FROM usage_daily + WHERE instance_id = ? ORDER BY day DESC LIMIT ?`, instanceID, days) + if err != nil { + return nil, err + } + defer rows.Close() + var out []Usage + for rows.Next() { + var u Usage + if err := rows.Scan(&u.Day, &u.Sent, &u.RateLimited, &u.InvalidHandles); err != nil { + return nil, err + } + out = append(out, u) + } + return out, rows.Err() +} + +// SentToday is what a server has sent on the day. +func (s *Store) SentToday(ctx context.Context, instanceID string, at time.Time) (int, error) { + var n int + err := s.db.QueryRowContext(ctx, `SELECT coalesce(sum(sent), 0) FROM usage_daily WHERE instance_id = ? AND day = ?`, instanceID, Day(at)).Scan(&n) + return n, err +} + +// GlobalSentToday is what every server together has sent on the day. +func (s *Store) GlobalSentToday(ctx context.Context, at time.Time) (int, error) { + var n int + err := s.db.QueryRowContext(ctx, `SELECT coalesce(sum(sent), 0) FROM usage_daily WHERE day = ?`, Day(at)).Scan(&n) + return n, err +} + +// HandleSentSince counts what reached, or is on its way to, a handle since the time. +func (s *Store) HandleSentSince(ctx context.Context, handle string, since time.Time) (int, error) { + var n int + err := s.db.QueryRowContext(ctx, `SELECT count(*) FROM send_log WHERE handle = ? AND at >= ? AND status IN ('pending', 'ok')`, + handle, Ms(since)).Scan(&n) + return n, err +} + +// Retention periods. +const ( + SendLogKeep = 30 * 24 * time.Hour + RevokedHandleKeep = 30 * 24 * time.Hour + UsageKeep = 400 * 24 * time.Hour + TokenKeep = 24 * time.Hour // after expiry +) + +// Cleanup deletes what has outlived its retention period and releases abandoned pending sends. +func (s *Store) Cleanup(ctx context.Context, now time.Time) error { + tx, err := s.db.BeginTx(ctx, nil) + if err != nil { + return err + } + defer tx.Rollback() + if err := releaseStale(ctx, tx, now); err != nil { + return err + } + if err := tx.Commit(); err != nil { + return err + } + for _, q := range []struct { + sql string + arg any + }{ + {`DELETE FROM send_log WHERE at < ?`, Ms(now.Add(-SendLogKeep))}, + {`DELETE FROM handles WHERE revoked_at <> 0 AND revoked_at < ?`, Ms(now.Add(-RevokedHandleKeep))}, + {`DELETE FROM usage_daily WHERE day < ?`, Day(now.Add(-UsageKeep))}, + {`DELETE FROM email_tokens WHERE expires_at < ?`, Ms(now.Add(-TokenKeep))}, + } { + if _, err := s.db.ExecContext(ctx, q.sql, q.arg); err != nil { + return err + } + } + return nil +} diff --git a/internal/store/store_test.go b/internal/store/store_test.go new file mode 100644 index 0000000..c724872 --- /dev/null +++ b/internal/store/store_test.go @@ -0,0 +1,544 @@ +// Copyright 2026 Beacon Contributors +// SPDX-License-Identifier: AGPL-3.0-or-later + +package store + +import ( + "context" + "errors" + "path/filepath" + "sync" + "testing" + "time" +) + +func open(t *testing.T) *Store { + t.Helper() + s, err := Open(context.Background(), filepath.Join(t.TempDir(), "t.db")) + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { s.Close() }) + return s +} + +var t0 = time.Date(2026, 11, 17, 12, 0, 0, 0, time.UTC) + +func inst(id, email string) Instance { + return Instance{ID: id, Name: id, Email: email, SecretHash: []byte("h"), TermsVersion: 1, TermsAcceptedAt: Ms(t0), CreatedAt: Ms(t0)} +} + +func TestReopenKeepsSchema(t *testing.T) { + path := filepath.Join(t.TempDir(), "t.db") + ctx := context.Background() + s, err := Open(ctx, path) + if err != nil { + t.Fatal(err) + } + if err := s.CreateInstance(ctx, inst("inst_a", "a@x.org"), 2); err != nil { + t.Fatal(err) + } + s.Close() + s, err = Open(ctx, path) + if err != nil { + t.Fatal(err) + } + defer s.Close() + if _, err := s.Instance(ctx, "inst_a"); err != nil { + t.Fatal(err) + } +} + +func TestCreateInstanceLimitHoldsUnderRace(t *testing.T) { + s := open(t) + ctx := context.Background() + var wg sync.WaitGroup + errs := make(chan error, 6) + for i := 0; i < 6; i++ { + wg.Add(1) + go func(i int) { + defer wg.Done() + errs <- s.CreateInstance(ctx, inst("inst_"+string(rune('a'+i)), "same@x.org"), 2) + }(i) + } + wg.Wait() + close(errs) + ok := 0 + for err := range errs { + switch { + case err == nil: + ok++ + case !errors.Is(err, ErrLimit): + t.Fatal(err) + } + } + if n, _ := s.CountInstancesByEmail(ctx, "same@x.org"); ok != 2 || n != 2 { + t.Fatalf("created %d, stored %d", ok, n) + } +} + +func TestEmailTokenOnce(t *testing.T) { + s := open(t) + ctx := context.Background() + if err := s.CreateEmailToken(ctx, []byte("tok"), "register", "a@x.org", `{"name":"A"}`, t0.Add(time.Hour)); err != nil { + t.Fatal(err) + } + if _, _, err := s.ConsumeEmailToken(ctx, []byte("tok"), "login", t0); !errors.Is(err, ErrNotFound) { + t.Fatalf("wrong purpose: %v", err) + } + email, payload, err := s.ConsumeEmailToken(ctx, []byte("tok"), "register", t0) + if err != nil || email != "a@x.org" || payload != `{"name":"A"}` { + t.Fatalf("%q %q %v", email, payload, err) + } + if _, _, err := s.ConsumeEmailToken(ctx, []byte("tok"), "register", t0); !errors.Is(err, ErrNotFound) { + t.Fatalf("second use: %v", err) + } +} + +func TestHandleLifecycle(t *testing.T) { + s := open(t) + ctx := context.Background() + _ = s.CreateInstance(ctx, inst("inst_a", "a@x.org"), 2) + h1, err := s.UpsertHandle(ctx, "h_1", "inst_a", "ios", "tok", "sandbox", []byte("s1"), t0) + if err != nil || h1 != "h_1" { + t.Fatalf("%q %v", h1, err) + } + if h, _ := s.UpsertHandle(ctx, "h_2", "inst_a", "ios", "tok", "sandbox", []byte("s2"), t0); h != "h_1" { + t.Fatalf("same token: %q", h) + } + if got, _ := s.Handle(ctx, "h_1"); string(got.SecretHash) != "s2" { + t.Fatal("secret not replaced") + } + // A second handle that later refreshes onto the first one's token takes it over. + _, _ = s.UpsertHandle(ctx, "h_3", "inst_a", "android", "other", "", []byte("s3"), t0) + if err := s.RefreshHandleToken(ctx, "h_3", "inst_a", "tok", "", t0); err != nil { + t.Fatal(err) + } + if _, err := s.Handle(ctx, "h_1"); !errors.Is(err, ErrNotFound) { + t.Fatalf("the old holder of the token should be gone: %v", err) + } + if err := s.RevokeHandle(ctx, "h_3", t0); err != nil { + t.Fatal(err) + } + if n, _ := s.CountHandles(ctx, "inst_a"); n != 0 { + t.Fatalf("live handles %d", n) + } + if h, _ := s.UpsertHandle(ctx, "h_4", "inst_a", "android", "tok", "", []byte("s4"), t0); h != "h_4" { + t.Fatalf("a revoked registration must be replaced: %q", h) + } +} + +func TestUsageAndCleanup(t *testing.T) { + s := open(t) + ctx := context.Background() + _ = s.CreateInstance(ctx, inst("inst_a", "a@x.org"), 2) + _, _ = s.UpsertHandle(ctx, "h_1", "inst_a", "ios", "tok", "sandbox", []byte("s"), t0) + for i, at := range []time.Time{t0.Add(-40 * 24 * time.Hour), t0} { + id := "m_" + string(rune('a'+i)) + if o, _, err := s.Reserve(ctx, reservation(id, "h_1", "", at)); err != nil || o != Reserved { + t.Fatal(o, err) + } + if err := s.FinishSend(ctx, id, true, at); err != nil { + t.Fatal(err) + } + } + _ = s.BumpUsage(ctx, "inst_a", t0, UsageRateLimited) + if n, _ := s.SentToday(ctx, "inst_a", t0); n != 1 { + t.Fatalf("sent today %d", n) + } + if n, _ := s.GlobalSentToday(ctx, t0); n != 1 { + t.Fatalf("global %d", n) + } + if n, _ := s.HandleSentSince(ctx, "h_1", t0.Add(-time.Hour)); n != 1 { + t.Fatalf("handle %d", n) + } + if err := s.Cleanup(ctx, t0); err != nil { + t.Fatal(err) + } + var logRows int + _ = s.db.QueryRow(`SELECT count(*) FROM send_log`).Scan(&logRows) + if logRows != 1 { + t.Fatalf("send log rows after cleanup %d", logRows) + } + u, _ := s.UsageFor(ctx, "inst_a", 14) + if len(u) != 2 || u[0].Day != "2026-11-17" || u[0].Sent != 1 || u[0].RateLimited != 1 { + t.Fatalf("%+v", u) + } + if err := s.BumpUsage(ctx, "inst_a", t0, "sent; DROP TABLE x"); err == nil { + t.Fatal("unknown usage field accepted") + } +} + +func TestDomainCheckState(t *testing.T) { + s := open(t) + ctx := context.Background() + i := inst("inst_a", "a@x.org") + i.URL = "https://b.example.org" + _ = s.CreateInstance(ctx, i, 2) + if due, _ := s.DueForDomainCheck(ctx, t0); len(due) != 1 { + t.Fatalf("due %d", len(due)) + } + _ = s.SetDomainCheck(ctx, "inst_a", true, t0) + _ = s.SetDomainCheck(ctx, "inst_a", true, t0.Add(time.Hour)) + got, _ := s.Instance(ctx, "inst_a") + if got.DomainVerifiedAt != Ms(t0) || got.DomainCheckedAt != Ms(t0.Add(time.Hour)) { + t.Fatalf("%+v", got) + } + if due, _ := s.DueForDomainCheck(ctx, t0); len(due) != 0 { + t.Fatal("just checked, not due") + } + _ = s.SetDomainCheck(ctx, "inst_a", false, t0.Add(2*time.Hour)) + if got, _ := s.Instance(ctx, "inst_a"); got.DomainVerifiedAt != 0 { + t.Fatal("failure must clear verification") + } +} + +func reservation(msgID, handle, clientID string, at time.Time) Reservation { + return Reservation{MessageID: msgID, InstanceID: "inst_a", Handle: handle, ClientID: clientID, At: at, Size: 10, + CiphertextSHA256: []byte("x"), InstancePerDay: 100, GlobalPerDay: 100, HandlePerDay: 100} +} + +func TestReserveCountsPendingSends(t *testing.T) { + s := open(t) + ctx := context.Background() + _ = s.CreateInstance(ctx, inst("inst_a", "a@x.org"), 2) + _ = s.CreateInstance(ctx, inst("inst_b", "b@x.org"), 2) + _, _ = s.UpsertHandle(ctx, "h_1", "inst_a", "ios", "tok", "sandbox", []byte("s"), t0) + + // A pending send already holds the device's, the server's and the relay's quota. + r := reservation("m_1", "h_1", "", t0) + r.HandlePerDay = 1 + if o, _, _ := s.Reserve(ctx, r); o != Reserved { + t.Fatalf("first: %v", o) + } + r.MessageID = "m_2" + if o, _, _ := s.Reserve(ctx, r); o != OverHandleDay { + t.Fatalf("device cap with a pending send: %v", o) + } + r.HandlePerDay, r.InstancePerDay = 100, 1 + if o, _, _ := s.Reserve(ctx, r); o != OverInstanceDay { + t.Fatalf("server cap: %v", o) + } + r.InstancePerDay, r.GlobalPerDay = 100, 1 + if o, _, _ := s.Reserve(ctx, r); o != OverGlobalDay { + t.Fatalf("global cap: %v", o) + } + // A failed send gives its quota back. + if err := s.FinishSend(ctx, "m_1", false, t0); err != nil { + t.Fatal(err) + } + if n, _ := s.SentToday(ctx, "inst_a", t0); n != 0 { + t.Fatalf("released send still counted: %d", n) + } + if n, _ := s.HandleSentSince(ctx, "h_1", t0.Add(-time.Hour)); n != 0 { + t.Fatalf("failed send counted for the device: %d", n) + } + if o, _, _ := s.Reserve(ctx, r); o != Reserved { + t.Fatalf("after release: %v", o) + } + if err := s.SetStatus(ctx, "inst_a", StatusSuspended, nil, t0); err != nil { + t.Fatal(err) + } + r.MessageID, r.GlobalPerDay = "m_3", 100 + if o, _, _ := s.Reserve(ctx, r); o != NotActive { + t.Fatalf("suspended server reserved: %v", o) + } +} + +func TestReserveClientID(t *testing.T) { + s := open(t) + ctx := context.Background() + _ = s.CreateInstance(ctx, inst("inst_a", "a@x.org"), 2) + _, _ = s.UpsertHandle(ctx, "h_1", "inst_a", "ios", "tok", "sandbox", []byte("s"), t0) + if o, _, _ := s.Reserve(ctx, reservation("m_1", "h_1", "n1", t0)); o != Reserved { + t.Fatalf("%v", o) + } + if o, _, _ := s.Reserve(ctx, reservation("m_2", "h_1", "n1", t0.Add(time.Minute))); o != InFlight { + t.Fatalf("in flight: %v", o) + } + // An abandoned reservation counts as failed after the timeout and gives its quota back. + if o, id, _ := s.Reserve(ctx, reservation("m_3", "h_1", "n1", t0.Add(PendingTimeout+time.Second))); o != Reserved || id != "m_3" { + t.Fatalf("stale: %v %s", o, id) + } + if n, _ := s.SentToday(ctx, "inst_a", t0); n != 1 { + t.Fatalf("stale reservation still counted: %d", n) + } + if err := s.FinishSend(ctx, "m_3", true, t0); err != nil { + t.Fatal(err) + } + if o, id, _ := s.Reserve(ctx, reservation("m_4", "h_1", "n1", t0.Add(time.Hour))); o != AlreadySent || id != "m_3" { + t.Fatalf("repeat of a sent id: %v %s", o, id) + } + if o, _, _ := s.Reserve(ctx, reservation("m_5", "h_1", "n2", t0)); o != Reserved { + t.Fatalf("%v", o) + } + _ = s.FinishSend(ctx, "m_5", false, t0) + if o, _, _ := s.Reserve(ctx, reservation("m_6", "h_1", "n2", t0)); o != Reserved { + t.Fatalf("repeat of a failed id: %v", o) + } + // Another server may use the same id. + _ = s.CreateInstance(ctx, inst("inst_b", "b@x.org"), 2) + r := reservation("m_7", "h_1", "n1", t0) + r.InstanceID = "inst_b" + if o, _, _ := s.Reserve(ctx, r); o != Reserved { + t.Fatalf("other server: %v", o) + } +} + +func TestSuspendIfActiveKeepsABan(t *testing.T) { + s := open(t) + ctx := context.Background() + _ = s.CreateInstance(ctx, inst("inst_a", "a@x.org"), 2) + _ = s.SetStatus(ctx, "inst_a", StatusBanned, nil, t0) + if done, err := s.SuspendIfActive(ctx, "inst_a"); done || err != nil { + t.Fatalf("%v %v", done, err) + } + if i, _ := s.Instance(ctx, "inst_a"); i.Status != StatusBanned { + t.Fatalf("ban overwritten: %s", i.Status) + } + _ = s.SetStatus(ctx, "inst_a", StatusActive, nil, t0) + if done, _ := s.SuspendIfActive(ctx, "inst_a"); !done { + t.Fatal("active server not suspended") + } +} + +func TestRevokeHandleTokenNeedsTheSameRegistration(t *testing.T) { + s := open(t) + ctx := context.Background() + _ = s.CreateInstance(ctx, inst("inst_a", "a@x.org"), 2) + _, _ = s.UpsertHandle(ctx, "h_1", "inst_a", "ios", "tok-a", "sandbox", []byte("s"), t0) + first, _ := s.Handle(ctx, "h_1") + _ = s.RefreshHandleToken(ctx, "h_1", "inst_a", "tok-b", "production", t0.Add(time.Second)) + if err := s.RevokeHandleToken(ctx, first, t0); !errors.Is(err, ErrNotFound) { + t.Fatalf("old token revoked: %v", err) + } + // Only the environment changes. + cur, _ := s.Handle(ctx, "h_1") + _ = s.RefreshHandleToken(ctx, "h_1", "inst_a", "tok-b", "sandbox", t0.Add(2*time.Second)) + if err := s.RevokeHandleToken(ctx, cur, t0); !errors.Is(err, ErrNotFound) { + t.Fatalf("old environment revoked: %v", err) + } + // The same token and environment, registered again later. + cur, _ = s.Handle(ctx, "h_1") + _, _ = s.UpsertHandle(ctx, "h_2", "inst_a", "ios", "tok-b", "sandbox", []byte("s2"), t0.Add(3*time.Second)) + if err := s.RevokeHandleToken(ctx, cur, t0); !errors.Is(err, ErrNotFound) { + t.Fatalf("re-registered handle revoked: %v", err) + } + cur, _ = s.Handle(ctx, "h_1") + if err := s.RevokeHandleToken(ctx, cur, t0); err != nil { + t.Fatal(err) + } +} + +func TestStalePendingSendsAreReleased(t *testing.T) { + s := open(t) + ctx := context.Background() + _ = s.CreateInstance(ctx, inst("inst_a", "a@x.org"), 2) + _, _ = s.UpsertHandle(ctx, "h_1", "inst_a", "ios", "tok", "sandbox", []byte("s"), t0) + r := reservation("m_1", "h_1", "", t0) + r.HandlePerDay = 1 + if o, _, _ := s.Reserve(ctx, r); o != Reserved { + t.Fatalf("%v", o) + } + if err := s.Cleanup(ctx, t0.Add(time.Minute)); err != nil { + t.Fatal(err) + } + if n, _ := s.SentToday(ctx, "inst_a", t0); n != 1 { + t.Fatalf("a fresh pending send was released: %d", n) + } + if err := s.Cleanup(ctx, t0.Add(PendingTimeout+time.Second)); err != nil { + t.Fatal(err) + } + if n, _ := s.SentToday(ctx, "inst_a", t0); n != 0 { + t.Fatalf("stale pending send still counted: %d", n) + } + var status string + _ = s.db.QueryRow(`SELECT status FROM send_log WHERE message_id = 'm_1'`).Scan(&status) + if status != SendFailed { + t.Fatalf("status %q", status) + } + // Reserve releases them too, without waiting for cleanup. + r.MessageID, r.At = "m_2", t0.Add(time.Hour) + if o, _, _ := s.Reserve(ctx, r); o != Reserved { + t.Fatalf("%v", o) + } + r.MessageID, r.At = "m_3", t0.Add(time.Hour+PendingTimeout+time.Second) + if o, _, _ := s.Reserve(ctx, r); o != Reserved { + t.Fatalf("the device's quota is still held by a stale send: %v", o) + } +} + +func TestHandleKeepsItsAPNsEnvironment(t *testing.T) { + s := open(t) + ctx := context.Background() + _ = s.CreateInstance(ctx, inst("inst_a", "a@x.org"), 2) + if _, err := s.UpsertHandle(ctx, "h_1", "inst_a", "ios", "aa", "sandbox", []byte("s"), t0); err != nil { + t.Fatal(err) + } + if err := s.RefreshHandleToken(ctx, "h_1", "inst_a", "bb", "production", t0); err != nil { + t.Fatal(err) + } + if h, _ := s.Handle(ctx, "h_1"); h.Token != "bb" || h.APNsEnv != "production" || h.Platform != "ios" { + t.Fatalf("%+v", h) + } + if _, err := s.UpsertHandle(ctx, "h_2", "inst_a", "android", "cc", "", []byte("s"), t0); err != nil { + t.Fatal(err) + } + if h, _ := s.Handle(ctx, "h_2"); h.APNsEnv != "" { + t.Fatalf("%+v", h) + } + // The schema refuses an environment that does not fit the platform. + for _, c := range []struct{ platform, env string }{{"ios", ""}, {"ios", "staging"}, {"android", "sandbox"}} { + if _, err := s.UpsertHandle(ctx, "h_x", "inst_a", c.platform, "dd", c.env, []byte("s"), t0); err == nil { + t.Errorf("%s with %q stored", c.platform, c.env) + } + } +} + +func TestMigrationKeepsHandles(t *testing.T) { + path := filepath.Join(t.TempDir(), "old.db") + ctx := context.Background() + s, err := Open(ctx, path) + if err != nil { + t.Fatal(err) + } + // Roll the schema back to the last version with fcm_token, as a database from before APNs would be. + db := s.DB() + for _, q := range []string{ + `DROP TABLE handles`, + `CREATE TABLE handles ( + handle TEXT PRIMARY KEY, + secret_hash BLOB NOT NULL, + instance_id TEXT NOT NULL REFERENCES instances(id) ON DELETE CASCADE, + platform TEXT NOT NULL CHECK (platform IN ('ios', 'android')), + fcm_token TEXT NOT NULL, + created_at INTEGER NOT NULL, + refreshed_at INTEGER NOT NULL, + last_sent_at INTEGER NOT NULL DEFAULT 0, + revoked_at INTEGER NOT NULL DEFAULT 0, + UNIQUE (instance_id, fcm_token) + )`, + `PRAGMA user_version = 3`, + } { + if _, err := db.ExecContext(ctx, q); err != nil { + t.Fatal(err) + } + } + if err := s.CreateInstance(ctx, inst("inst_a", "a@x.org"), 2); err != nil { + t.Fatal(err) + } + for _, r := range []struct { + handle, platform, token string + revoked int64 + }{{"h_a", "android", "fcm-a", 0}, {"h_i", "ios", "fcm-i", 0}, {"h_r", "android", "fcm-r", 7}} { + if _, err := db.ExecContext(ctx, `INSERT INTO handles (handle, secret_hash, instance_id, platform, fcm_token, created_at, + refreshed_at, last_sent_at, revoked_at) VALUES (?, ?, 'inst_a', ?, ?, 1, 2, 3, ?)`, + r.handle, []byte("s-"+r.handle), r.platform, r.token, r.revoked); err != nil { + t.Fatal(err) + } + } + s.Close() + + s, err = Open(ctx, path) + if err != nil { + t.Fatal(err) + } + defer s.Close() + a, err := s.Handle(ctx, "h_a") + if err != nil || a.Token != "fcm-a" || a.APNsEnv != "" || string(a.SecretHash) != "s-h_a" || a.CreatedAt != 1 || + a.RefreshedAt != 2 || a.LastSentAt != 3 || a.RevokedAt != 0 { + t.Fatalf("%+v %v", a, err) + } + if r, _ := s.Handle(ctx, "h_r"); r.RevokedAt != 7 || r.Token != "fcm-r" { + t.Fatalf("%+v", r) + } + // A live iOS handle held an FCM token: it is kept but revoked, so the app registers again. + if i, _ := s.Handle(ctx, "h_i"); i.RevokedAt == 0 || i.Token != "fcm-i" || i.Platform != "ios" { + t.Fatalf("%+v", i) + } + // The unique pair and the cascade survived the rebuild. + if h, _ := s.UpsertHandle(ctx, "h_b", "inst_a", "android", "fcm-a", "", []byte("s"), t0); h != "h_a" { + t.Fatalf("same token got %q", h) + } + if _, err := s.DB().ExecContext(ctx, `DELETE FROM instances WHERE id = 'inst_a'`); err != nil { + t.Fatal(err) + } + if _, err := s.Handle(ctx, "h_a"); !errors.Is(err, ErrNotFound) { + t.Fatalf("handles outlived their server: %v", err) + } +} + +func TestDeleteInstance(t *testing.T) { + s := open(t) + ctx := context.Background() + for _, i := range []Instance{inst("inst_a", "op@x.org"), inst("inst_b", "op@x.org"), inst("inst_c", "c@x.org")} { + if err := s.CreateInstance(ctx, i, 2); err != nil { + t.Fatal(err) + } + } + for _, id := range []string{"inst_a", "inst_c"} { + if _, err := s.UpsertHandle(ctx, "h_"+id, id, "android", "tok", "", []byte("s"), t0); err != nil { + t.Fatal(err) + } + r := Reservation{MessageID: "m_" + id, InstanceID: id, Handle: "h_" + id, At: t0, Size: 1, CiphertextSHA256: []byte("c"), + InstancePerDay: 10, GlobalPerDay: 10, HandlePerDay: 10} + if out, _, err := s.Reserve(ctx, r); err != nil || out != Reserved { + t.Fatalf("reserve %s: %v %v", id, out, err) + } + if err := s.BumpUsage(ctx, id, t0, UsageRateLimited); err != nil { + t.Fatal(err) + } + } + if err := s.CreateInstance(ctx, inst("inst_d", "op@x.org"), 2); !errors.Is(err, ErrLimit) { + t.Fatalf("third server for one email: %v", err) + } + + if err := s.DeleteInstance(ctx, "inst_a"); err != nil { + t.Fatal(err) + } + if _, err := s.Instance(ctx, "inst_a"); !errors.Is(err, ErrNotFound) { + t.Fatalf("instance still there: %v", err) + } + for _, q := range []string{`SELECT count(*) FROM handles WHERE instance_id = ?`, `SELECT count(*) FROM send_log WHERE instance_id = ?`, + `SELECT count(*) FROM usage_daily WHERE instance_id = ?`} { + for id, want := range map[string]int{"inst_a": 0, "inst_c": 1} { + var n int + if err := s.DB().QueryRowContext(ctx, q, id).Scan(&n); err != nil || n != want { + t.Errorf("%s [%s]: %d rows, want %d (%v)", q, id, n, want, err) + } + } + } + if n, _ := s.CountInstancesByEmail(ctx, "op@x.org"); n != 1 { + t.Fatalf("email still holds %d servers", n) + } + if err := s.CreateInstance(ctx, inst("inst_d", "op@x.org"), 2); err != nil { + t.Fatalf("freed slot not usable: %v", err) + } + var bans int + if err := s.DB().QueryRowContext(ctx, `SELECT count(*) FROM banned_emails`).Scan(&bans); err != nil || bans != 0 { + t.Fatalf("ban list has %d rows (%v)", bans, err) + } + if err := s.DeleteInstance(ctx, "inst_a"); !errors.Is(err, ErrNotFound) { + t.Fatalf("second delete: %v", err) + } +} + +func TestInstancesByEmailAndSetSecret(t *testing.T) { + s := open(t) + ctx := context.Background() + _ = s.CreateInstance(ctx, inst("inst_a", "a@x.org"), 2) + _ = s.CreateInstance(ctx, inst("inst_b", "b@x.org"), 2) + list, err := s.InstancesByEmail(ctx, "a@x.org") + if err != nil || len(list) != 1 || list[0].ID != "inst_a" { + t.Fatalf("%+v %v", list, err) + } + if err := s.SetSecret(ctx, "inst_a", []byte("new")); err != nil { + t.Fatal(err) + } + if i, _ := s.Instance(ctx, "inst_a"); string(i.SecretHash) != "new" { + t.Fatalf("secret not set: %q", i.SecretHash) + } + if err := s.SetSecret(ctx, "inst_zz", []byte("x")); err != ErrNotFound { + t.Fatalf("unknown server: %v", err) + } +}