mailcow / mailcow-dockerized

mailcow: dockerized - 🐮 + 🐋 = 💕
https://mailcow.email
GNU General Public License v3.0
8.92k stars 1.17k forks source link

Add webhook notifications as an extension to push over #3729

Open ClarLabs opened 4 years ago

ClarLabs commented 4 years ago

Is your feature request related to a problem? Please describe. At the moment I check mailboxes manually via a cronjob that runs every few minutes, this obviously does not scale well, especially as an event has already occurred that is not being taken advantage of (email received)

Describe the solution you'd like I noticed the recent addition to MailCow was PushOver which uses its API to send a push notification, I was thinking it would be cool to extend that to an optional webhook URL field, so either pushover can be used or an alternative web hook url can be used or both. This would mitigate the need for me to run a cronjob as I can just expect a webhook response whenever an email as arrived.

Additional context Would be nice if this was also enabled in the API so on creation of a mailbox can specify a web hook url ;)

KarstenDE commented 4 years ago

I would love such feature too. Especially for "emergency" notifications like monitoring it would be very helpful :-)

irgendwr commented 4 years ago

I could give this a try.

What would be better?

A) add a "custom url" field to the pushover settings

pro:

contra:

B) abstract the pushover settings, i.e. turn them into "webhook" settings with the option to choose between pushover, custom, (maybe add other services like pushbullet) ...

pro:

contra:

ClarLabs commented 4 years ago

Hello Thanks for your reply

I would say being able to set a custom URL would work, I agree, it might not be flexible but would work for what we need, just hitting a URL endpoint with the title/text.

Abstracting away is defo a good long term plan as it means we can extend from web hooks and PushOver to more areas.

I hope this helps

gtmadev commented 3 years ago

I'd like to see an abstraction of the existing pushover integration. For backward compatibility, I would recommend leaving that part of the UI alone and change only the back-end to read/write to/from the new extended webhook feature. This keeps things simple for those without good knowledge of how to use webhooks.

Below the pushover integration, you can then have an actual traditional webhook UI which allows custom URL, method, header parameters, and perhaps even a json or XML payload.

My desire is to use this for things like avoiding polling with a support system and only poll when new mail arrives.

r-work commented 7 months ago

A general purpose webhook would be very helpful for when emails have been received.