Skip to content

doveadm-http: increase max_string_size for json parser - #315

Open
errror wants to merge 1 commit into
dovecot:mainfrom
errror:doveadm-json-fix
Open

doveadm-http: increase max_string_size for json parser#315
errror wants to merge 1 commit into
dovecot:mainfrom
errror:doveadm-json-fix

Conversation

@errror

@errror errror commented Sep 2, 2026

Copy link
Copy Markdown

as json can contain whole sieve scripts as a string, increase the (default) max allowed string size for sieve scripts

Pull Request

If this pull request fixes, discloses, demonstrates or discusses a suspected security vulnerability,
DO NOT submit it publicly. Follow SECURITY.md and report it privately.

  • I confirm that this PR does not fix, disclose, demonstrate, or discuss a suspected security vulnerability.
  • I have read CONTRIBUTING.md and SECURITY.md
  • I have compiled and tested this code

AI policy

Dovecot allows AI assisted or generated code, but we would like to know if it is such.
Do not include 'Co-Authored-By' header in the commit.

  • This PR includes AI-generated code or text.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactor or code cleanup

Description

Submitting large sieve scripts via sievePut REST API calls fails. The sieve plugin allows up to 1M size of sieve script (by default), see https://doc.dovecot.org/2.4.5/core/plugins/sieve.html#sieve_max_script_size. But the JSON parser only allows 32K for string parameters. This patch increases this limit to 1M (similar to sieve) for the JSON parser for doveadm HTTP connections.

Additional Notes

Technically it might be possible to read out the sieve_max_script_size setting here and use this value (if found). But as the setting is already advanced and looking up a plugin setting in the core code seems not a good idea (and probably complicated too), I decided for this simple solution. It would also possible to provide a settings variable to allow users to set the variable to higher values. Let me know, if I should improve the PR to provide such a setting.

as json can contain whole sieve scripts as a string, increase the
(default) max allowed string size for sieve scripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant