    # File lib/vmail/imap_client.rb, line 685
        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)
            backup_sent_message mail
            "Message '#{mail.subject}' sent and saved to #{SENT_MESSAGES_FILE}"
          else
            "Failed to deliver message '#{mail.subject}'!"
          end
          log msg
          msg
        end