MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _deliver

Method _deliver

tools/python-3.11.9-amd64/Lib/smtpd.py:758–780  ·  view source on GitHub ↗
(self, mailfrom, rcpttos, data)

Source from the content-addressed store, hash-verified

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

Callers 1

process_messageMethod · 0.95

Calls 4

connectMethod · 0.95
sendmailMethod · 0.95
quitMethod · 0.95
printFunction · 0.50

Tested by

no test coverage detected