Roundcube Community Forum

 

paperless_attach – attach Paperless-ngx documents directly from the Roundcube co

Started by dodjango, June 02, 2026, 05:12:07 PM

Previous topic - Next topic

dodjango

What it is
I built a plugin that brings Paperless-ngx (a self-hosted document management system) into the Roundcube compose window: attach documents from Paperless directly while writing an email, instead of downloading and re-uploading them.

My typical use case: replying to an email and attaching a document I already have filed in Paperless — hit "Attach from Paperless", search, pick, send. 

What it does
 
  • "Attach from Paperless" button in the compose window
  • Search & filter by tags, correspondent, document type and date
  • Selected documents are fetched server-side and attached to the outgoing mail

Implementation notes
 
  • Roundcube 1.6, Elastic skin only; PHP 7.4+
  • Per-user API token stored encrypted (rcmail->encrypt/decrypt); the browser never sees the token or the Paperless base URL — all Paperless traffic is server-side
  • Attach happens at send time via the message_ready hook, so the download-induced session reload doesn't drop the attachment

Install
composer require dodjango/paperless_attach
Code & docs (GPL-3.0): github.com/dodjango/roundcube-paperless-attach

  Feedback welcome — issues and PRs appreciated.