Skip to content

feat: configure certified mails for smime - #65973

Draft
mwinkens wants to merge 2 commits into
nextcloud:masterfrom
mwinkens:feature/smime-certified-mails
Draft

mwinkens wants to merge 2 commits into
nextcloud:masterfrom
mwinkens:feature/smime-certified-mails

Conversation

@mwinkens

Copy link
Copy Markdown

As a customer we always wanted nextcloud to be able to sign the emails send by the system or user_retention to be signed. It always bothered me, that this functionality doesn't exist, since symphony supports it with their SMimeSigner. Customer support told me, it's impossible to sign emails with nextcloud.

This PR contains 2 commits, the first one just adds the php-functionality and the second one the frontend code for configuring SMIME and making nextcloud send signed emails.

Summary

Implement signed emails with SMimeSigner and admin UI

TODO

  • verify it works (emails are now signed, hurray 🥳 )
  • cross read php lib files
  • cross read php tests
  • verify admin UI
  • cross read extended Vue-Elements. From a glance these look good
  • read the frontend tests
  • Add screenshot of the front-end change
  • Ask for help about the documentation checklist here. The documentation needs to be updated for 4 more config variables:
		'mail_smime_certificate' 
		'mail_smime_key' 
		'mail_smime_chain' 
		'mail_smime_passphrase'

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

The code of this PR is fully generated and the AI made use of the Agents.md file provided by nextcloud. The commits are also signed. I manually verified the php-code including the unit-tests. The provided s/mime certificate in the unit-tests is a self-signed freshly generated one.

The PR description is written by a human with a weird taste for dungeon-crawler books. I'll undraft it, when I finished verifying it's contents fully. I am willing to drop the second commit if it's unwanted and make this config.php only.

Sign outgoing messages with a configured S/MIME certificate when
mail_smime_certificate is set in the system configuration. The
private key (mail_smime_key), an optional key passphrase
(mail_smime_passphrase) and an optional certificate chain
(mail_smime_chain) are taken from the system configuration as well.

When a certificate is configured but signing fails, the exception
propagates out of send() so that no unsigned mail is delivered.

Assisted-by: opencode:blablador/90 - Qwen 3.8-27B on Juwels Booster
Allow administrators to configure S/MIME signing on the admin "Email
server" settings page: signing certificate path, private key path,
optional certificate chain path and an optional key passphrase.

The certificate path acts as the switch for signing; when it is left
empty, the remaining S/MIME values are cleared. Configured paths are
validated to exist and be readable. The key passphrase is stored via
a dedicated endpoint and is never exposed to the web interface in
plain text.

Assisted-by: opencode:blablador/90 - Qwen 3.8-27B on Juwels Booster

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant