Hello,
We want to trigger a script after certain actions by the user (event). This script inserts the action into message queue (e.g. Rabbit MQ) accompanied with some data. Then one or more workers picks up the action from the message queue and do something with it. The question is: how can I trigger the script from dovecot?
An action/event should at least emitted when moving an e-mail message. The amount of data in the event is unknown. My current goal I would like to at least know the sender and receiver address and the type of action (e.g. move). But I can imagine, when having an event driven application, that others might even want the complete e-mail message to be in data.
Is such an event driven system possible? When looking at current features of Dovecot: it would the same as the mail_log feature, but instead of writing to a file, one should able to write to a script or socket. Ideally the format of the event would JSON, XML or another data format.
Regards, Frederik
Current version: Dovecot 2.2.16.
On 10/21/2015 9:07 AM, Frederik Bosch | Genkgo wrote:
We want to trigger a script after certain actions by the user (event). This script inserts the action into message queue (e.g. Rabbit MQ) accompanied with some data. Then one or more workers picks up the action from the message queue and do something with it. The question is: how can I trigger the script from dovecot?
This is precisely what the new push-notification plugin is for (2.2.19). (You will need to write a driver to interact with your notification handler, similar to the "dlog" or "ox" drivers.)
michael
Michael,
Thanks a lot! After looking at the source, I guess the ox driver will do. Maybe, when other people find this thread, you could tell what dlog is. Because I do not know it, and googling came up with little results.
Regards,
Frederik
On 21-10-15 23:33, Michael M Slusarz wrote:
On 10/21/2015 9:07 AM, Frederik Bosch | Genkgo wrote:
We want to trigger a script after certain actions by the user (event). This script inserts the action into message queue (e.g. Rabbit MQ) accompanied with some data. Then one or more workers picks up the action from the message queue and do something with it. The question is: how can I trigger the script from dovecot?
This is precisely what the new push-notification plugin is for (2.2.19). (You will need to write a driver to interact with your notification handler, similar to the "dlog" or "ox" drivers.)
michael
On 10/22/2015 12:46 AM, Frederik Bosch | Genkgo wrote:
Thanks a lot! After looking at the source, I guess the ox driver will do. Maybe, when other people find this thread, you could tell what dlog is. Because I do not know it, and googling came up with little results.
"dlog" is nothing more than a push-notification backend that will log various information and hook triggers (at a DEBUG level) to the Dovecot log. It's meant for debugging and development purposes.
"dlog" stands for either "Dovecot LOGging" or "Debug LOGging", whichever you prefer.
michael
On 21-10-15 23:33, Michael M Slusarz wrote:
On 10/21/2015 9:07 AM, Frederik Bosch | Genkgo wrote:
We want to trigger a script after certain actions by the user (event). This script inserts the action into message queue (e.g. Rabbit MQ) accompanied with some data. Then one or more workers picks up the action from the message queue and do something with it. The question is: how can I trigger the script from dovecot?
This is precisely what the new push-notification plugin is for (2.2.19). (You will need to write a driver to interact with your notification handler, similar to the "dlog" or "ox" drivers.)
michael
Thanks again. Final question: how do I configure this plugin?
On 23-10-15 16:12, Michael M Slusarz wrote:
On 10/22/2015 12:46 AM, Frederik Bosch | Genkgo wrote:
Thanks a lot! After looking at the source, I guess the ox driver will do. Maybe, when other people find this thread, you could tell what dlog is. Because I do not know it, and googling came up with little results.
"dlog" is nothing more than a push-notification backend that will log various information and hook triggers (at a DEBUG level) to the Dovecot log. It's meant for debugging and development purposes.
"dlog" stands for either "Dovecot LOGging" or "Debug LOGging", whichever you prefer.
michael
On 21-10-15 23:33, Michael M Slusarz wrote:
On 10/21/2015 9:07 AM, Frederik Bosch | Genkgo wrote:
We want to trigger a script after certain actions by the user (event). This script inserts the action into message queue (e.g. Rabbit MQ) accompanied with some data. Then one or more workers picks up the action from the message queue and do something with it. The question is: how can I trigger the script from dovecot?
This is precisely what the new push-notification plugin is for (2.2.19). (You will need to write a driver to interact with your notification handler, similar to the "dlog" or "ox" drivers.)
michael
On 26.10.2015 08:59, Frederik Bosch | Genkgo wrote:
Thanks again. Final question: how do I configure this plugin? As the only existing driver at the moment is the OX one, the plugin is documented in OX wiki at http://oxpedia.org/wiki/index.php?title=AppSuite:OX_Mail#Setup_of_the_Doveco...
br, Teemu Huovila
On 23-10-15 16:12, Michael M Slusarz wrote:
On 10/22/2015 12:46 AM, Frederik Bosch | Genkgo wrote:
Thanks a lot! After looking at the source, I guess the ox driver will do. Maybe, when other people find this thread, you could tell what dlog is. Because I do not know it, and googling came up with little results.
"dlog" is nothing more than a push-notification backend that will log various information and hook triggers (at a DEBUG level) to the Dovecot log. It's meant for debugging and development purposes.
"dlog" stands for either "Dovecot LOGging" or "Debug LOGging", whichever you prefer.
michael
On 21-10-15 23:33, Michael M Slusarz wrote:
On 10/21/2015 9:07 AM, Frederik Bosch | Genkgo wrote:
We want to trigger a script after certain actions by the user (event). This script inserts the action into message queue (e.g. Rabbit MQ) accompanied with some data. Then one or more workers picks up the action from the message queue and do something with it. The question is: how can I trigger the script from dovecot?
This is precisely what the new push-notification plugin is for (2.2.19). (You will need to write a driver to interact with your notification handler, similar to the "dlog" or "ox" drivers.)
michael
Ah fantastic. Now I guess I can use notify plugin without push_notification metadata plugins, right?
On 26-10-15 08:36, Teemu Huovila wrote:
On 26.10.2015 08:59, Frederik Bosch | Genkgo wrote:
Thanks again. Final question: how do I configure this plugin? As the only existing driver at the moment is the OX one, the plugin is documented in OX wiki at http://oxpedia.org/wiki/index.php?title=AppSuite:OX_Mail#Setup_of_the_Doveco...
br, Teemu Huovila
On 23-10-15 16:12, Michael M Slusarz wrote:
On 10/22/2015 12:46 AM, Frederik Bosch | Genkgo wrote:
Thanks a lot! After looking at the source, I guess the ox driver will do. Maybe, when other people find this thread, you could tell what dlog is. Because I do not know it, and googling came up with little results. "dlog" is nothing more than a push-notification backend that will log various information and hook triggers (at a DEBUG level) to the Dovecot log. It's meant for debugging and development purposes.
"dlog" stands for either "Dovecot LOGging" or "Debug LOGging", whichever you prefer.
michael
On 21-10-15 23:33, Michael M Slusarz wrote:
On 10/21/2015 9:07 AM, Frederik Bosch | Genkgo wrote:
We want to trigger a script after certain actions by the user (event). This script inserts the action into message queue (e.g. Rabbit MQ) accompanied with some data. Then one or more workers picks up the action from the message queue and do something with it. The question is: how can I trigger the script from dovecot? This is precisely what the new push-notification plugin is for (2.2.19). (You will need to write a driver to interact with your notification handler, similar to the "dlog" or "ox" drivers.)
michael
On 26.10.2015 09:45, Frederik Bosch | Genkgo wrote:
Ah fantastic. Now I guess I can use notify plugin without push_notification metadata plugins, right? Im not sure I understand the question correctly. I understood from the thread that you would be writing a driver for the push-notification plugin, so you need to load that plugin. In case you mean the imap_metadata = yes setting, you do not need that, if your driver does not use metadata.
Teemu
On 26-10-15 08:36, Teemu Huovila wrote:
On 26.10.2015 08:59, Frederik Bosch | Genkgo wrote:
Thanks again. Final question: how do I configure this plugin? As the only existing driver at the moment is the OX one, the plugin is documented in OX wiki at http://oxpedia.org/wiki/index.php?title=AppSuite:OX_Mail#Setup_of_the_Doveco...
br, Teemu Huovila
On 23-10-15 16:12, Michael M Slusarz wrote:
On 10/22/2015 12:46 AM, Frederik Bosch | Genkgo wrote:
Thanks a lot! After looking at the source, I guess the ox driver will do. Maybe, when other people find this thread, you could tell what dlog is. Because I do not know it, and googling came up with little results. "dlog" is nothing more than a push-notification backend that will log various information and hook triggers (at a DEBUG level) to the Dovecot log. It's meant for debugging and development purposes.
"dlog" stands for either "Dovecot LOGging" or "Debug LOGging", whichever you prefer.
michael
On 21-10-15 23:33, Michael M Slusarz wrote:
On 10/21/2015 9:07 AM, Frederik Bosch | Genkgo wrote:
> We want to trigger a script after certain actions by the user (event). > This script inserts the action into message queue (e.g. Rabbit MQ) > accompanied with some data. Then one or more workers picks up the action > from the message queue and do something with it. The question is: how > can I trigger the script from dovecot? This is precisely what the new push-notification plugin is for (2.2.19). (You will need to write a driver to interact with your notification handler, similar to the "dlog" or "ox" drivers.)
michael
Teemu,
If just need the http request, I will need something like the following configuration, right? So no meta data plugin, but with notify and push_notification?
protocol lmtp { mail_plugins = $mail_plugins notify push_notification }
plugin { push_notification_driver = ox:url=http://myurl/ <http://login:pass@node1.domain.tld:8009/preliminary/http-notify/v1/notify> }
Regards, Frederik
On 26-10-15 11:35, Teemu Huovila wrote:
On 26.10.2015 09:45, Frederik Bosch | Genkgo wrote:
Ah fantastic. Now I guess I can use notify plugin without push_notification metadata plugins, right? Im not sure I understand the question correctly. I understood from the thread that you would be writing a driver for the push-notification plugin, so you need to load that plugin. In case you mean the imap_metadata = yes setting, you do not need that, if your driver does not use metadata.
Teemu
On 26-10-15 08:36, Teemu Huovila wrote:
On 26.10.2015 08:59, Frederik Bosch | Genkgo wrote:
Thanks again. Final question: how do I configure this plugin? As the only existing driver at the moment is the OX one, the plugin is documented in OX wiki at http://oxpedia.org/wiki/index.php?title=AppSuite:OX_Mail#Setup_of_the_Doveco...
br, Teemu Huovila
On 23-10-15 16:12, Michael M Slusarz wrote:
On 10/22/2015 12:46 AM, Frederik Bosch | Genkgo wrote:
Thanks a lot! After looking at the source, I guess the ox driver will do. Maybe, when other people find this thread, you could tell what dlog is. Because I do not know it, and googling came up with little results. "dlog" is nothing more than a push-notification backend that will log various information and hook triggers (at a DEBUG level) to the Dovecot log. It's meant for debugging and development purposes.
"dlog" stands for either "Dovecot LOGging" or "Debug LOGging", whichever you prefer.
michael
On 21-10-15 23:33, Michael M Slusarz wrote: > On 10/21/2015 9:07 AM, Frederik Bosch | Genkgo wrote: > >> We want to trigger a script after certain actions by the user (event). >> This script inserts the action into message queue (e.g. Rabbit MQ) >> accompanied with some data. Then one or more workers picks up the action >> from the message queue and do something with it. The question is: how >> can I trigger the script from dovecot? > This is precisely what the new push-notification plugin is for > (2.2.19). (You will need to write a driver to interact with your > notification handler, similar to the "dlog" or "ox" drivers.) > > michael
-- *Frederik Bosch* Partner - Genkgo
telefoon: +31 (0)20 - 894 39 31 <callto:+31208943931> email: f.bosch@genkgo.nl <mailto:f.bosch@genkgo.nl> skype: genkgo.support <skype:genkgo.support?call> web: www.genkgo.nl <http://www.genkgo.nl>
*Postadres*: Postbus 15956 1001 NL Amsterdam
*Bezoekadres*: Keizersgracht 253 Amsterdam
Genkgo logo <http://www.genkgo.nl>
Genkgo B.V. staat geregistreerd bij de Kamer van Koophandel onder nummer 56501153
On 26.10.2015 12:44, Frederik Bosch | Genkgo wrote:
Teemu,
If just need the http request, I will need something like the following configuration, right? So no meta data plugin, but with notify and push_notification?
protocol lmtp { mail_plugins = $mail_plugins notify push_notification }
plugin { push_notification_driver = ox:url=http://myurl/ <http://login:pass@node1.domain.tld:8009/preliminary/http-notify/v1/notify> } You could test that, but my understanding of the ox push driver code is that it completely depends on metadata and will not do anything useful, if no metadata is set. Perhaps Michael can correct me, if Im wrong.
If you want some subset of the ox driver functionality, you could try implementing your own driver, based on the existing code.
br, Teemu
Regards, Frederik
On 26-10-15 11:35, Teemu Huovila wrote:
On 26.10.2015 09:45, Frederik Bosch | Genkgo wrote:
Ah fantastic. Now I guess I can use notify plugin without push_notification metadata plugins, right? Im not sure I understand the question correctly. I understood from the thread that you would be writing a driver for the push-notification plugin, so you need to load that plugin. In case you mean the imap_metadata = yes setting, you do not need that, if your driver does not use metadata.
Teemu
On 26-10-15 08:36, Teemu Huovila wrote:
On 26.10.2015 08:59, Frederik Bosch | Genkgo wrote:
Thanks again. Final question: how do I configure this plugin? As the only existing driver at the moment is the OX one, the plugin is documented in OX wiki at http://oxpedia.org/wiki/index.php?title=AppSuite:OX_Mail#Setup_of_the_Doveco...
br, Teemu Huovila
On 23-10-15 16:12, Michael M Slusarz wrote:
On 10/22/2015 12:46 AM, Frederik Bosch | Genkgo wrote:
> Thanks a lot! After looking at the source, I guess the ox driver will > do. Maybe, when other people find this thread, you could tell what dlog > is. Because I do not know it, and googling came up with little results. "dlog" is nothing more than a push-notification backend that will log various information and hook triggers (at a DEBUG level) to the Dovecot log. It's meant for debugging and development purposes.
"dlog" stands for either "Dovecot LOGging" or "Debug LOGging", whichever you prefer.
michael
> On 21-10-15 23:33, Michael M Slusarz wrote: >> On 10/21/2015 9:07 AM, Frederik Bosch | Genkgo wrote: >> >>> We want to trigger a script after certain actions by the user (event). >>> This script inserts the action into message queue (e.g. Rabbit MQ) >>> accompanied with some data. Then one or more workers picks up the action >>> from the message queue and do something with it. The question is: how >>> can I trigger the script from dovecot? >> This is precisely what the new push-notification plugin is for >> (2.2.19). (You will need to write a driver to interact with your >> notification handler, similar to the "dlog" or "ox" drivers.) >> >> michael
Teemu,
After having another look at the source code, it seems that you are right. Thanks for making this clear.
Regards, Frederik
On 26-10-15 12:04, Teemu Huovila wrote:
On 26.10.2015 12:44, Frederik Bosch | Genkgo wrote:
Teemu,
If just need the http request, I will need something like the following configuration, right? So no meta data plugin, but with notify and push_notification?
protocol lmtp { mail_plugins = $mail_plugins notify push_notification }
plugin { push_notification_driver = ox:url=http://myurl/ <http://login:pass@node1.domain.tld:8009/preliminary/http-notify/v1/notify> } You could test that, but my understanding of the ox push driver code is that it completely depends on metadata and will not do anything useful, if no metadata is set. Perhaps Michael can correct me, if Im wrong.
If you want some subset of the ox driver functionality, you could try implementing your own driver, based on the existing code.
br, Teemu
Regards, Frederik
On 26-10-15 11:35, Teemu Huovila wrote:
On 26.10.2015 09:45, Frederik Bosch | Genkgo wrote:
Ah fantastic. Now I guess I can use notify plugin without push_notification metadata plugins, right? Im not sure I understand the question correctly. I understood from the thread that you would be writing a driver for the push-notification plugin, so you need to load that plugin. In case you mean the imap_metadata = yes setting, you do not need that, if your driver does not use metadata.
Teemu
On 26-10-15 08:36, Teemu Huovila wrote:
On 26.10.2015 08:59, Frederik Bosch | Genkgo wrote:
Thanks again. Final question: how do I configure this plugin? As the only existing driver at the moment is the OX one, the plugin is documented in OX wiki at http://oxpedia.org/wiki/index.php?title=AppSuite:OX_Mail#Setup_of_the_Doveco...
br, Teemu Huovila
On 23-10-15 16:12, Michael M Slusarz wrote: > On 10/22/2015 12:46 AM, Frederik Bosch | Genkgo wrote: > >> Thanks a lot! After looking at the source, I guess the ox driver will >> do. Maybe, when other people find this thread, you could tell what dlog >> is. Because I do not know it, and googling came up with little results. > "dlog" is nothing more than a push-notification backend that will log various information and hook triggers (at a DEBUG level) to the Dovecot log. It's meant for debugging and development purposes. > > "dlog" stands for either "Dovecot LOGging" or "Debug LOGging", whichever you prefer. > > michael > > >> On 21-10-15 23:33, Michael M Slusarz wrote: >>> On 10/21/2015 9:07 AM, Frederik Bosch | Genkgo wrote: >>> >>>> We want to trigger a script after certain actions by the user (event). >>>> This script inserts the action into message queue (e.g. Rabbit MQ) >>>> accompanied with some data. Then one or more workers picks up the action >>>> from the message queue and do something with it. The question is: how >>>> can I trigger the script from dovecot? >>> This is precisely what the new push-notification plugin is for >>> (2.2.19). (You will need to write a driver to interact with your >>> notification handler, similar to the "dlog" or "ox" drivers.) >>> >>> michael
Il 26.10.2015 12:04 Teemu Huovila ha scritto:
On 26.10.2015 12:44, Frederik Bosch | Genkgo wrote:
Teemu,
If just need the http request, I will need something like the following configuration, right? So no meta data plugin, but with notify and push_notification?
protocol lmtp { mail_plugins = $mail_plugins notify push_notification }
plugin { push_notification_driver = ox:url=http://myurl/ <http://login:pass@node1.domain.tld:8009/preliminary/http-notify/v1/notify> } You could test that, but my understanding of the ox push driver code is that it completely depends on metadata and will not do anything useful, if no metadata is set. Perhaps Michael can correct me, if Im wrong.
If you want some subset of the ox driver functionality, you could try implementing your own driver, based on the existing code.
Hi, I'm interested to testing push_notification with ox driver (I need only a GET when a new message arrived) but I don't understand how to insert METADATA information via IMAP for an user.
Can somebody provide an example? Thanks
Alessio Cecchi Postmaster AT http://www.qboxmail.it http://www.linkedin.com/in/alessice
On 28.10.2015 19:11, Alessio Cecchi wrote:
Il 26.10.2015 12:04 Teemu Huovila ha scritto:
On 26.10.2015 12:44, Frederik Bosch | Genkgo wrote:
Teemu,
If just need the http request, I will need something like the following configuration, right? So no meta data plugin, but with notify and push_notification?
protocol lmtp { mail_plugins = $mail_plugins notify push_notification }
plugin { push_notification_driver = ox:url=http://myurl/ <http://login:pass@node1.domain.tld:8009/preliminary/http-notify/v1/notify> } You could test that, but my understanding of the ox push driver code is that it completely depends on metadata and will not do anything useful, if no metadata is set. Perhaps Michael can correct me, if Im wrong.
If you want some subset of the ox driver functionality, you could try implementing your own driver, based on the existing code.
Hi, I'm interested to testing push_notification with ox driver (I need only a GET when a new message arrived) but I don't understand how to insert METADATA information via IMAP for an user. The notification is done with a http PUT. The IMAP METADATA is set with the SETMETADATA command (https://tools.ietf.org/html/rfc5464#section-4.3).
As to how to register for the notifications, the best documentation is probably the source. You can see it in either http://hg.dovecot.org/dovecot-2.2/file/9654ab4c337c/src/plugins/push-notific... or maybe more easily in the OX source code file backend/com.openexchange.push.dovecot/src/com/openexchange/push/dovecot/commands/RegistrationCommand.java You can get the backend source by git clone https://code.open-xchange.com/git/wd/backend
An example would be something like: SETMETADATA "" (/private/vendor/vendor.dovecot/http-notify "user=myusername")
br, Teemu Huovila
participants (4)
-
Alessio Cecchi
-
Frederik Bosch | Genkgo
-
Michael M Slusarz
-
Teemu Huovila