mirror of
https://github.com/chatmail/core.git
synced 2026-04-02 05:22:14 +03:00
Do not accept prefer-encrypt=reset value from emails
Reset is an internal value that received messages should not be able to set. Also return an error on any value other than "mutual" and "nopreference", errors are converted to NoPreference by the caller.
This commit is contained in:
committed by
Floris Bruynooghe
parent
b7f7e607c1
commit
e8f2f7b24e
@@ -44,8 +44,8 @@ impl str::FromStr for EncryptPreference {
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
match s {
|
||||
"mutual" => Ok(EncryptPreference::Mutual),
|
||||
"reset" => Ok(EncryptPreference::Reset),
|
||||
_ => Ok(EncryptPreference::NoPreference),
|
||||
"nopreference" => Ok(EncryptPreference::NoPreference),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user