    # File lib/vmail/imap_client.rb, line 667
        def deliver(text)
          # parse the text. The headers are yaml. The rest is text body.
          require 'net/smtp'
          # prime_connection
          mail = new_mail_from_input(text)
          mail.delivery_method(*smtp_settings)
          res = mail.deliver!
          log res.inspect
          log "\n"
          msg = if res.is_a?(Mail::Message)
            "message '#{mail.subject}' sent"
          else
            "failed to deliver message '#{mail.subject}'"
          end
          log msg
          msg
        end