From 7e7757661aa4be4e38ffa1fd7aa96a36700f2cf4 Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Tue, 17 Jan 2012 14:25:12 +0000 Subject: Call uudecode via AlaveteliExternalCommand So do not rely on a hard-coded path. Also change the order of arguments and use /dev/stdout rather than -, so it works with the Mac/BSD version of uudecode as well as the Linux version. --- app/models/incoming_message.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'app/models') diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 2186d50dc..69a125770 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -738,9 +738,7 @@ class IncomingMessage < ActiveRecord::Base tempfile = Tempfile.new('foiuu') tempfile.print uu tempfile.flush - IO.popen("/usr/bin/uudecode " + tempfile.path + " -o -", "r") do |child| - content = child.read() - end + content = AlaveteliExternalCommand("uudecode", "-o", "/dev/stdout", tempfile.path) tempfile.close # Make attachment type from it, working out filename and mime type filename = uu.match(/^begin\s+[0-9]+\s+(.*)$/)[1] -- cgit v1.2.3