Skip to content

[Mailer][Mime] Refactor S/MIME encryption handling in SMimeEncryptionListener #20935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 7.3
Choose a base branch
from

Conversation

alamirault
Copy link
Contributor

Fix #20827

Having a SmimeCertificateRepositoryInterface implementation is a good thing I think.
I don't really how to introduce it.

@javiereguiluz
Copy link
Member

I don't know much about this 🙏 but the previous example looked pretty convenient.

Is it really a bad practice? If it's not, maybe we can show both alternatives?

@alamirault
Copy link
Contributor Author

I thinks it's ok, but I don't really know others possible implementations

@javiereguiluz
Copy link
Member

Let's ask @Spomky. Could you please tell us if the example currently shown on Symfony Docs works and is valid? If it is, I think we should display both the current example and the new proposed ones (so folks don't overcomplicate things when not necessary). Thanks!

@Spomky
Copy link
Contributor

Spomky commented May 7, 2025

Hi @alamirault and @javiereguiluz,

Yes, the example looks good.
The storage strategy is entirely up to the developers and in this example it is simply a folder-based approach.

The purpose of the SmimeCertificateRepositoryInterface is to resolve the certificate file path for a given email address, as the S/MIME encrypter expects a valid local file path to the certificate.

;
};

The ``repository`` option must be a service ID that implements
:class:`Symfony\\Component\\Mailer\\EventListener\\SmimeCertificateRepositoryInterface`::

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of the method SmimeCertificateRepositoryInterface::findCertificatePathFor is to resolve the certificate file path for a given email address, as the S/MIME encrypter expects a valid local file path to the certificate.

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.

[Mailer][Mime] Refactor S/MIME encryption handling in `SMimeEncryptionL…
4 participants