'SMTP \'ehlo\' command.
Hostname to send for this command defaults to the FQDN of the local
host.'

def ehlo(self, name=''):

    self.esmtp_features = {}
    self.putcmd(self.ehlo_msg, (name or self.local_hostname))
    (code, msg) = self.getreply()
    if ((code == (-1)) and (len(msg) == 0)):
        self.close()
        raise SMTPServerDisconnected('Server    not    connected')
    self.ehlo_resp = msg
    if (code != 250):
        return (code, msg)
    self.does_esmtp = 1
    resp = self.ehlo_resp.split('\n')
    del resp[0]
    for each in resp:
        auth_match = OLDSTYLE_AUTH.match(each)
        if auth_match:
            self.esmtp_features['auth'] = ((self.esmtp_features.get('auth', '') + '    ') + auth_match.groups(0)[0])
            continue
        m = re.match('(?P<feature>[A-Za-z0-9][A-Za-z0-9\\-]*)    ?', each)
        if m:
            feature = m.group('feature').lower()
            params = m.string[m.end('feature'):].strip()
            if (feature == 'auth'):
                self.esmtp_features[feature] = ((self.esmtp_features.get(feature, '') + '    ') + params)
            else:
                self.esmtp_features[feature] = params
    return (code, msg)
