コード例 #1
0
ファイル: client.py プロジェクト: akatrevorjay/python-slimta
 def _check_replies(self, mailfrom, rcpttos, data):
     if mailfrom.is_error():
         raise SmtpRelayError.factory(mailfrom)
     for rcptto in rcpttos:
         if not rcptto.is_error():
             break
     else:
         raise SmtpRelayError.factory(rcpttos[0])
     if data.is_error():
         raise SmtpRelayError.factory(data)
コード例 #2
0
ファイル: client.py プロジェクト: akatrevorjay/python-slimta
 def _send_message_data(self, envelope):
     header_data, message_data = envelope.flatten()
     with Timeout(self.data_timeout):
         send_data = self.client.send_data(header_data, message_data)
     self.client._flush_pipeline()
     if send_data.is_error():
         raise SmtpRelayError.factory(send_data)
     return send_data
コード例 #3
0
ファイル: client.py プロジェクト: akatrevorjay/python-slimta
 def _starttls(self):
     with Timeout(self.command_timeout):
         starttls = self.client.starttls(self.tls)
     if starttls.is_error() and self.tls_required:
         raise SmtpRelayError.factory(starttls)
コード例 #4
0
ファイル: client.py プロジェクト: akatrevorjay/python-slimta
 def _ehlo(self):
     with Timeout(self.command_timeout):
         ehlo = self.client.ehlo(self.ehlo_as)
     if ehlo.is_error():
         raise SmtpRelayError.factory(ehlo)
コード例 #5
0
ファイル: client.py プロジェクト: akatrevorjay/python-slimta
 def _banner(self):
     with Timeout(self.command_timeout):
         banner = self.client.get_banner()
     if banner.is_error():
         raise SmtpRelayError.factory(banner)
コード例 #6
0
ファイル: client.py プロジェクト: akatrevorjay/python-slimta
 def _rcptto(self, rcpt):
     with Timeout(self.command_timeout):
         rcptto = self.client.rcptto(rcpt)
     if rcptto and rcptto.is_error():
         raise SmtpRelayError.factory(rcptto)
     return rcptto
コード例 #7
0
ファイル: client.py プロジェクト: akatrevorjay/python-slimta
 def _mailfrom(self, sender):
     with Timeout(self.command_timeout):
         mailfrom = self.client.mailfrom(sender)
     if mailfrom and mailfrom.is_error():
         raise SmtpRelayError.factory(mailfrom)
     return mailfrom