Net::SMTP problems

Hi,

I’m trying to use Net::SMTP to send an email from a webserver running
Apache2. This bit of code is causing an error:

83 Net::SMTP.start(‘10.0.0.15’, 25) do |smtp|
84 smtp.send_message msgstr.untaint,
85 ‘[email protected]’.untaint,
86 email.untaint
87 end

Which causes a 500 error:

[Tue Oct 31 10:31:46 2006] [error] mod_ruby: error in ruby
[Tue Oct 31 10:31:46 2006] [error] mod_ruby:
/usr/lib/ruby/1.8/timeout.rb:54:in new': execution expired (Timeout::Error) [Tue Oct 31 10:31:46 2006] [error] mod_ruby: from /usr/lib/ruby/1.8/net/protocol.rb:206:inold_open’
[Tue Oct 31 10:31:46 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/timeout.rb:56:in timeout' [Tue Oct 31 10:31:46 2006] [error] mod_ruby: from /usr/lib/ruby/1.8/timeout.rb:76:intimeout’
[Tue Oct 31 10:31:46 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/net/protocol.rb:206:in old_open' [Tue Oct 31 10:31:46 2006] [error] mod_ruby: from /usr/lib/ruby/1.8/net/smtp.rb:393:indo_start’
[Tue Oct 31 10:31:46 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/net/smtp.rb:378:in start' [Tue Oct 31 10:31:46 2006] [error] mod_ruby: from /usr/lib/ruby/1.8/net/smtp.rb:316:instart’
[Tue Oct 31 10:31:46 2006] [error] mod_ruby: from
/var/www/mysite/eruby/create.rhtml:83
[Tue Oct 31 10:31:46 2006] [error] mod_ruby: from (eval):0
[Tue Oct 31 10:31:46 2006] [error] mod_ruby: from
/usr/lib/ruby/1.8/apache/eruby-run.rb:116:in run' [Tue Oct 31 10:31:46 2006] [error] mod_ruby: from /usr/lib/ruby/1.8/apache/eruby-run.rb:72:inhandler’

Line 83 of create.rhtml is the first line of the code at the top of the
email.

The variables email and msgstr contain valid strings (correct email
addresses)

10.0.0.15 is definitely the address of the mail server, which runs
smtpd. I can send and receive emails using mail and mutt from
internal and external programs with no problem. I have port scanned
using nmap and port 25 is open.

Anyone have any ideas? Any pointers much appreciated,

Nick

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs