Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.x+
-
Fix Version/s: JRuby 1.1RC1
-
Component/s: None
-
Labels:None
-
Environment:JRuby head. Two weeks ago or now January the 4th. Ubuntu Linux, java version "1.6.0_10-ea"
-
Testcase included:yes
-
Number of attachments :
Description
Unless you are able to reduce the test by inspecting what is sent by IO.popen, you need to set an msmtp server, for instance to send mails to your gmail account (don't you have a gmail account?). This should be simple.
so apt-get install msmtp.
Then make it work for gmail: edit or creat the .msmtprc file in your home directory and write inside:
account gmail
host smtp.gmail.com
auth on
user your_login@gmail.com
password your_password
tls on
tls_starttls on
tls_certcheck off
from your_login@gmail.com
maildomain gmail.com
Then try this in MRI and then in JRuby (also chekc your mail box):
s = "Date: Fri, 4 Jan 2008 01:00:05 +0100
From: livetribune@gmail.com
To: 'rvalyi@gmail.com' <rvalyi@gmail.com>
Subject: How good is JRuby?
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Look at your mail box to discover"
IO.popen("/usr/bin/msmtp -t -C /home/rvalyi/.msmtprc -a gmail --", "w") do |sm|
sm.puts(s.gsub(/\r/, ''))
sm.flush
end
if $? != 0
puts "failed to send mail errno #{$? >> 8}"
end
In MRI you should get nil and receive the e-mail while in JRuby, you would get no email and that error line in your terminal:
failed to send mail errno 143
Ant idea what is going wrong?
I think this is related to
JRUBY-1857andJRUBY-1557.The problem occurs when sending multiple parameters of certain types out through system exec using backtic, ruby's system and IO.popen.
JRUBY-1857andJRUBY-1557. The problem occurs when sending multiple parameters of certain types out through system exec using backtic, ruby's system and IO.popen.