mirror of
https://github.com/chatmail/relay.git
synced 2026-08-24 01:03:12 +00:00
fix(smtp-server): Correct error when EOF while reading DATA (#168)
Log `Unexpected EoF while receiving DATA!` instead of `Malformed DATA line without CRLF ending!` Fixes: #165 Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
This commit is contained in:
committed by
GitHub
parent
893ceab107
commit
e9a63222e6
@@ -225,7 +225,10 @@ where
|
|||||||
let mut data_line = String::new();
|
let mut data_line = String::new();
|
||||||
'data_read: loop {
|
'data_read: loop {
|
||||||
data_line.clear();
|
data_line.clear();
|
||||||
reader.read_line(&mut data_line).await?;
|
if reader.read_line(&mut data_line).await? == 0 {
|
||||||
|
log::warn!("Unexpected EoF while receiving DATA! Closing connection.");
|
||||||
|
break 'connection;
|
||||||
|
}
|
||||||
|
|
||||||
if data_line == ".\r\n" {
|
if data_line == ".\r\n" {
|
||||||
break 'data_read;
|
break 'data_read;
|
||||||
|
|||||||
Reference in New Issue
Block a user