Fix session.rcpt.script IfBlock variable name

This commit is contained in:
mdecimus
2024-05-31 14:38:03 +02:00
parent 4e7087d335
commit 649ccfdba0
4 changed files with 11 additions and 10 deletions

View File

@@ -31,11 +31,10 @@ body:
label: Version label: Version
description: What version of our software are you running? description: What version of our software are you running?
options: options:
- v0.8.x
- v0.7.x - v0.7.x
- v0.6.x - v0.6.x
- v0.5.x - v0.5.x or lower
- v0.4.x
- v0.3.x or lower
validations: validations:
required: true required: true
- type: dropdown - type: dropdown

View File

@@ -609,7 +609,7 @@ impl Default for SessionConfig {
rewrite: IfBlock::empty("session.mail.rewrite"), rewrite: IfBlock::empty("session.mail.rewrite"),
}, },
rcpt: Rcpt { rcpt: Rcpt {
script: IfBlock::empty("session.rcpt."), script: IfBlock::empty("session.rcpt.script"),
relay: IfBlock::new::<()>( relay: IfBlock::new::<()>(
"session.rcpt.relay", "session.rcpt.relay",
[("!is_empty(authenticated_as)", "true")], [("!is_empty(authenticated_as)", "true")],

View File

@@ -116,7 +116,7 @@ impl<T: SessionStream> Session<T> {
if !is_extended { if !is_extended {
return self return self
.write(format!("250 {} says hello\r\n", self.hostname).as_bytes()) .write(format!("250 {} you had me at HELO\r\n", self.hostname).as_bytes())
.await; .await;
} }

View File

@@ -140,10 +140,12 @@ impl<T: SessionStream> Session<T> {
script: Arc<Sieve>, script: Arc<Sieve>,
params: ScriptParameters<'_>, params: ScriptParameters<'_>,
) -> ScriptResult { ) -> ScriptResult {
let core = self.core.clone(); self.core
let span = self.span.clone(); .run_script(
let params = params.with_envelope(&self.core.core, self).await; script,
params.with_envelope(&self.core.core, self).await,
core.run_script(script, params, span).await self.span.clone(),
)
.await
} }
} }