Project

General

Profile

Actions

Bug #13018

closed

end of file reached (EOFError) from SMTP

Added by tobymurray-nanometrics (Toby Murray) over 7 years ago. Updated almost 5 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.4.0preview3 (2016-11-07 trunk 56661) [x86_64-linux]
[ruby-core:78550]

Description

Originally filed against Rails: https://github.com/rails/rails/issues/27298

require 'net/smtp'

real_email_address = '' # This needs to actually be a real account
real_email_password = '' # This needs to actually be the corresponding password

#line 96 of mail-2.2.7/lib/mail/network/delivery_methods/smtp.rb
smtp = Net::SMTP.new('smtp-relay.gmail.com', 587)
smtp.enable_starttls_auto if smtp.respond_to?(:enable_starttls_auto)
# smtp.set_debug_output $stderr # Uncomment this line to see SMTP session details

smtp.start('does-not-matter', real_email_address, real_email_password, 'Login') do |smtp|
  smtp.sendmail('Message does not matter', 'inconsistent from address', 'does not matter')
end

Yields end of file reached (EOFError). From the discussion there, it seems like the SMTP relay is inappropriately killing the session, but I believe it should be wrapped in a different error - e.g. Net:SMTPError. As it stands, there's no stack trace available or this error, so it just appears and is difficult to find.

Tried with 2.4.0-preview3, 2.3.3, and 2.3.1 (as well as jruby-9.1.6.0) and all had the same behavior

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0