It seems like the HTTP injection endpoint removes whitespaces from the subject if the subject string is a unicode string. For example:
curl http://localhost:8000/api/inject/v1 \
-X POST \
-H 'Content-Type: application/json' \
-d '{
"envelope_sender": "info@example.com",
"recipients": [
{
"email": "me@gmail.com"
}
],
"content": {
"from": {
"name": "Sender",
"email": "info@example.com"
},
"subject": "تست یک دو سه",
"html_body": " تست یک دو سه"
}
}'
I’ve added logs to http_message_generated event handler:
kumo.on('http_message_generated', function(msg)
local original_sender_domain = msg:sender().domain
local tenant = aha.cached_tenant_id(original_sender_domain)
if tenant == '4cdd7bdd-294e-4762-892f-83d40abf5a87' then
print("subject:", msg:get_first_named_header_value('subject'))
end
-- the rest of the handler...
end
The output in journal is:
Oct 14 04:53:22 send kumod[1239348]: subject: تستیکدوسه
while I expect it to be the same string as provided in the JSON payload, e.g.:
This seems to happen only for subject, the same string in content.html_body and content.from.name works without any issues (the spaces there don’t get removed).