Files
kumomta/docs/reference/events/init.md
T
Wez Furlong 42bf5c5e61 docs: adjust reference to improve search terms
We've been hoping that mkdocs-material will ship the much anticipated
search enhancements for some time, but it's time to recognize that
we need to do something to improve the search results with how
things work right now.

This is a big commit that changes the titles of the various pages
from the code-annotated synopsis to just the name of the function.

This makes it much easier now to match things like `kumo.reject`
directly, but `reject` remains awkward to find.

I think this is the best that we can do at this time.

A few functions have been annotated with the `status: deprecated` to
show as deprecated in the toc/nav (shows with a little trash can next
to the name).
2025-05-16 14:02:19 -07:00

45 lines
1010 B
Markdown

# init
```lua
kumo.on('init', function() end)
```
The `init` event is triggered once when the `kumod` process initializes.
The intent is that you use this event to define the spool storage and
listeners for your environment.
The event handler is not passed any parameters, and does not expect
any particular return value.
```lua
-- Called on startup to initialize the system
kumo.on('init', function()
-- Define a listener.
-- Can be used multiple times with different parameters to
-- define multiple listeners!
kumo.start_esmtp_listener {
listen = '0.0.0.0:2025',
}
kumo.configure_local_logs {
log_dir = '/var/tmp/kumo-logs',
}
kumo.start_http_listener {
listen = '0.0.0.0:8000',
-- allowed to access any http endpoint without additional auth
trusted_hosts = { '127.0.0.1', '::1' },
}
kumo.define_spool {
name = 'data',
path = '/var/tmp/kumo-spool/data',
}
kumo.define_spool {
name = 'meta',
path = '/var/tmp/kumo-spool/meta',
}
end)
```