SMTP: send EHLO only after reading the server's banner
There's a difference between connectin in a TLS mode from the very
beginning (aka connectToHostEncrypted()) and activating TLS on the fly
(STARTTLS). In the first case, the socket's encrypted() signal is
largely irrelevant, whereas it is actually important when using STARTTLS
upgrading. The EHLO should indeed be re-sent when STARTTLSing, but not
when the encrypted() signal gets fired just because we're finally
connected.
TL;DR: it's evil to send an EHLO prior to seeing the server's banner.
This is a bug in qwwsmtpclient.
Thanks to robn and to ctOS for reporting this.
Change-Id: Id981ed7a525715436063a6435635905b22b0df55