python (3.11.7)

(root)/
lib/
python3.11/
test/
__pycache__/
test_smtpd.cpython-311.pyc

eߢ>ddlZddlZddlmZmZddlmZddlmZddlZddl	Z	ej
dZej
dZej
sejdGdd	ejZGd
deZGdd
eZGddejZGddejZGddejZGddejZGddejZGddejZejejdGddeZGddejZGdd ejZGd!d"ejZ Gd#d$ejZ!Gd%d&ejZ"e#d'krej$dSdS)(N)supportmock_socket)
socket_helper)warnings_helpersmtpdasyncoreztest requires gethostname()ceZdZdZdZdS)DummyServercvtjj|g|Ri|g|_|jr	d|_dSd|_dS)Nz
return statuss
return status)r
SMTPServer__init__messages_decode_data
return_status)selfargskwargss   C/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/test_smtpd.pyr
zDummyServer.__init__sT
!$8888888
	2!0D!1Dc|j||||f||jkrdSd|vrd|dvrdSdSdS)Nz	250 Okishmail_optionsSMTPUTF8z250 SMTPUTF8 message okish)rappendr)rpeermailfromrcpttosdatakws      rprocess_messagezDummyServer.process_messagesb
dHgt<===4%%%;RJ"^2D$D$D// $D$DrN)__name__
__module____qualname__r
rrrr
r
s222200000rr
ceZdZdS)DummyDispatcherBrokenN)r r!r"r#rrr%r%"sDrr%ceZdZdZdS)BrokenDummyServerctN)r%)rnums  rlistenzBrokenDummyServer.listen's#%%%rN)r r!r"r+r#rrr'r'&s#&&&&&rr'c&eZdZdZdZdZdZdS)SMTPDServerTestc@txt_t_dSr)rrsocketrrs rsetUpzSMTPDServerTest.setUp,)44xrc^ttjdfdd}|\}}t|||dfd}|d|d|d|d	|t|d
dS)NrbrTdecode_datacdj|dSr)r0
queue_recvhandle_readlinechannels r
write_linezFSMTPDServerTest.test_process_message_unimplemented.<locals>.write_line51N%%d+++!!!!!rHELO exampleMAIL From:eggs@exampleRCPT To:spam@exampleDATAs	spam
.
)rrrHOSTacceptSMTPChannelassertRaisesNotImplementedError)rserverconnaddrr@r?s     @r"test_process_message_unimplementedz2SMTPDServerTest.test_process_message_unimplemented/s!!=#5q"98.2"44]]__
d##FD$D#II	"	"	"	"	"	
?###
,---
*+++
7-z;KLLLLLrcr|ttjtjdfddddS)Nrr5Tenable_SMTPUTF8r8)rI
ValueErrorrrrrFr1s r+test_decode_data_and_enable_SMTPUTF8_raisesz;SMTPDServerTest.test_decode_data_and_enable_SMTPUTF8_raises?sF

# 
						rcrttxt_t_dSr)r	close_allr0rr1s rtearDownzSMTPDServerTest.tearDownH&)//%,,,rN)r r!r"r2rNrSrWr#rrr-r-+sS555MMM 00000rr-c:eZdZdZd
dZdZdZdZdZdZ	d	S)DebuggingServerTestc@txt_t_dSr)r/r1s rr2zDebuggingServerTest.setUpOr3rFcfd}|d|r|dn|d|d|d|||ddS)Ncdj|dSr)r:r=s rr@z1DebuggingServerTest.send_data.<locals>.write_lineSrArEHLO examples-MAIL From:eggs@example BODY=8BITMIME SMTPUTF8rCrDrE.r#)rr?rrQr@s `   r	send_datazDebuggingServerTest.send_dataRs	"	"	"	"	"	
?###	2JGHHHHJ0111
*+++
7
4
4rcttjdfdd}|\}}t|||d}t
j5}||ddddn#1swxYwY|	}|
|tjddS)Nrr5Tr7sFrom: test

hello
z             ---------- MESSAGE FOLLOWS ----------
             From: test
             X-Peer: peer-address

             hello
             ------------ END MESSAGE ------------
             
rDebuggingServerrrFrGrHrcaptured_stdoutr`getvalueassertEqualtextwrapdedentrrKrLrMr?sstdouts       r*test_process_message_with_decode_data_truez>DebuggingServerTest.test_process_message_with_decode_data_true`s&&
(:A'>37'99]]__
d##FD$D#II

$
&
&	>!NN7$<===	>	>	>	>	>	>	>	>	>	>	>	>	>	>	>2""					2BBBcttjdfd}|\}}t|||}t
j5}||ddddn#1swxYwY|	}|
|tjddS)Nrr5From: test

héllo
             ---------- MESSAGE FOLLOWS ----------
             b'From: test'
             b'X-Peer: peer-address'
             b''
             b'h\xc3\xa9llo\xff'
             ------------ END MESSAGE ------------
             rbris       r+test_process_message_with_decode_data_falsez?DebuggingServerTest.test_process_message_with_decode_data_falseqs&&
(:A'>II]]__
d##FD$77

$
&
&	I!NN7$GHHH	I	I	I	I	I	I	I	I	I	I	I	I	I	I	I2""					s.BBBcttjdfdd}|\}}t|||d}t
j5}||ddddn#1swxYwY|	}|
|tjddS)Nrr5TrQrorprbris       r.test_process_message_with_enable_SMTPUTF8_truezBDebuggingServerTest.test_process_message_with_enable_SMTPUTF8_trues"&&
(:A'>7;'==]]__
d##FD$#MM

