Skip to content
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

Allow unsigned & unencrypted incoming mails based on per-project activation setting #14

Open
ageis opened this issue Jan 28, 2016 · 2 comments
Labels

Comments

@ageis
Copy link

ageis commented Jan 28, 2016

Currently if "Valid signatures only" is enabled, all unencrypted+unsigned mail will be rejected, regardless of the per-project activation setting. If you're validating signatures, you cannot have a project which is intended to receive unencrypted email (by leaving the OpenPGP module disabled on it) at the same time.

The decryption method should ideally be aware of the whether the OpenPGP module is enabled on the target project of the email.

Because of the odd order of operations and my lack of aptitude with Ruby on Rails, I'm not sure whether it could be implemented without modifying core. One issue is that the target_project is apparently not available at the time of MailHandler's receive operation, only afterward. So we need to patch the MailHandler to decrypt the email, check the signature, get the target project, then check that project's per-project activation setting, and finally determine whether to accept or reject the email.

@ageis
Copy link
Author

ageis commented Jan 28, 2016

After studying mail_handler.rb in more detail, here's one approach to adding this feature: ageis@362ddaf

Notes:
The target_project seems to become accessible after running dispatch(), which then calls dispatch_to_default(), which simply calls receive_issue().
I'm using a global variable $invalid to store whether emails are valid between running the decryption module and checking the per-project settings in the new module. Don't know if there's a better way to do this.

@timegrid timegrid added the bug label Mar 17, 2017
@timegrid
Copy link
Member

I see. I'll take a look into your solution as soon as I catch up with your fork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants