-
-
Notifications
You must be signed in to change notification settings - Fork 450
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
feat: support s/mime encryption #1946
base: master
Are you sure you want to change the base?
Conversation
except Exception as exceptasdf: | ||
LOG.w( | ||
"Cannot S/MIME encrypt message %s -> %s. %s %s", | ||
contact, | ||
alias, | ||
mailbox, | ||
user, | ||
) | ||
LOG.w(exceptasdf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, sorry; I can clean up this variable name and logging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Hi thanks a lot for making this PR and sorry for the late response! I'll ask our team to review the PR and come back to you at the beginning of 2024 (as most of the team is on holiday during Christmas :) ) |
Hey, thanks for the contribution. As a general rule we'd like to have tests for new code that's merged into the repo to make sure that:
Would you mind adding tests to it? |
@@ -2566,6 +2566,12 @@ class Mailbox(Base, ModelMixin): | |||
sa.Boolean, default=False, nullable=False, server_default="0" | |||
) | |||
|
|||
# smime | |||
smime_public_key = sa.Column(sa.Text, nullable=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this into a different model like MailboxSMimeKey
? We load mailboxes all the time from the db and the lighter they are, the better. We only need to load the key when we're about to use it.
url_for("dashboard.mailbox_detail_route", mailbox_id=mailbox_id) | ||
) | ||
|
||
mailbox.smime_public_key = request.form.get("smime") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you:
- Verify that this is a valid PEM file.
- Add a check that the key is not bigger than 15KiB? A PEM chain with several certs shouldn't be bigger than that.
Thanks for reviewing and commenting. I’ll take some time to address them due to limited bandwidth. Appreciate it! |
@schwigri Any updates on this? :) |
This is a highly desired feature especially for iOS users as discussed in #2174. Thanks @schwigri for tackling the implementation! The author of this PR seems to not have the capacity at the moment to follow up the code review. @acasajus, is there anything, to be done to pick up this pull request again? Would it be worth for me (new to the code base) to spend some of my free time on this, i.e. does this PR stand a chance to get merged in the near future? |
Hi, I use S/MIME to enable reading encrypted email using iOS and macOS Mail apps :) I've made this change and had it deployed on my own self-hosted instance, but thought I would share here. I've read through the contributing guide, but this is my first real PR so please let me know if there is anything I missed.
Also not sure if there should be other features considered (e.g. disable S/MIME for specific aliases like PGP, or some kind of fallback for S/MIME fails but fallback to PGP, etc.), so I don't really expect this will be merged immediately but thought it may be useful for others who may be interested in this feature. It could also be expanded to include signing, but for now it didn't seem necessary given the dynamic nature of the sending address.
Related to issue #527 and discussion #535!