$
&
&	I!NN7$GHHH	I	I	I	I	I	I	I	I	I	I	I	I	I	I	I2""					rmcttjdfdd}|\}}t|||d}t
j5}||dddddn#1swxYwY|	}|
|tjddS)Nrr5Trsroa             ---------- MESSAGE FOLLOWS ----------
             mail options: ['BODY=8BITMIME', 'SMTPUTF8']
             b'From: test'
             b'X-Peer: peer-address'
             b''
             b'h\xc3\xa9llo\xff'
             ------------ END MESSAGE ------------
             rbris       r7test_process_SMTPUTF8_message_with_enable_SMTPUTF8_truezKDebuggingServerTest.test_process_SMTPUTF8_message_with_enable_SMTPUTF8_trues"&&
(:A'>7;'==]]__
d##FD$#MM

$
&
&	1!NN7$G+/

1
1
1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	12""					s2BBBcrttxt_t_dSr)rUr1s rrWzDebuggingServerTest.tearDownrXrN)F)
r r!r"r2r`rlrqrtrvrWr#rrrZrZMs555" "&00000rrZc^eZdZdZdZejejddZ	dZ
dS)TestFamilyDetectionc@txt_t_dSr)r/r1s rr2zTestFamilyDetection.setUpr3rcrttxt_t_dSr)rUr1s rrWzTestFamilyDetection.tearDownrXrIPv6 not enabledcttjdftjdf}||jjtjdSNr)	rrrHOSTv6HOSTv4rfr0familyAF_INET6rrKs  rtest_socket_uses_IPv6z)TestFamilyDetection.test_socket_uses_IPv6sK!!=#7";m>RTU=VWW-v?????rcttjdftjdf}||jjtjdSr~)	rrrrrrfr0rAF_INETrs  rtest_socket_uses_IPv4z)TestFamilyDetection.test_socket_uses_IPv4sK!!=#7";m>RTU=VWW-v~>>>>>rN)r r!r"r2rWunittest
skipUnlessrIPV6_ENABLEDrrr#rrryryst555000X35GHH@@IH@?????rryc0eZdZdZdZdZdZdZdZdS)TestRcptOptionParsing:555 RCPT TO parameters not recognized or not implemented
ctxt_t_tj|_t
jx|_t_dSr)	rrr0rDEBUGSTREAMold_debugstreamioStringIOdebugr1s rr2zTestRcptOptionParsing.setUp6)44x$0)+6
U&&&rcttxt_t_|jt_dSr)rrVr0rrrr1s rrWzTestRcptOptionParsing.tearDown3)//%, 0rcb|j||dSr)r:rr?r>s   rr@z TestRcptOptionParsing.write_line0!!$'''rcrttjdfd}|\}}t|||}||d||d||d||jj	|j
dS)Nrr5r^$MAIL from: <foo@example.com> size=20s"RCPT to: <foo@example.com> foo=barr
rrFrGrrHr@rfr0lasterror_responserrKrLrMr?s     rtest_params_rejectedz*TestRcptOptionParsing.test_params_rejectedsm0!4h??]]__
d##FD$77111!HIII!FGGG,d.ABBBBBrchttjdfd}|\}}t|||}||d||d||d||jj	ddS)Nrr5r^rsRCPT to: <foo@example.com>250 OK

r
rrFrGrrHr@rfr0rrs     rtest_nothing_acceptedz+TestRcptOptionParsing.test_nothing_acceptedsm0!4h??]]__
d##FD$77111!HIII!>???,m<<<<<rN)	r r!r"rr2rWr@rrr#rrrrsi)N777
111
CCC=====rrc6eZdZdZdZdZdZdZdZdZ	dS)	TestMailOptionParsing<555 MAIL FROM parameters not recognized or not implemented
ctxt_t_tj|_t
jx|_t_dSr)rr1s rr2zTestMailOptionParsing.setUprrcttxt_t_|jt_dSr)rr1s rrWzTestMailOptionParsing.tearDownrrcb|j||dSr)r:rs   rr@z TestMailOptionParsing.write_linerrcttjdfdd}|\}}t|||d}||ddD]=}|||||jj	|j
>||d||jj	ddS)	Nrr5Tr7r^)-MAIL from: <foo@example.com> size=20 SMTPUTF8;MAIL from: <foo@example.com> size=20 SMTPUTF8 BODY=8BITMIMEs1MAIL from: <foo@example.com> size=20 BODY=UNKNOWN2MAIL from: <foo@example.com> size=20 body=8bitmimerrrrrKrLrMr?r>s      rtest_with_decode_data_truez0TestMailOptionParsing.test_with_decode_data_truesm0!4hDQQQ]]__
d##FD$D#II111
	G	GD
OOGT***W^0$2EFFFF!HIII,m<<<<<rc(ttjdfd}|\}}t|||}||ddD]=}|||||jj	|j
>||d||jj	d||d||jj	ddS)	Nrr5r^)rrs:MAIL from: <foo@example.com> size=20 SMTPUTF8 BODY=UNKNOWNs3501 Error: BODY can only be one of 7BIT, 8BITMIME
rrrrs      rtest_with_decode_data_falsez1TestMailOptionParsing.test_with_decode_data_falses(m0!4h??]]__
d##FD$77111
	G	GD
