cutelyst / simple-mail

An SMTP library written in C++ for Qt. Allows applications to send emails (MIME with text, html, attachments, inline files, etc.) via SMTP. Supports SSL and SMTP authentication.
GNU Lesser General Public License v2.1
213 stars 64 forks source link

Add support for SMIME #101

Closed 640kb closed 3 months ago

640kb commented 4 months ago

Hello,

in these changes I have implemented support for signing and/or encrypting emails.

For this I have used OpenSSL. And currently you need a key or certificate in PKCS#12 format. With OpenSSL you should be able to generate a key yourself for testing. I have attached a demo application with which you can encrypt and sign emails.

I consider these changes only as a draft. I don't think the code is good yet and still needs some work. But I would like to collect feedback first.

Furthermore, support for signing/encrypting attachments is still missing. I would like to implement this in the near future. I might also include this extension in this pull request.

640kb commented 4 months ago

The support for attachments was not so difficult after all. The changes are now included in this pull request.

I also reworked the SMime class to make it easier to use.

640kb commented 4 months ago

I have corrected some minor bugs and partially combined the commits.

dantti commented 4 months ago

why are you not targeting master?

640kb commented 4 months ago

We have been using version 2 in our software for a long time, and since the branch is stable and tested by us, I wanted to have the extension in version 2.x.x first.

In a next step, I want to see if I can get the changes to work in the master branch and then also create a pull request.

Do you not want to include the extensions in the 2.x.x branch?