search for: plugin_getenv

Displaying 5 results from an estimated 5 matches for "plugin_getenv".

2020 Aug 03
2
How to access mailbox metadata in Lua push driver
We're currently using the OX push driver, which is straight forward (simple web hook) and allows to store (multiple) push tokens of our webmailer direct in mailbox metadata. Only drawback is that it only supports new arriving mails in the INBOX, even mails moved via Sieve to other folders are NOT reported. Therefore we updated now to Dovecot 2.3(.10.1) to also get mails moved by user or
2020 Aug 03
2
How to access mailbox metadata in Lua push driver
...> You get both of these objects from the push notification data, you just have to keep them in the context state. (See the example scripts) > > function dovecot_lua_notify_begin_txn(user) > local meta = user:metadata_get("/private/key") > return {messages={}, ep=user:plugin_getenv("push_lua_url"), username=user.username, meta=meta} > end > > Aki -- Ralf Becker EGroupware GmbH [www.egroupware.org] Handelsregister HRB Kaiserslautern 3587 Gesch?ftsf?hrer Birgit und Ralf Becker Leibnizstr. 17, 67663 Kaiserslautern, Germany Telefon +49 631 31657-0 ---------...
2020 Aug 03
0
How to access mailbox metadata in Lua push driver
...mailbox:metadata_get() You get both of these objects from the push notification data, you just have to keep them in the context state. (See the example scripts) function dovecot_lua_notify_begin_txn(user) local meta = user:metadata_get("/private/key") return {messages={}, ep=user:plugin_getenv("push_lua_url"), username=user.username, meta=meta} end Aki
2020 Aug 03
3
How to access mailbox metadata in Lua push driver
...uire "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 is a push token registered if (ctx.meta == nil or ctx.meta == '') then return end -- get mailbox status local mbox = ctx.user:mailbox(event.mailbox) mbo...
2020 Aug 03
0
How to access mailbox metadata in Lua push driver
...th of these objects from the push notification data, you just have to keep them in the context state. (See the example scripts) >> >> function dovecot_lua_notify_begin_txn(user) >> local meta = user:metadata_get("/private/key") >> return {messages={}, ep=user:plugin_getenv("push_lua_url"), username=user.username, meta=meta} >> end >> >> Aki -- Ralf Becker EGroupware GmbH [www.egroupware.org] Handelsregister HRB Kaiserslautern 3587 Gesch?ftsf?hrer Birgit und Ralf Becker Leibnizstr. 17, 67663 Kaiserslautern, Germany Telefon +49 631 31657-...