Commit a0b8c19

mokha <mokha@cisco.com>
2019-03-03 20:24:39
add basic implementation or STARTTLS and RSET
1 parent e8712e0
Changed files (1)
lib
lib/minbox/client.rb
@@ -19,6 +19,8 @@ module Minbox
         when /^RCPT TO/i then rcpt_to(line)
         when /^DATA/i then data(line)
         when /^QUIT/i then quit
+        when /^STARTTLS/i then start_tls
+        when /^RSET/i then reset
         else
           logger.error(line)
           socket.puts('502 Invalid/unsupported command')
@@ -64,5 +66,14 @@ module Minbox
       _ehlo, _client_domain = line.split(" ")
       socket.puts "250 #{host}"
     end
+
+    def start_tls
+      socket.puts "502 TLS not available"
+    end
+
+    def reset
+      @body = []
+      socket.puts '250 OK'
+    end
   end
 end