jkraemer / mail-gpg

GPG/MIME extension for the Ruby Mail Library
MIT License
69 stars 24 forks source link

Sender encryption #21

Closed ilyakatz closed 6 years ago

ilyakatz commented 9 years ago

My attempt to fix https://github.com/jkraemer/mail-gpg/issues/20

ilyakatz commented 9 years ago

I see that I broke the build, but I can't really understand why. Any thoughts?

jkraemer commented 9 years ago

Don't know about the build - only 2.0 failed on travis, on my machine it works, maybe just a local Travis CI hickup.

However correct me if I'm wrong, but your patch seems incomplete and will actually not do anything as it is now. It is not enough to add the sender's key to the :keys array, you also have to add the actual sender of the mail to the array of email addresses that ends up as the :receivers option in GpgmeHelper::encrypt. Only then the sender's key will be picked up as an encryption target.

I think the best place to add the sender to that array would be in Mail::Gpg::encrypt.

ilyakatz commented 9 years ago

Oh, I didn't realize that. Ok, will take a look at how to rework this.