Repository navigation
Conversation
Add the signed_copy_mail policy (disabled by default). When enabled for the requester, a completed request queues one mail per recipient in the notification delivery outbox: - each signer the requester chose with the new sendSignedCopy signer field (a switch in the signer editor); - the optional archive addresses configured in the policy. For an envelope each recipient gets one mail with all of their documents: a signer gets the documents they signed, archive addresses get every document. The delivery key is derived from the request and the recipient, so a repeated completion never mails a recipient twice. The DeliverNotification job reads the signed PDFs at send time. When the documents of one mail exceed 15 MiB, or a signed file cannot be read, the mail links to the validation page instead. Signed-off-by: no84by <50858621+no84by@users.noreply.github.com>
|
Thanks for opening your first pull request in this repository! ✌️ |
|
Overview of a related set of changes, each reviewable on its own:
Screenshots for the UI changes follow in each PR. |
|
Screenshots (test instance on main 7a8403d vs this branch, light and dark theme): Policy card "Email the signed document" (enabled, archive addresses)
Add-signer dialog: new switch
Mail after the last signature: signed PDF attached
Link fallback for a large document
Rule dialog with the switch and archive addresses
|
vitormattos
left a comment
There was a problem hiding this comment.
Thank you for implementing this feature. The ability to notify selected signers when a signing workflow is complete is useful, but we would like to revise one fundamental part of the proposed behavior before merging.
LibreSign should not automatically distribute completed signed PDFs as email attachments. We prefer sending a link to the LibreSign validation experience.
There are two main reasons:
- Confidentiality and access control: Once a PDF is emailed as an attachment, LibreSign cannot revoke access to that copy. A server-hosted document allows future access to be controlled, subject to appropriate authorization checks.
- Signature validation experience: Some PDF readers may report warnings when the signer's certificate chain is not trusted by the reader. Directing recipients to LibreSign's validation experience helps present the document's verification information in the appropriate context.
However, simply changing the current attachment fallback into the default is not sufficient. The existing public validation URL is not a recipient-specific, revocable access grant, and private-validation settings can prevent external recipients from opening it.
Please revise the design toward link-only completion notifications, with the following constraints:
- Do not attach PDF content to completion emails.
- Ensure that access to the document is authorized and that newly issued access links can be revoked or expire where required.
- Preserve per-document access boundaries for envelopes; a signer must not gain access to unrelated documents merely because they share an envelope.
- Keep this feature separate from institutional archival, since an email containing a link does not create an archived copy.
- Respect the notification preferences of Nextcloud account holders.
- Add focused tests for normal access, unauthorized access, revoked access, external signers, and envelopes with different signer/document associations.
The existing notification delivery outbox, deduplication and completion event handling may still be reusable. We would prefer to preserve those parts while simplifying the mail payload and removing the attachment-specific implementation.
This is a product-design requirement rather than a criticism of the implementation effort.
















Resolves: #9545
Related: #7986 (separate completion notifications), #8497 (completion callback).
Summary
Adds an opt-in way to mail the fully signed PDF after the last signature. Today only the requester gets a "document signed" link.
signed_copy_mail(system/group/user, disabled by default):{"enabled": bool, "archive_addresses": [..]}.sendSignedCopy(API + a switch in the signer editor, shown only while the policy is enabled for the requester).SigningRequestCompletedEvent, one delivery per recipient is registered in the notification delivery outbox (signed_copyevent,mailchannel) and sent byDeliverNotification, so attempts are recorded, lost jobs are recovered byRecoverPendingNotifications, and the outcome webhook applies. Chosen signers get the documents they signed, archive addresses get every document; for an envelope this is one mail per recipient with all of their documents.Existing installs: nothing changes until an admin enables the policy.
How to test
Validation evidence
SignedCopyMailServiceTestincl. a repeated completion,SignedCopyAttachmentProviderTest,NotificationChannelsTest,SignedCopyMailPolicyTest,SignedCopyMailPolicyValueTest,SignedCopyMailListenerTest, new cases inMailServiceTest,RequestSignatureServiceTest,FileListServiceTest; Vitest specs for the policy module,IdentifySigner, files store)ts:check, eslint,lint:translator-hints)UI / Front-end changes
New policy card "Email the signed document" (switch + archive addresses field)
New switch in the signer editor
Screenshots before/after added for user-visible changes
Component/unit (Vitest) tests added or updated
Documentation updated when applicable
API / Back-end changes
sendSignedCopyonNewSigner(request) and on signer details (returned only to the requester)composer openapiChecklist
AI (if applicable)