mirror of
https://github.com/chatmail/core.git
synced 2026-05-04 13:56:30 +03:00
fix: Remove leading whitespace from Subject (#5106)
If Subject is multiline-formatted, `mailparse` adds the leading whitespace to it. The solution is to always remove the leading whitespace, because if Subject isn't multiline-formatted, it never contains the leading whitespace anyway. But as for the trailing whitespace -- i checked -- it's never removed, so let's keep this as is.
This commit is contained in:
@@ -809,6 +809,7 @@ impl MimeMessage {
|
||||
|
||||
pub(crate) fn get_subject(&self) -> Option<String> {
|
||||
self.get_header(HeaderDef::Subject)
|
||||
.map(|s| s.trim_start())
|
||||
.filter(|s| !s.is_empty())
|
||||
.map(|s| s.to_string())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user