Skip to content

Commit

Permalink
Fix line ending
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyfallWasTaken committed Jun 20, 2024
1 parent ce19ab2 commit aeb0c8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/vortex-smtp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ async fn process<T: Fn(&str) -> bool>(
// TODO: Implement dot stuffing
tracing::debug!("data: {:?}", msg);
// TODO: is this correct?
if msg.ends_with(".\n") {
if msg.ends_with("\r\n.\r\n") {
state.waiting_for_data = false;
state.finished = true;

state
.data
.get_or_insert_with(Vec::new)
.extend_from_slice(&buf[0..n - 2]); // Don't include the trailing .\n
.extend_from_slice(&buf[0..n - 5]); // Don't include the \r\n.\r\n
socket.write_all(messages::OK).await?;
} else {
state
Expand Down

0 comments on commit aeb0c8d

Please sign in to comment.