mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-10-26 20:35:55 +08:00
Sieve script import case insensitiviy (fixes #962)
This commit is contained in:
parent
3c7caddd98
commit
4975b21c42
2 changed files with 5 additions and 3 deletions
|
|
@ -179,7 +179,8 @@ impl SieveScriptIngest for Server {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sieve::Script::Global(name_) => {
|
sieve::Script::Global(name_) => {
|
||||||
if let Some(script) = self.get_untrusted_sieve_script(name_, session_id)
|
if let Some(script) =
|
||||||
|
self.get_untrusted_sieve_script(&name_.to_lowercase(), session_id)
|
||||||
{
|
{
|
||||||
input = Input::script(name, script.clone());
|
input = Input::script(name, script.clone());
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,8 @@ impl RunScript for Server {
|
||||||
match result {
|
match result {
|
||||||
Ok(event) => match event {
|
Ok(event) => match event {
|
||||||
Event::IncludeScript { name, optional } => {
|
Event::IncludeScript { name, optional } => {
|
||||||
if let Some(script) = self.core.sieve.trusted_scripts.get(name.as_str()) {
|
let name_ = name.as_str().to_lowercase();
|
||||||
|
if let Some(script) = self.core.sieve.trusted_scripts.get(&name_) {
|
||||||
input = Input::script(name, script.clone());
|
input = Input::script(name, script.clone());
|
||||||
} else if optional {
|
} else if optional {
|
||||||
input = false.into();
|
input = false.into();
|
||||||
|
|
@ -87,7 +88,7 @@ impl RunScript for Server {
|
||||||
Sieve(SieveEvent::ScriptNotFound),
|
Sieve(SieveEvent::ScriptNotFound),
|
||||||
Id = script_id.clone(),
|
Id = script_id.clone(),
|
||||||
SpanId = session_id,
|
SpanId = session_id,
|
||||||
Details = name.as_str().to_string(),
|
Details = name_,
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue