Skip to content

🪲: Rcpt MTA hook only runs if sieve script, milter or rewrite is configured #2317

@marleypowell

Description

@marleypowell

What happened?

This condition:

if rcpt_script.is_some()
|| !self.server.core.smtp.session.rcpt.rewrite.is_empty()
|| self
.server
.core
.smtp
.session
.milters
.iter()
.any(|m| m.run_on_stage.contains(&Stage::Rcpt))

Means that this doesn't run if you haven't configured a sieve script, milter or rewrite:

// MTAHook filtering
if let Err(message) = self.run_mta_hooks(Stage::Rcpt, None, None).await {
self.data.rcpt_to.pop();
return self.write(message.message.as_bytes()).await;
}

Temporary workaround is to just create a noop sieve.

[session.rcpt]
relay = true
script = "'test'"

[sieve.trusted.scripts.test]
contents = ""

How can we reproduce the problem?

I can reproduce the problem by doing the following steps:

  • Setup MTA hook
  • Make sure you haven't configured a sieve script, milter or rewrite
  • Send an email
  • Observe that the RCPT stage hook is never called

Version

v0.14.x

What database are you using?

None

What blob storage are you using?

None

Where is your directory located?

None

What operating system are you using?

Linux

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions