Displaying 2 results from an estimated 2 matches for "begin_txn".
Did you mean:
begin_t1
2020 Aug 04
0
How to access mailbox metadata in Lua push driver
...ing at Lua docu)
> these two I managed to solve im my current version of the script, which also support now all message event types:
<snip7>
>
> This leads to a couple more questions ;)
> - is there a way (eg. return value) to stop event processing already in dovecot_lua_notify_begin_txn
There is no really good way to do this. You can error out in begin_txn, but that will emit error.
The only doable way, right now, is to maybe add key {disabled=True} to your context, and then add
if ctx.disabled:
return
elsewhere.
> - sometimes multiple events are generated, eg. when I...
2020 Aug 03
3
How to access mailbox metadata in Lua push driver
..._url> user_from_metadata -- local http = require "socket.http" local ltn12 = require "ltn12" -- luarocks install json-lua local json = require "JSON" function table_get(t, k, d)
return t[k] or d end function script_init()
return 0 end function dovecot_lua_notify_begin_txn(user)
local meta = user:metadata_get("/private/vendor/vendor.dovecot/http-notify")
return {user=user, event=dovecot.event(), ep=user:plugin_getenv("push_lua_url"), messages={}, meta=meta}
end function dovecot_lua_notify_event_message_new(ctx, event)
-- check if there...