stalwartlabs / mail-server

Secure & Modern All-in-One Mail Server (IMAP, JMAP, POP3, SMTP)
https://stalw.art
3.53k stars 135 forks source link

[bug]: The default config of session.rcpt.script seems broken #502

Closed flora-five closed 1 month ago

flora-five commented 1 month ago

What happened?

The current code, https://github.com/stalwartlabs/mail-server/blame/4e7087d33528d1dc145b02e7f195808a4e7ffc01/crates/common/src/config/smtp/session.rs#L611-L612, is:

            rcpt: Rcpt {
                script: IfBlock::empty("session.rcpt."),

Should it use session.rcpt.script instead?

I had some difficulties configuring the server to use a rewrite rule in my session.rcpt config. It seemed to me that the server has ignored my rewrite rule until I've set session.rcpt.script to false in the config.

How can we reproduce the problem?

Use the default session.rcpt config.

Version

v0.7.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?

None

Relevant log output

TRACE session{instance="smtp" protocol=Smtp remote.ip="..." remote.port=...}: smtp::inbound::session: event="read" data="RCPT TO:<...>\r\n" size=...
TRACE common::expr::eval: context="eval_if" property="session.rcpt." result=""

Code of Conduct

mdecimus commented 1 month ago

This has been fixed but in any case the code IfBlock::empty("session.rcpt.") was not causing any issues, it was just setting an incorrect variable name for logging.