OOGT***W^0$2EFFFFI	K	K	K	
ND	F	F	F	
J	L	L	L,m<<<<<rcDttjdfdd}|\}}t|||d}||d||d||jj	ddS)Nrr5Trsr^s;MAIL from: <foo@example.com> size=20 body=8bitmime smtputf8rrrs     rtest_with_enable_smtputf8_truez4TestMailOptionParsing.test_with_enable_smtputf8_truesm0!4hPTUUU]]__
d##FD$#MM111J	L	L	L	
,m<<<<<rN)
r r!r"rr2rWr@rrrr#rrrrsu)N777
111
=== ===*=====rrceZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4d3Z5d4Z6d5Z7d6Z8d7Z9d8Z:d9Z;d:Z<d;Z=d<Z>d=Z?d>Z@d?ZAd@ZBdAZCdBZDdCZEdDS)ESMTPDChannelTestcxtxt_t_tj|_t
jx|_t_ttjdfdd|_|j
\}}t|j||d|_dSNrr5Tr7rrr0rrrrrrr
rrFrKrGrHr?rrLrMs   rr2zSMTPDChannelTest.setUp$s)44x$0)+6
U&!=#5q"98.2444[''))
d((dD59);;rcttxt_t_|jt_dSr)rr1s rrWzSMTPDChannelTest.tearDown.rrcv|jj||jdSr)r?r0r;r<rr>s  rr@zSMTPDChannelTest.write_line35&&t,,,  """""rcf|tttjdfdddSr)rIr%r'rrFr1s rtest_broken_connectz$SMTPDChannelTest.test_broken_connect7sC!#4

#X4		A	A	A	A	Arc	|ttj|j|jj|jjdddS)NTrP)rIrRrrHrKr?rLrMr1s rrSz<SMTPDChannelTest.test_decode_data_and_enable_SMTPUTF8_raises<sI)K*DL,= d		4	4	4	4	4rc8|jdSr))rK
handle_acceptr1s rtest_server_acceptz#SMTPDChannelTest.test_server_acceptBs!!#####rcz|d||jjjddS)Nrs500 Error: bad syntax
r@rfr?r0rr1s rtest_missing_dataz"SMTPDChannelTest.test_missing_dataEsC,15	7	7	7	7	7rcz|d||jjjddS)Nr^s
250 HELP
rr1s r	test_EHLOzSMTPDChannelTest.test_EHLOJs8(((,1?CCCCCrcz|d||jjjddS)NsEHLOs501 Syntax: EHLO hostname
rr1s rtest_EHLO_bad_syntaxz%SMTPDChannelTest.test_EHLO_bad_syntaxNC   ,19	;	;	;	;	;rc|d|d||jjjddS)Nr^503 Duplicate HELO/EHLO
rr1s rtest_EHLO_duplicatez$SMTPDChannelTest.test_EHLO_duplicateSU((((((,17	9	9	9	9	9rc|d|d||jjjddS)Nr^rBrrr1s rtest_EHLO_HELO_duplicatez)SMTPDChannelTest.test_EHLO_HELO_duplicateYrrctj}|d||jjjd|ddS)NrBz250 {}
ascii)	rr0getfqdnr@rfr?rformatencode)rnames  r	test_HELOzSMTPDChannelTest.test_HELO_sw|##%%(((,1%,,T2299'BB	D	D	D	D	Drc|d|d||jjjddS)NrBr^rrr1s rtest_HELO_EHLO_duplicatez)SMTPDChannelTest.test_HELO_EHLO_duplicateerrcz|d||jjjddS)NsHELPsF250 Supported commands: EHLO HELO MAIL RCPT DATA RSET NOOP QUIT VRFY
rr1s r	test_HELPzSMTPDChannelTest.test_HELPksE   ,19	:	:	:	:	:rcz|d||jjjddS)Ns	HELP MAILs"250 Syntax: MAIL FROM: <address>
rr1s rtest_HELP_commandz"SMTPDChannelTest.test_HELP_commandqsH%%%,1@	B	B	B	B	Brcz|d||jjjddS)Ns	HELP SPAMsF501 Supported commands: EHLO HELO MAIL RCPT DATA RSET NOOP QUIT VRFY
rr1s rtest_HELP_command_unknownz*SMTPDChannelTest.test_HELP_command_unknownvsE%%%,19	:	:	:	:	:rcz|d||jjjddS)NsHELOs501 Syntax: HELO hostname
rr1s rtest_HELO_bad_syntaxz%SMTPDChannelTest.test_HELO_bad_syntax|rrc|d|d||jjjddS)NrBrrr1s rtest_HELO_duplicatez$SMTPDChannelTest.test_HELO_duplicaterrcd|_|d|d||jjjddS)NFrBs%MAIL from:<foo@example.com> SIZE=1234"501 Syntax: MAIL FROM: <address>
)
extended_smtpr@rfr?r0rr1s r8test_HELO_parameter_rejected_when_extensions_not_enabledzISMTPDChannelTest.test_HELO_parameter_rejected_when_extensions_not_enabledsc"(((@AAA,1@	B	B	B	B	Brc|d|d||jjjddS)NrBsMAIL from:   <foo@example.com>rrr1s r"test_MAIL_allows_space_after_colonz3SMTPDChannelTest.test_MAIL_allows_space_after_colonsV(((9:::,1&	(	(	(	(	(rc|d|d||jjjddS)Nr^s&MAIL from:   <foo@example.com> size=20rrr1s r+test_extended_MAIL_allows_space_after_colonz<SMTPDChannelTest.test_extended_MAIL_allows_space_after_colonsV(((ABBB,1&	(	(	(	(	(rcz|d||jjjddS)NNOOPrrr1s r	test_NOOPzSMTPDChannelTest.test_NOOPs8   ,1=AAAAArc|d|d||jjjddS)NrBrrrr1s rtest_HELO_NOOPzSMTPDChannelTest.test_HELO_NOOPJ(((   ,1=AAAAArcz|d||jjjddS)NsNOOP his501 Syntax: NOOP
rr1s rtest_NOOP_bad_syntaxz%SMTPDChannelTest.test_NOOP_bad_syntaxsC
###,10	2	2	2	2	2rcz|d||jjjddS)NQUIT	221 Bye
rr1s r	test_QUITzSMTPDChannelTest.test_QUITs8   ,1>BBBBBrc|d|d||jjjddS)NrBrrrr1s rtest_HELO_QUITzSMTPDChannelTest.test_HELO_QUITsJ(((   ,1>BBBBBrcz|d||jjjddS)NsQUIT bye byerrr1s rtest_QUIT_arg_ignoredz&SMTPDChannelTest.test_QUIT_arg_ignoreds8(((,1>BBBBBrcd|j_|d||jjjddS)Nz	BAD STATErBs451 Internal confusion
)r?
smtp_stater@rfr0rr1s rtest_bad_statezSMTPDChannelTest.test_bad_statesM"-(((,16	8	8	8	8	8rc|d|dd|jjzzdz||jjjddS)NrBsMAIL from: as@example500 Error: line too long
)r@r?command_size_limitrfr0rr1s rtest_command_too_longz&SMTPDChannelTest.test_command_too_longsw(((t|>>?#$	%	%	%	
,18	:	:	:	:	:rcz|d|jjtdz
}|dd|zzdz||jjjd|dd|dzzzdz||jjjddS)	Nr^zMAIL from:<@example>MAIL from:<rs@example> SIZE=1234rr)r@r?rlenrfr0rrfill_lens  r*test_MAIL_command_limit_extended_with_SIZEz;SMTPDChannelTest.test_MAIL_command_limit_extended_with_SIZEs(((<2S9O5P5PPx(./	0	0	0	
,1=AAA2
././	0	0	0	
,18	:	:	:	:	:rc|d|d||jjjddddS)Nr^s5MAIL from: <naive@example.com> BODY=8BITMIME SMTPUTF8r5rr1s r-test_MAIL_command_rejects_SMTPUTF8_by_defaultz>SMTPDChannelTest.test_MAIL_command_rejects_SMTPUTF8_by_defaults](((D	F	F	F,1!A#6=====rcZd|j_|d|d|d|d|d|jjzdz||jjjddS)	NrBrCrDrEAsA
.552 Error: Too much mail data
r?data_size_limitr@rfr0rr1s r-test_data_longer_than_default_data_size_limitz>SMTPDChannelTest.test_data_longer_than_default_data_size_limits'+$(((1222/000   t|;;!"	#	#	#,1=	?	?	?	?	?rc|d|d||jjjddS)Nr^s!MAIL FROM:<eggs@example> SIZE=512rrr1s rtest_MAIL_size_parameterz)SMTPDChannelTest.test_MAIL_size_parametersV(((<===,1&	(	(	(	(	(rc|d|d||jjjddS)Nr^s%MAIL FROM:<eggs@example> SIZE=invalid9501 Syntax: MAIL FROM: <address> [SP <mail-parameters>]
rr1s r test_MAIL_invalid_size_parameterz1SMTPDChannelTest.test_MAIL_invalid_size_parameters[(((@AAA,1J	L	L	L	L	LrcB|d|d||jjjd|d|d||jjjddS)Nr^s"MAIL FROM:<eggs@example> ham=greenrsMAIL FROM:<eggs@example>s RCPT TO:<eggs@example> ham=greenrrr1s r!test_MAIL_RCPT_unknown_parametersz2SMTPDChannelTest.test_MAIL_RCPT_unknown_parameterss(((=>>>,1M	O	O	O	
3444;<<<,1K	M	M	M	M	Mrcd|j_|d|d||jjjddS)Nrr^s"MAIL FROM:<eggs@example> SIZE=2096s<552 Error: message size exceeds fixed maximum message size
rr1s r<test_MAIL_size_parameter_larger_than_default_data_size_limitzMSMTPDChannelTest.test_MAIL_size_parameter_larger_than_default_data_size_limitse'+$(((=>>>,1M	O	O	O	O	Orc|d|d||jjjddS)NrBsRCPT to:spam@examples503 Error: need MAIL command
rr1s rtest_need_MAILzSMTPDChannelTest.test_need_MAILsV(((/000,1/	1	1	1	1	1rc|d|d||jjjddS)NrBMAIL from eggs@examplerrr1s rtest_MAIL_syntax_HELOz&SMTPDChannelTest.test_MAIL_syntax_HELOsV(((1222,13	5	5	5	5	5rc|d|d||jjjddS)Nr^r'rrr1s rtest_MAIL_syntax_EHLOz&SMTPDChannelTest.test_MAIL_syntax_EHLO
s[(((1222,1J	L	L	L	L	Lrc|d|d||jjjddS)NrBs
MAIL from:rrr1s rtest_MAIL_missing_addressz*SMTPDChannelTest.test_MAIL_missing_addresssU(((
&&&,13	5	5	5	5	5rc|d|d||jjjddS)NrBsMAIL from:<eggs@example>rrr1s rtest_MAIL_chevronsz#SMTPDChannelTest.test_MAIL_chevronssK(((3444,1=AAAAArc|d|d||jjjddS)Nr^sMAIL from:<>rrr1s rtest_MAIL_empty_chevronsz)SMTPDChannelTest.test_MAIL_empty_chevronssJ((((((,1=AAAAArc|d|d||jjjd||jjddS)Nr^s%MAIL from: <"Fred Blogs"@example.com>r"Fred Blogs"@example.comr@rfr?r0rrr1s rtest_MAIL_quoted_localpartz+SMTPDChannelTest.test_MAIL_quoted_localpart#sg(((@AAA,1=AAA.0JKKKKKrc|d|d||jjjd||jjddS)Nr^s#MAIL from: "Fred Blogs"@example.comrr2r3r1s r$test_MAIL_quoted_localpart_no_anglesz5SMTPDChannelTest.test_MAIL_quoted_localpart_no_angles)sg(((>???,1=AAA.0JKKKKKrc|d|d||jjjd||jjddS)Nr^s/MAIL from: <"Fred Blogs"@example.com> SIZE=1000rr2r3r1s r$test_MAIL_quoted_localpart_with_sizez5SMTPDChannelTest.test_MAIL_quoted_localpart_with_size/sg(((JKKK,1=AAA.0JKKKKKrc|d|d||jjjd||jjddS)Nr^s-MAIL from: "Fred Blogs"@example.com SIZE=1000rr2r3r1s r.test_MAIL_quoted_localpart_with_size_no_anglesz?SMTPDChannelTest.test_MAIL_quoted_localpart_with_size_no_angles5sg(((HIII,1=AAA.0JKKKKKrc|d|d|d||jjjddS)NrBsMAIL from:eggs@examplesMAIL from:spam@examples 503 Error: nested MAIL command
rr1s rtest_nested_MAILz!SMTPDChannelTest.test_nested_MAIL;si(((12221222,11	3	3	3	3	3rcz|d||jjjddS)NsVRFY eggs@examplesD252 Cannot VRFY user, but will accept message and attempt delivery
rr1s r	test_VRFYzSMTPDChannelTest.test_VRFYBsF,---,1
					rcz|d||jjjddS)NsVRFYs501 Syntax: VRFY <address>
rr1s rtest_VRFY_syntaxz!SMTPDChannelTest.test_VRFY_syntaxHsC   ,1-	/	/	/	/	/rcz|d||jjjddS)NsEXPNs502 EXPN not implemented
rr1s rtest_EXPN_not_implementedz*SMTPDChannelTest.test_EXPN_not_implementedMsC   ,1+	-	-	-	-	-rcz|d||jjjddS)NsMAIL from:<foo@example.com>503 Error: send HELO first
rr1s rtest_no_HELO_MAILz"SMTPDChannelTest.test_no_HELO_MAILRsD6777,1:	<	<	<	<	<rc|d|d|d||jjjddS)NrBrCrEs503 Error: need RCPT command
rr1s rtest_need_RCPTzSMTPDChannelTest.test_need_RCPTWsh(((1222   ,1/	1	1	1	1	1rc|d|d|d||jjjddS)NrBMAIL From: eggs@exampleRCPT to eggs@examples 501 Syntax: RCPT TO: <address>
rr1s rtest_RCPT_syntax_HELOz&SMTPDChannelTest.test_RCPT_syntax_HELO^si(((2333/000,11	3	3	3	3	3rc|d|d|d||jjjddS)Nr^rIrJs7501 Syntax: RCPT TO: <address> [SP <mail-parameters>]
rr1s rtest_RCPT_syntax_EHLOz&SMTPDChannelTest.test_RCPT_syntax_EHLOesn(((2333/000,1H	J	J	J	J	Jrc|d|d|d||jjjddS)NrBrIsRCPT to: <eggs@example>rrr1s rtest_RCPT_lowercase_to_OKz*SMTPDChannelTest.test_RCPT_lowercase_to_OKls^(((23332333,1=AAAAArcz|d||jjjddS)NrJrDrr1s rtest_no_HELO_RCPTz"SMTPDChannelTest.test_no_HELO_RCPTrsD/000,1:	<	<	<	<	<rcL|d|d||jjjd|d||jjjd|d||jjjd|d||jjjd||jjdd	d
gdfgdSNrBrCrrDrE%354 End data with <CR><LF>.<CR><LF>
s
data
more
.zpeer-addressz	peer-porteggs@examplespam@examplez	data
morer@rfr?r0rrKrr1s rtest_data_dialogz!SMTPDChannelTest.test_data_dialogw (((1222,1=AAA/000,1=AAA   ,16	8	8	8,---,1=AAA-+
					rc|d|d|d|d||jjjddS)NrBrCrD	DATA spams501 Syntax: DATA
rr1s rtest_DATA_syntaxz!SMTPDChannelTest.test_DATA_syntaxsq(((1222/000%%%,13JKKKKKrcz|d||jjjddS)Nr\rDrr1s rtest_no_HELO_DATAz"SMTPDChannelTest.test_no_HELO_DATAsC%%%,1:	<	<	<	<	<rc|d|d|d|d|d||jjddS)NrBrCrDrEs..
.
.r@rfr?
received_datar1s r$test_data_transparency_section_4_5_2z5SMTPDChannelTest.test_data_transparency_section_4_5_2s(((1222/000   '''3S99999rcP|d|d|d|d|d|d||jjddd	d
gdfgdS)NrBrCrDsRCPT To:ham@examplerEdata
.rUrVrWzham@exampler)r@rfrKrr1s rtest_multiple_RCPTz#SMTPDChannelTest.test_multiple_RCPTs(((1222/000.///   %%%-+m,
					rc"|d|d|d|d|d||jjjddS)NrBrCrDrEsreturn status
.s250 Okish
rr1s rtest_manual_statusz#SMTPDChannelTest.test_manual_statuss(((1222/000   -...,13CDDDDDrc|d|d|d|d||jjjd|d|d|d|d	||jjd
ddgd
fgdS)NrBrCrDRSETrsMAIL From:foo@examplesRCPT To:eggs@examplerErfrUzfoo@examplerVrrXr1s r	test_RSETzSMTPDChannelTest.test_RSETs(((1222/000   ,1=AAA0111/000   %%%-+
					rc|d|d||jjjddS)NrBrkrrr1s rtest_HELO_RSETzSMTPDChannelTest.test_HELO_RSETrrcz|d||jjjddS)NsRSET his501 Syntax: RSET
rr1s rtest_RSET_syntaxz!SMTPDChannelTest.test_RSET_syntaxs9
###,13JKKKKKrcz|d||jjjddS)NsUNKNOWN_CMDs1500 Error: command "UNKNOWN_CMD" not recognized
rr1s rtest_unknown_commandz%SMTPDChannelTest.test_unknown_commandsE''',1+	,	,	,	,	,rc
tjdtf5|jj}dddn#1swxYwYtjdtf5d|j_dddn#1swxYwYtjdtf5|jj}dddn#1swxYwYtjdtf5d|j_dddn#1swxYwYtjdtf5|jj}dddn#1swxYwYtjdtf5d|j_dddn#1swxYwYtjdtf5|jj}dddn#1swxYwYtjdtf5d|j_dddn#1swxYwYtjdtf5|jj}dddn#1swxYwYtjdtf5d|j_dddn#1swxYwYtjdtf5|jj	}dddn#1swxYwYtjdtf5d|j_	dddn#1swxYwYtjdtf5|jj
}dddn#1swxYwYtjdtf5d|j_
dddn#1swxYwYtjdtf5|jj}dddn#1swxYwYtjdtf5d|j_dddn#1swxYwYtjdtf5|jj}dddn#1swxYwYtjdtf5d|j_dddn#1swxYwYtjdtf5|jj
}dddn#1swxYwYtjdtf5d|j_
dddn#1swxYwYtjdtf5|jj}dddn#1swxYwYtjdtf5d|j_ddddS#1swxYwYdS)Nspam)rcheck_warningsDeprecationWarningr?_SMTPChannel__server_SMTPChannel__line_SMTPChannel__state_SMTPChannel__greeting_SMTPChannel__mailfrom_SMTPChannel__rcpttos_SMTPChannel__data_SMTPChannel__fqdn_SMTPChannel__peer_SMTPChannel__conn_SMTPChannel__addr)rrus  rtest_attribute_deprecationsz,SMTPDChannelTest.test_attribute_deprecationss5


+R1C,D
E
E	5	5<4D	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5

+R1C,D
E
E	7	706DL-	7	7	7	7	7	7	7	7	7	7	7	7	7	7	7

+R1C,D
E
E	3	3<2D	3	3	3	3	3	3	3	3	3	3	3	3	3	3	3

+R1C,D
E
E	5	5.4DL+	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5

+R1C,D
E
E	4	4<3D	4	4	4	4	4	4	4	4	4	4	4	4	4	4	4

+R1C,D
E
E	6	6/5DL,	6	6	6	6	6	6	6	6	6	6	6	6	6	6	6

+R1C,D
E
E	7	7<6D	7	7	7	7	7	7	7	7	7	7	7	7	7	7	7

+R1C,D
E
E	9	928DL/	9	9	9	9	9	9	9	9	9	9	9	9	9	9	9

+R1C,D
E
E	7	7<6D	7	7	7	7	7	7	7	7	7	7	7	7	7	7	7

+R1C,D
E
E	9	928DL/	9	9	9	9	9	9	9	9	9	9	9	9	9	9	9

+R1C,D
E
E	6	6<5D	6	6	6	6	6	6	6	6	6	6	6	6	6	6	6

+R1C,D
E
E	8	817DL.	8	8	8	8	8	8	8	8	8	8	8	8	8	8	8

+R1C,D
E
E	3	3<2D	3	3	3	3	3	3	3	3	3	3	3	3	3	3	3

+R1C,D
E
E	5	5.4DL+	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5

+R1C,D
E
E	3	3<2D	3	3	3	3	3	3	3	3	3	3	3	3	3	3	3

+R1C,D
E
E	5	5.4DL+	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5

+R1C,D
E
E	3	3<2D	3	3	3	3	3	3	3	3	3	3	3	3	3	3	3

+R1C,D
E
E	5	5.4DL+	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5

+R1C,D
E
E	3	3<2D	3	3	3	3	3	3	3	3	3	3	3	3	3	3	3

+R1C,D
E
E	5	5.4DL+	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5

+R1C,D
E
E	3	3<2D	3	3	3	3	3	3	3	3	3	3	3	3	3	3	3

+R1C,D
E
E	5	5.4DL+	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5	5s
599
A44A8;A8
B33B7:B7
C22C69C6
D11D58D5
E00E47E4
F//F36F3
G..G25G2
H--H14H1
I,,I03I0
J++J/2J/
K**K.1K.
L))L-0L-
M((M,/M,
N''N+.N+

O&&O*-O*
P%%P),P)
Q$$Q(+Q(

R##R'*R'	
S""S&)S&
T!!T%(T%
U!!U%(U%N)Fr r!r"r2rWr@rrSrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr!r#r%r(r*r,r.r0r4r6r8r:r<r>r@rBrErGrKrMrOrQrYr]r_rdrgrirlrnrprrrr#rrrr#sO;;;111
###AAA
444$$$777
DDD;;;
999999DDD999:::BBB
:::;;;
999BBB((((((BBBBBB
222
CCCCCC
CCC888::::::>>>
?
?
?(((LLL	M	M	MOOO111555LLL555BBB
BBB
LLLLLLLLLLLL333///
---
<<<
111333JJJBBB<<<
$LLL<<<
:::EEE BBB
LLL,,,,5,5,5,5,5rrr|ceZdZdZdS)SMTPDChannelIPv6Testcxtxt_t_tj|_t
jx|_t_ttjdfdd|_|j
\}}t|j||d|_dSr)rrr0rrrrrrr
rrrKrGrHr?rs   rr2zSMTPDChannelIPv6Test.setUps)44x$0)+6
U&!=#7";X.2444[''))
d((dD59);;rN)r r!r"r2r#rrrrs#;;;;;rrc,eZdZdZdZdZdZdZdS)!SMTPDChannelWithDataSizeLimitTestcztxt_t_tj|_t
jx|_t_ttjdfdd|_|j
\}}t|j||dd|_dS)Nrr5Tr7 rrs   rr2z'SMTPDChannelWithDataSizeLimitTest.setUps)44x$0)+6
U&!=#5q"98.2444[''))
d((dD"59);;rcttxt_t_|jt_dSr)rr1s rrWz*SMTPDChannelWithDataSizeLimitTest.tearDownrrcv|jj||jdSr)rrs  rr@z,SMTPDChannelWithDataSizeLimitTest.write_linerrcL|d|d||jjjd|d||jjjd|d||jjjd|d||jjjd||jjdd	d
gdfgdSrSrXr1s rtest_data_limit_dialogz8SMTPDChannelWithDataSizeLimitTest.test_data_limit_dialog"rZrc|d|d||jjjd|d||jjjd|d||jjjd|d||jjjddS)	NrBrCrrDrErTs'This message is longer than 32 bytes
.rrr1s r$test_data_limit_dialog_too_much_datazFSMTPDChannelWithDataSizeLimitTest.test_data_limit_dialog_too_much_data4s(((1222,1=AAA/000,1=AAA   ,16	8	8	8DEEE,1=	?	?	?	?	?rN)r r!r"r2rWr@rrr#rrrrs_	;	;	;111
###$?????rrc,eZdZdZdZdZdZdZdS)SMTPDChannelWithDecodeDataFalsecptxt_t_tj|_t
jx|_t_ttjdfd|_|j
\}}t|j|||_dS)Nrr5rrs   rr2z%SMTPDChannelWithDecodeDataFalse.setUpEs)44x$0)+6
U&!=#5q"98DD[''))
d((dDAArcttxt_t_|jt_dSr)rr1s rrWz(SMTPDChannelWithDecodeDataFalse.tearDownMrrcv|jj||jdSr)rrs  rr@z*SMTPDChannelWithDecodeDataFalse.write_lineRrrcB|d|d|d|d|d|d||jjddS)NrBrCrDrEplain ascii textr_rbr1s rtest_ascii_dataz/SMTPDChannelWithDecodeDataFalse.test_ascii_dataVs(((1222/000   +,,,35HIIIIIrcl|d|d|d|d|d|d|d||jjddS)	NrBrCrDrEutf8 enriched text: żźćand some plain asciir_s/utf8 enriched text: żźć
and some plain asciirbr1s rtest_utf8_dataz.SMTPDChannelWithDecodeDataFalse.test_utf8_data_s(((1222/000   GHHH/000L&
(	)	)	)	)	)rNr r!r"r2rWr@rrr#rrrrCseBBB111
###JJJ)))))rrc,eZdZdZdZdZdZdZdS)SMTPDChannelWithDecodeDataTruecxtxt_t_tj|_t
jx|_t_ttjdfdd|_|j
\}}t|j||d|_dSrrrs   rr2z$SMTPDChannelWithDecodeDataTrue.setUpos)44x$0)+6
U&!=#5q"98.2444[''))
d((dD )""rcttxt_t_|jt_dSr)rr1s rrWz'SMTPDChannelWithDecodeDataTrue.tearDownzrrcv|jj||jdSr)rrs  rr@z)SMTPDChannelWithDecodeDataTrue.write_linerrcB|d|d|d|d|d|d||jjddS)NrBrCrDrErr_zplain ascii textrbr1s rrz.SMTPDChannelWithDecodeDataTrue.test_ascii_datas(((1222/000   +,,,35GHHHHHrcl|d|d|d|d|d|d|d||jjddS)	NrBrCrDrErrr_u/utf8 enriched text: żźć
and some plain asciirbr1s rrz-SMTPDChannelWithDecodeDataTrue.test_utf8_datas(((1222/000   GHHH/000L&>	@	@	@	@	@rNrr#rrrrmsg	"	"	"111
###III
@
@
@
@
@rrc>eZdZdZdZdZdZdZdZdZ	dZ
d	S)
&SMTPDChannelTestWithEnableSMTPUTF8Truecxtxt_t_tj|_t
jx|_t_ttjdfdd|_|j
\}}t|j||d|_dS)Nrr5Trsrrs   rr2z,SMTPDChannelTestWithEnableSMTPUTF8True.setUps)44x$0)+6
U&!=#5q"9826888[''))
d((dD9=)??rcttxt_t_|jt_dSr)rr1s rrWz/SMTPDChannelTestWithEnableSMTPUTF8True.tearDownrrcv|jj||jdSr)rrs  rr@z1SMTPDChannelTestWithEnableSMTPUTF8True.write_linerrc|d|dd||jjjddS)Nr^u7MAIL from: <naïve@example.com> BODY=8BITMIME SMTPUTF8utf-8r)r@rrfr?r0rr1s r1test_MAIL_command_accepts_SMTPUTF8_when_announcedzXSMTPDChannelTestWithEnableSMTPUTF8True.test_MAIL_command_accepts_SMTPUTF8_when_announcedsf(((ELL

	
	
	
	
,1=AAAAArc|ddD]3}|d|z||jjjddd|d||jjjddd|d||jjjddd	|d
|dkr'||jjjd||jjjd
5dS)Nr^)rsBODY=8BITMIME SMTPUTF8sMAIL from: <a@example> r250srcpt to:<b@example.com>data354sc
.rrs250 SMTPUTF8 message okish
r)rmail_parameterss  rtest_process_smtputf8_messagezDSMTPDChannelTestWithEnableSMTPUTF8True.test_process_smtputf8_messagesO(((?	D	DOOO6HIIIT\05ac:FCCCOO6777T\05ac:FCCCOOG$$$T\05ac:FCCCOOI&&&#%%  !4!9=IIII  !4!9!BDDDD	D	Drc|d|dd||jjjddd|dd||jjjddd|d||jjjddd	|d
|d||jjd
dS)Nr^u2MAIL From: naïve@examplé BODY=8BITMIME SMTPUTF8rrrruRCPT To:späm@examplérErrr_)r@rrfr?r0rrcr1s rrz5SMTPDChannelTestWithEnableSMTPUTF8True.test_utf8_datas8(((@GGPP	R	R	R,1!A#6???077@@AAA,1!A#6???   ,1!A#6???GHHHL&;	=	=	=	=	=rcf|ddtdz
}|dd|dzzzdz||jjjd|dd|zzdz||jjjd	dS)
Nehlo example$mail from:<@example>r
rr	@example>rrr@rrfr?r0rr
s  r7test_MAIL_command_limit_extended_with_SIZE_and_SMTPUTF8z^SMTPDChannelTestWithEnableSMTPUTF8True.test_MAIL_command_limit_extended_with_SIZE_and_SMTPUTF8s(((!S)?%@%@@1-.$%	&	&	&	
,18	:	:	:x($%	&	&	&	
,1=AAAAArc|ddtdz
}dD]_}|d||zzdz||jjjddd	|d||zzd
z||jjjddd|d||jjjddd|d
||jjjddd|d||jjjdddadS)Nrrr)rbcr
s
a@example>rrs500rrsrcpt to:<hans@example.com>rrstest
.r)rrchars   r1test_multiple_emails_with_extended_command_lengthzXSMTPDChannelTestWithEnableSMTPUTF8True.test_multiple_emails_with_extended_command_lengths(((!S)?%@%@@&
	D
	DDOONTH_<}LMMMT\05ac:FCCCOONTH_<|KLLLT\05ac:FCCCOO9:::T\05ac:FCCCOOG$$$T\05ac:FCCCOOL)))T\05ac:FCCCC
	D
	DrN)r r!r"r2rWr@rrrrrr#rrrrs???111
###BBBDDD 
=
=
=BBB
D
D
D
D
DrrceZdZdZdS)MiscTestCasecFhd}tj|t|dS)N>	usageDevnullNEWLINEOptionsprogram	parseargs
COMMASPACErDATA_SIZE_DEFAULT)not_exported)rcheck__all__r)rrs  rtest__all__zMiscTestCase.test__all__s3


	T5|DDDDDDrN)r r!r"rr#rrrrs(EEEEErr__main__)%rrgtestrrtest.supportrrr0rimport_deprecatedrrhas_gethostnameSkipTestrr
	Exceptionr%r'TestCaser-rZryrrrrrrrrrrrr mainr#rr<module>rs%%%%%%%%&&&&&&((((((



					*)'22,?,Z88$;
(
9
:
::00000%"000"					I			&&&&&&&&
00000h'000DZ0Z0Z0Z0Z0(+Z0Z0Z0z?????(+???$"="="="="=H-"="="=J?=?=?=?=?=H-?=?=?=D[5[5[5[5[5x([5[5[5z]/1CDD	;	;	;	;	;+	;	;ED	;4?4?4?4?4?(94?4?4?n')')')')')h&7')')')T)@)@)@)@)@X%6)@)@)@XUDUDUDUDUDX->UDUDUDpEEEEE8$EEEzHMOOOOOr