Forum: Ruby Net::Smtp error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ddbd8bc32e3a87163b4658b2785d2082?d=identicon&s=25 Mark Somerville (Guest)
on 2006-04-18 14:17
(Received via mailing list)
I'm using:

ruby 1.8.4 (2005-12-24) [i386-freebsd5]

I'm getting an error that I don't understand when using Net::Smtp. This
code
works for most messages I've tried:

Net::SMTP.start(@smtp_server, @smtp_port, @helo_domain) do |smtp|
  @users.each do |user|
    smtp.send_message(mail.to_s, mail.from.to_s, user.email)
  end
end

But fails with this error when some messages are sent (notably from
Outlook,
if that makes a difference):

  /usr/local/bin/ruby18
    /usr/local/lib/ruby/gems/1.8/gems/Rist-0.0.1/bin/receive.rb
    /home/mark/lists/io-devel/". Command output:
    /usr/local/lib/ruby/1.8/net/protocol.rb:244:in `write_message_0':
private
    method `sub' called for 143740984:Fixnum (NoMethodError)  from
    /usr/local/lib/ruby/1.8/net/protocol.rb:300:in `each_crlf_line'
from
    /usr/local/lib/ruby/1.8/net/protocol.rb:310:in `buffer_filling'
from
    /usr/local/lib/ruby/1.8/net/protocol.rb:308:in `buffer_filling'
from
    /usr/local/lib/ruby/1.8/net/protocol.rb:298:in `each_crlf_line'
from
    /usr/local/lib/ruby/1.8/net/protocol.rb:243:in `write_message_0'
from
    /usr/local/lib/ruby/1.8/net/protocol.rb:258:in `write_message'  from
    /usr/local/lib/ruby/1.8/net/protocol.rb:287:in
`using_each_crlf_line'
from
    /usr/local/lib/ruby/1.8/net/protocol.rb:257:in `write_message'   ...
10
    levels...  from /usr/local/lib/ruby/1.8/net/smtp.rb:316:in `start'
from
    /usr/local/lib/ruby/gems/1.8/gems/Rist-0.0.1/bin/../lib/rist/list.rb:163
:in
    `send_to_list'  from
    /usr/local/lib/ruby/gems/1.8/gems/Rist-0.0.1/bin/../lib/rist/list.rb:103
:in
    `process_mail'  from
    /usr/local/lib/ruby/gems/1.8/gems/Rist-0.0.1/bin/receive.rb:15


I don't know if this is a bug or something I'm doing wrong. Can anyone
let me
know what's happening?

Thanks a lot,

Mark
This topic is locked and can not be replied to.