MCPcopy Index your code
hub / github.com/python/cpython / smtp_RCPT

Method smtp_RCPT

Lib/test/support/smtpd.py:558–591  ·  view source on GitHub ↗
(self, arg)

Source from the content-addressed store, hash-verified

556 self.push('250 OK')
557
558 def smtp_RCPT(self, arg):
559 if not self.seen_greeting:
560 self.push('503 Error: send HELO first');
561 return
562 print('===> RCPT', arg, file=DEBUGSTREAM)
563 if not self.mailfrom:
564 self.push('503 Error: need MAIL command')
565 return
566 syntaxerr = '501 Syntax: RCPT TO: <address>'
567 if self.extended_smtp:
568 syntaxerr += ' [SP <mail-parameters>]'
569 if arg is None:
570 self.push(syntaxerr)
571 return
572 arg = self._strip_command_keyword('TO:', arg)
573 address, params = self._getaddr(arg)
574 if not address:
575 self.push(syntaxerr)
576 return
577 if not self.extended_smtp and params:
578 self.push(syntaxerr)
579 return
580 self.rcpt_options = params.upper().split()
581 params = self._getparams(self.rcpt_options)
582 if params is None:
583 self.push(syntaxerr)
584 return
585 # XXX currently there are no options we recognize.
586 if len(params.keys()) > 0:
587 self.push('555 RCPT TO parameters not recognized or not implemented')
588 return
589 self.rcpttos.append(address)
590 print('recips:', self.rcpttos, file=DEBUGSTREAM)
591 self.push('250 OK')
592
593 def smtp_RSET(self, arg):
594 if arg:

Callers

nothing calls this directly

Calls 8

pushMethod · 0.95
_getaddrMethod · 0.95
_getparamsMethod · 0.95
splitMethod · 0.45
upperMethod · 0.45
keysMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected