def get_banner(self): """Waits for the SMTP banner at the beginning of the connection. :returns: |Reply| object populated with the response. """ banner = Reply(command='[BANNER]') banner.enhanced_status_code = False self.reply_queue.append(banner) self._flush_pipeline() return banner
def helo(self, helo_as): """Sends the HELO command with identifier string and waits for the reply. :param helo_as: HELO identifier string, usually an FQDN. :returns: |Reply| object populated with the response. """ helo = Reply(command='HELO') helo.enhanced_status_code = False self.reply_queue.append(helo) command = 'HELO '+helo_as self.io.send_command(command) self._flush_pipeline() return helo
def ehlo(self, ehlo_as): """Sends the EHLO command with identifier string and waits for the reply. When this method returns, the ``self.extensions`` object will also be populated with the SMTP extensions the server supports. :param ehlo_as: EHLO identifier string, usually an FQDN. :returns: |Reply| object populated with the response. """ ehlo = Reply(command='EHLO') ehlo.enhanced_status_code = False self.reply_queue.append(ehlo) command = 'EHLO '+ehlo_as self.io.send_command(command) self._flush_pipeline() if ehlo.code == '250': self.extensions.reset() ehlo.message = self.extensions.parse_string(ehlo.message) return ehlo