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

Method smtp_RCPT

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 10

pushMethod · 0.95
_getaddrMethod · 0.95
_getparamsMethod · 0.95
lenFunction · 0.85
printFunction · 0.50
splitMethod · 0.45
upperMethod · 0.45
keysMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected