MCPcopy Index your code
hub / github.com/RustPython/RustPython / _deliver

Method _deliver

Lib/test/support/smtpd.py:748–770  ·  view source on GitHub ↗
(self, mailfrom, rcpttos, data)

Source from the content-addressed store, hash-verified

746 print('we got some refusals:', refused, file=DEBUGSTREAM)
747
748 def _deliver(self, mailfrom, rcpttos, data):
749 import smtplib
750 refused = {}
751 try:
752 s = smtplib.SMTP()
753 s.connect(self._remoteaddr[0], self._remoteaddr[1])
754 try:
755 refused = s.sendmail(mailfrom, rcpttos, data)
756 finally:
757 s.quit()
758 except smtplib.SMTPRecipientsRefused as e:
759 print('got SMTPRecipientsRefused', file=DEBUGSTREAM)
760 refused = e.recipients
761 except (OSError, smtplib.SMTPException) as e:
762 print('got', e.__class__, file=DEBUGSTREAM)
763 # All recipients were refused. If the exception had an associated
764 # error code, use it. Otherwise,fake it with a non-triggering
765 # exception code.
766 errcode = getattr(e, 'smtp_code', -1)
767 errmsg = getattr(e, 'smtp_error', 'ignore')
768 for r in rcpttos:
769 refused[r] = (errcode, errmsg)
770 return refused
771
772
773class Options:

Callers 1

process_messageMethod · 0.95

Calls 5

connectMethod · 0.95
sendmailMethod · 0.95
quitMethod · 0.95
getattrFunction · 0.85
printFunction · 0.50

Tested by

no test coverage detected