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

Method __init__

tools/python-3.11.9-amd64/Lib/smtpd.py:136–173  ·  view source on GitHub ↗
(self, server, conn, addr, data_size_limit=DATA_SIZE_DEFAULT,
                 map=None, enable_SMTPUTF8=False, decode_data=False)

Source from the content-addressed store, hash-verified

134 return self.command_size_limit
135
136 def __init__(self, server, conn, addr, data_size_limit=DATA_SIZE_DEFAULT,
137 map=None, enable_SMTPUTF8=False, decode_data=False):
138 asynchat.async_chat.__init__(self, conn, map=map)
139 self.smtp_server = server
140 self.conn = conn
141 self.addr = addr
142 self.data_size_limit = data_size_limit
143 self.enable_SMTPUTF8 = enable_SMTPUTF8
144 self._decode_data = decode_data
145 if enable_SMTPUTF8 and decode_data:
146 raise ValueError("decode_data and enable_SMTPUTF8 cannot"
147 " be set to True at the same time")
148 if decode_data:
149 self._emptystring = ''
150 self._linesep = '\r\n'
151 self._dotsep = '.'
152 self._newline = NEWLINE
153 else:
154 self._emptystring = b''
155 self._linesep = b'\r\n'
156 self._dotsep = ord(b'.')
157 self._newline = b'\n'
158 self._set_rset_state()
159 self.seen_greeting = ''
160 self.extended_smtp = False
161 self.command_size_limits.clear()
162 self.fqdn = socket.getfqdn()
163 try:
164 self.peer = conn.getpeername()
165 except OSError as err:
166 # a race condition may occur if the other end is closing
167 # before we can get the peername
168 self.close()
169 if err.errno != errno.ENOTCONN:
170 raise
171 return
172 print('Peer:', repr(self.peer), file=DEBUGSTREAM)
173 self.push('220 %s %s' % (self.fqdn, __version__))
174
175 def _set_post_data_state(self):
176 """Reset state variables to their post-DATA state."""

Callers

nothing calls this directly

Calls 7

_set_rset_stateMethod · 0.95
pushMethod · 0.95
getpeernameMethod · 0.80
printFunction · 0.50
__init__Method · 0.45
clearMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected