0

I have a script that's a plugin for redmine which enhances the application to send encrypted mail using gpg. At some point this stopped working. Unfortunately the one who wrote that script is not available anymore and I am an admin with only very limited knowledge of RoR.

The problem is, that obviously the script creates a file with the mail body, saves it to temp, encrypts it to an output file, reads this output and then sends the mail.

With an empty /tmp directory (such as after rebooting the whole server), the gpg.in file gets created when I try to send a test mail. But then I get an error that the gpg.out file was not available. Creating it using touch does cause an empty email being send so obviously the script does not write anything to that file.

File.open('/tmp/gpg.in', 'w') do |f1| #<--- Works, file is created
f1.puts(body)
end
list_of_keys = [ rec ]
Gpgr::Encrypt.file('/tmp/gpg.in', :to => '/tmp/gpg.out').encrypt_using(list_of_keys) #<- gpg.out wird nicht erzeugt.
text = "" 
File.open('/tmp/gpg.out', 'r') do |f2| #<- throws file not found error, if file not there. When file was created empty using touch, it sends an empty mail

With my limited RoR knowledge, I can't figure out how to debug this. Permissions on /tmp are 777 so the script should be allowed to write there and obviously has because File.open('/tmp/gpg.in', 'w') works correctly all the time without an error. Hence I expect the problem in Gpgr::Encrypt.file not working correctly, but I also don't get any error from that function it fails silently.

  • Is it some plugin available on github? And what's your Redmine version? – Aleksandar Pavić Jan 17 '17 at 11:00
  • I think the gem the creator used is this one https://github.com/gmcmillan/gpgr Redmine version is 2.5.1.stable –  Jan 17 '17 at 11:09
  • and plugin which uses it is proprietary or he modified your Redmine core stuff? – Aleksandar Pavić Jan 17 '17 at 11:16
  • Well as far as I know he didn't touch the core stuff, he used the plugin folder to write a patch. I don't know if this requires modification of the core –  Jan 17 '17 at 12:00

0 Answers0