Count lines the same way as Dovecot+Cyrus
This commit is contained in:
parent
b1b73a9be5
commit
8bfe61d767
1 changed files with 4 additions and 1 deletions
|
@ -568,7 +568,10 @@ fn build_imap_email_struct<'a>(
|
|||
specific: SpecificFields::Text {
|
||||
subtype,
|
||||
number_of_lines: u32::try_from(
|
||||
Cursor::new(bp.body_raw.as_ref()).lines().count(),
|
||||
// We do not count the number of lines but the number of line
|
||||
// feeds to have the same behavior as Dovecot and Cyrus.
|
||||
// 2 lines = 1 line feed.
|
||||
bp.body_raw.as_ref().iter().filter(|&c| c == &b'\n').count(),
|
||||
)?,
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue