File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11Changes in FakeSMTPd 0.2.1
22==========================
33
4+ Improvements
5+ ------------
6+
7+ * Ensure that lines end with \r\n.
8+
49Bug fixes
510---------
611
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ async def _handle_connection(self) -> None:
4949 self ._write_reply (SMTPStatus .SERVICE_READY ,
5050 "{} FakeSMTPd Service ready" .format (getfqdn ()))
5151 while not self .reader .at_eof ():
52- line = await self .reader .readline ( )
52+ line = await self .reader .readuntil ( b" \r \n " )
5353 try :
5454 decoded = line .decode ("ascii" ).rstrip ()
5555 except UnicodeDecodeError :
@@ -99,7 +99,7 @@ async def _handle_mail_text(self) -> None:
9999
100100 async def _read_mail_text (self ) -> None :
101101 while not self .reader .at_eof ():
102- line = await self .reader .readline ( )
102+ line = await self .reader .readuntil ( b" \r \n " )
103103 if len (line ) > SMTP_TEXT_LINE_LIMIT :
104104 raise ValueError ()
105105 if line == b".\r \n " :
Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ def __init__(self) -> None:
2020
2121 # SUT Interface
2222
23- async def readline (self ) -> bytes :
23+ async def readuntil (self , separator : bytes = b"\n " ) -> bytes :
24+ assert_equal (b"\r \n " , separator )
2425 if not self .lines :
2526 return b""
2627 line = self .lines [0 ].encode ("latin1" ) + b"\r \n "
You can’t perform that action at this time.
0 commit comments