Send specific Kumolog use Kafka

Sorry to bother you, I hope this simple question won’t disturb everyone.

I encountered another problem while transmitting logs through Kafka. I didn’t want to send data with type=Reception, so I made a Lua .

Unfortunately, I cannot return nil (it results in an error:

KumoMTA internal: error in deliver_message: sender:send method failed: error converting Lua nil to String (expected string or number))

and I want to eliminate the else condition or only return (return nothing), but I still get the same error. I don’t know what to return anymore.

init.lua in https://gist.github.com/smsvip/202f31e6163bf51c642a4a28f8d76906

This line

Make that decision in the should_enqueue_log_record event, where you can return false on messages you don’t want passed to kafka.

Thanks . It works .

I don’t think it takes a lot of lua code. You can refer to the doc provided in the KUMOMTA document:
https://docs.kumomta.com/userguide/integrations/postmastery/

https://postmastery.atlassian.net/wiki/spaces/PD/pages/301596673/KumoMTA+event+webhook+with+log_hook+helper

per_record = {
      -- SMTP and HTTP Incoming Monitoring, use for debugging only
      Reception = { enable = false },
      -- Rejected Incoming SMTP Command, use for debugging only
      Rejection = { enable = false },
      -- Internal Delayed messages, use for debugging only
      Delayed = { enable = false },
      Any = { enable = true },
    },

will be work fine.

The demo provided by postmastery is really useful. I read Kumo’s documentation and know it’s going to be put into meta, but I can’t know the context. Hopefully there are more and better documentation for reference. grateful