An Engineer's Blog

Back

Family document intake with paperless-ngxBlur image

Overview

The household pile is bills, tax documents, insurance letters, school forms, medical reports, and the receipts that feed expenditure tracking. The single-box homelab already runs paperless-ngx with OCR and full-text search; what it lacked was a way for the family to get paper into it. I set this up for my wife and my siblings, young enough to be tech savvy but not yet old enough to keep documents of their own; four people, one pile.

I stopped teaching anyone a new tool. Paperless-ngx accepts documents through two paths everyone already knows: a camera, and email. One family member scans straight from an iPhone, everyone else mails a single address, and per-sender rules sort out who owns what.

The engine

Paperless-ngx runs as its own unprivileged LXC in the homelab stack, alongside the password manager and the git server: a consumption directory, a database, OCR over everything that enters, then matching into correspondents, tags and document types.

The web interface is the service’s only public surface, behind the usual chain: Cloudflare Tunnel into Caddy for TLS, Authelia for single sign-on with two-factor. No inbound ports.

The scanner already in every pocket

For the family members least comfortable with technology, the intake tool is QuickScan ↗, a free iOS scanner app with no ads and no data collection. It earns the spot on three things:

  • the familiar iOS camera scan flow, with automatic document detection and angle correction
  • OCR runs entirely on the device and produces a searchable PDF before anything leaves the phone
  • paperless-ngx is a first-class export destination, so no WebDAV workaround sits in the middle

The workflow: point the camera at the letter, confirm the page borders, tap export. The app talks to the paperless-ngx server through its public hostname, authenticating with its own API token, per phone. No account to create, no folder to browse, no concept of a server at all.

One inbox for everyone

The second path is everyone else’s mail app. The family shares an iCloud+ subscription, and its custom domain support gives the household real addresses on its own domain, one of them a dedicated intake address. Any family member forwards or composes mail to it from any device and attaches the document. No subject, no message, nothing typed; the rules key on the sender address, and the household is lazy enough that this was a hard requirement. Scan with the built-in mail app camera, forward the school newsletter, photograph the lab result.

Inside paperless-ngx, a mail account polls that inbox over IMAP. Apple requires an app-specific password for third-party IMAP access, so the integration gets its own credential and nothing else in the Apple ID is exposed. Polling runs on the default ten-minute schedule (PAPERLESS_EMAIL_TASK_CRON if it ever needs tuning); each mail is checked against the rules and its attachments consumed.

For recurring senders, even forwarding is automated: iCloud Mail’s server-side rules move known senders into the family mailboxes as their mail arrives, which is how the electricity bill files itself without anyone touching a phone. Each rule is named for what it feeds.

iCloud Mail server-side rules routing recurring senders

The from address becomes ownership

Nobody is asked to classify anything; the classification comes from metadata the family cannot get wrong, who sent the mail. Each member has a mail rule keyed on their from address: the attachment is consumed, and the rule assigns the correspondent and the ownership that goes with it. Paperless-ngx’s own matching then fills in tags and document types by content.

A Maritime Electric bill, classified before anyone opened the app Correspondent, document type and owner assigned before anyone opened the app.

Paperless-ngx tracks processed messages by IMAP UID, so the same mail is never consumed twice, and Mail > Processed Mails doubles as an audit trail of what arrived and when. Rules can also delete or flag consumed mail so it does not pile up in the intake inbox.

Security posture

Neither path trusts a third party with the documents. The scan path is device OCR into a token-authenticated API behind Caddy and Authelia; the mail path is paperless-ngx pulling from iCloud over IMAP, an outbound connection with no listening service anywhere. Inside the perimeter, the usual homelab rules: unprivileged container, state on the ZFS pool, swept into the nightly backups and protected by the tuned Proxmox Backup Server datastore.

It is the balance Vaultwarden struck as the family password manager: secure enough for the household’s sensitive documents, friendly enough that nobody gives up at the login screen and leaves the important letters in a drawer. The family never sees the perimeter; they touch a camera button, an email address, and a sign-in they already use.

The app’s OIDC login

Per-phone tokens still need a first login, and that login was the one spot where the phone refused to behave like the browser. The app signs in through Authelia’s OpenID Connect flow, but a browser flow can keep a client secret on the server while a phone cannot. The first token exchange failed with invalid_client: the client registration did not allow the 'none' token endpoint auth method the app was sending.

QuickScan's token exchange rejected by Authelia

client_name: 'Paperless-ngx'
public: true                               # 1. MUST be true for mobile apps
authorization_policy: 'two_factor'
require_pkce: true                         # 2. MUST be true (keeps the flow secure without a secret)
redirect_uris:
  - 'x-paperless://oidc-callback'          # 3. The mobile app callback
token_endpoint_auth_method: 'none'         # 4. MUST be 'none' (Expects no client secret)
yaml

The loop closes at the printer, of all places. A Canon with AirPrint sits on the home network, so anyone at home can print wirelessly from any device. Away from home, AirPrint cannot reach across the internet, so the move is the tag: mark a document to-print in the archive and the automation leaves the page in the tray for whenever we walk back in.

Family document intake with paperless-ngx
https://tin.ng/blog/2025-09-19--paperless-ngx-family-document-intake
Author Tin Nguyen
Published at September 19, 2025
Comment seems to stuck. Try to refresh?✨