Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement]: use error code 550 on reject/ereject-Action (Sieve script) #446

Closed
1 task done
infrequently opened this issue May 17, 2024 · 1 comment
Closed
1 task done
Labels
enhancement New feature or request

Comments

@infrequently
Copy link

Which feature or improvement would you like to request?

I'd like to see this feature:

I use a Sieve script to block sending E-Mails to some addresses as discussed here. The "reject" and "ereject"-Actions are working and the mail-server rejects the message on protocol level as follows:
[...] smtp::inbound::session: event="write" data="503 5.5.3 my reject message\r\n"[...]

As far as I understand RFC 5429 the error should be a 550 error.

2.1.1. Rejecting a Message at the SMTP/LMTP Protocol Level

Sieve implementations that are able to reject messages at the SMTP/
LMTP level MUST do so and SHOULD use the 550 response code.

[...]

If the SMTP/LMTP server supports RFC 2034 [ENHANCED-CODES], it MUST
prepend an appropriate Enhanced Error Code to the "reason" text.
Enhanced Error code 5.7.1 or a more generic 5.7.0 are RECOMMENDED.

I suggest changing the error code accordingly.

PS: Using Stalwart 0.7.3, update to 0.8.0 pending

Is your feature request related to a problem?

I'm having a problem with...

Code of Conduct

  • I agree to follow this project's Code of Conduct
@infrequently infrequently added the enhancement New feature or request label May 17, 2024
@mdecimus
Copy link
Member

You can include the status code in the reject action, for instance:

reject "551 5.1.1 Your domain '${env.helo_domain}' has been blocklisted.";

There is an example in the repository under tests/resources/smtp/sieve/stage_ehlo.sieve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants