Skip to main content

A bridge between SMTP and the Paperless API

Project description

SMTP2Paperless

NOTE: when I refer to "paperless" I always mean paperless-ngx, since that is the only relevant version of paperless today.

What?

A "SMTP to Paperless API" proxy. You configure your document scanner to send scans as emails via SMTP to this software with a recipient of <paperless-token>@<paperless-domain> and the proxy will forward the attached scans to the Paperless API's document post endpoint of the chosen paperless instance.

The proxy is stateless, it simply looks at the recipient of the received message to determine where to post the document to. The paperless domain must be in a whitelist to be the target of the proxy (this is to stop anyone from abusing the proxy to send post requests to arbitrary domains, since there is no additional authentication happening).

The proxy must be hosted with TLS to avoid leaking the Paperless API tokens send in the recipient fields.

Why?

I wanted a document scanner that could scan directly to the Paperless API's document post endpoint, but apparently there is none (some Doxie scanner can allegedly do this, but as far as I know it is not officially supported). Since many scanners can send scans by email SMTP sounded like the next best thing. I didn't want to add a mailbox as a "man-in-the-middle" though (and use paperless' IMAP feature), since I would either have to self-host that or be fine with a third-party receiving all of my physical mail and other scans on top of my normal email. That seemed a bit unnecessary. So I built a simple "SMTP to Paperless API" proxy instead.

How?

smtp2paperless --host <host> --port <port> --cert <cert-file> --key <key-file> --allowed_domains <paperless-domain>

Make it a systemd service or do whatever else you do to run your services.

Then configure your scanner to send mails via the SMTP proxy at your IP and chosen port. No authentication required.

Last, add a recipient address in the format <paperless-token>@<paperless-domain> to your scanners address book and send a scan to that address. It should now show up on your paperless instance.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smtp2paperless-0.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

smtp2paperless-0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file smtp2paperless-0.tar.gz.

File metadata

  • Download URL: smtp2paperless-0.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for smtp2paperless-0.tar.gz
Algorithm Hash digest
SHA256 8a5b1683dfacaa394f383789e8ffc3895e5533bbc7fcdbd8dd6669835f7cfd52
MD5 187a5e02fc49959671101330a693b55d
BLAKE2b-256 c871ead89dd8eddde71e9562ee8ba788b9ef30da654f5457560f510740283486

See more details on using hashes here.

File details

Details for the file smtp2paperless-0-py3-none-any.whl.

File metadata

  • Download URL: smtp2paperless-0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for smtp2paperless-0-py3-none-any.whl
Algorithm Hash digest
SHA256 f220f8829e03a2adcefa58af8e006c20215316c8b781618c2f6b8c5f19932f09
MD5 3aebf62a43700dfd0b7ed90aab6cfe29
BLAKE2b-256 9f6d0f1d3a152d0b2f3b8da6981b9f96dc8cd27e0b430a931714d87bea64516c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page