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

Change max_literal_size to max_append_literal_size #157

Open
jakoschiko opened this issue Apr 7, 2024 · 2 comments
Open

Change max_literal_size to max_append_literal_size #157

jakoschiko opened this issue Apr 7, 2024 · 2 comments
Assignees

Comments

@jakoschiko
Copy link
Collaborator

Currently ServerFlowOptions::max_literal_size is applied to all literals. However, this might not reflect how it will be used in practice:

  • The most relevant use-case for max literal size is the APPEND command
  • Besides that it would be better to reject literals and commands based on a smaller limit

Idea:

  • Change max_literal_size to max_append_literal_size and use it only for APPEND literals
  • max_command_size (introduced in feat: Implement read limit #153) should not apply to APPEND commands
@jakoschiko
Copy link
Collaborator Author

How can we detect an APPEND command? We can't decode the full command because we didn't receive all bytes yet.

Maybe the imap-codec crate could add another method to Fragmentizer for that, similar to Fragmentizer::decode_tag. I would prefer to leave any byte parsing to the imap-codec crate.

@duesee
Copy link
Owner

duesee commented Jul 12, 2024

I'm not sure anymore if we want to have this distinction. Maybe max_message_size is all we need, actually... APPEND is special, but... Let's talk again soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants