I’m trying to inject a message using the HTTP API with a 12MB attachment (a report PDF) and getting Failed to buffer the request body: length limit exceeded from Kumo - I don’t see an option for specifying the max message size for kumo.start_http_listener(). Is there another configuration parameter to increase the max message size for messages injected using the HTTP API?
root@ahasend:~# curl -H 'Content-Type: application/json' -X POST http://10.1.0.3:8000/api/inject/v1 -d @./request.json
Failed to buffer the request body: length limit exceeded
Hey there @original-baboon, thanks for posting. Please read the “Troubleshooting” and “How to Ask for Help” buttons below. If you would like a 1:1 support session from the KumoMTA team, details are at the “Book a Support Session” button below.
I haven’t set max_message_size for the smtp listener explicitly, and based on the documentation it should be 20MB by default and that’s working fine: I can send the same message using SMTP without any problems, but I get the length limit exceeded error when I try to inject the message using the HTTP API.
After adding max_message_size starting kumo fails with this error:
Mar 17 14:04:51 send kumod[561738]: Error: Initialization raised an error: call init callback: callback error
Mar 17 14:04:51 send kumod[561738]: stack traceback:
Mar 17 14:04:51 send kumod[561738]: [C]: in local 'poll'
Mar 17 14:04:51 send kumod[561738]: [string "?"]:5: in function 'kumo.start_http_listener'
Mar 17 14:04:51 send kumod[561738]: [string "/opt/kumomta/etc/policy/init.lua"]:190: in function <[string "/opt/kumomta/etc/policy/init.lua"]:132>
Mar 17 14:04:51 send kumod[561738]: caused by: deserialize error: unknown field `max_message_size`, expected one of `hostname`, `listen`, `use_tls`, `tls_certificate`, `tls_private_key`, `trusted_hosts`, while processing {"use_tls":false,"trusted_hosts":["127.0.0.1","::1","10.1.0.0/16"],"max_message_size":"20 MB","listen":"0.0.0.0:8000"}
I think that will give you an option to control the limit; I’m currently experiencing hardware issues on my dev system (bad ram) that prevent me from testing this immediately
there is a default limit of 2MB that that diff will remove and replace with an option called request_body_limit that you can pass into the http listener when you start it
This was reported by a customer, I’ve asked them to use SMTP for now until this gets fixed, will just wait for a new dev release and update then - better not to tinker with patching and compiling this on production