Commit 2161cd3

mokha <mokha@cisco.com>
2019-03-03 20:40:37
work towards processing multiple emails in a single session.
1 parent ec3a66f
Changed files (2)
lib/minbox/cli.rb
@@ -18,7 +18,8 @@ module Minbox
         end
         require 'net/smtp'
         Net::SMTP.start(host, port) do |smtp|
-          smtp.send_message(mail.to_s, 'me@example.org', 'them@example.com')
+          smtp.send_message(mail.to_s, 'me+1@example.org', 'them+1@example.com')
+          #smtp.send_message(mail.to_s, 'me+2@example.org', 'them+2@example.com')
         end
       end
 
lib/minbox/client.rb
@@ -41,7 +41,7 @@ module Minbox
     def data(line)
       socket.puts "354 End data with <CR><LF>.<CR><LF>"
       line = socket.gets
-      until line.match(/^\.\r\n$/)
+      until line.nil? || line.match(/^\.\r\n$/)
         @body << line
         line = socket.gets
       end