Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webhook for receiving incoming mail #724

Open
iaaxinpavithran opened this issue Aug 16, 2024 · 7 comments
Open

Webhook for receiving incoming mail #724

iaaxinpavithran opened this issue Aug 16, 2024 · 7 comments

Comments

@iaaxinpavithran
Copy link

Hi, first of all, thank you for the amazing tool.

I have a query: I need to get notified once a new mail is received. How can I achieve that using a webhook? Is it possible, or does it need any other mechanism to work?

Thank you.

@catthecreator
Copy link

+1

@NickOvt
Copy link
Contributor

NickOvt commented Sep 5, 2024

New Mail received webhook does not really make a lot of sense. If you have a small server sure. But if you are sending/receiving a lot of emails it can become really inefficient. Imagine if the webhook can't POST to the specified url because of a firewall, so the request timeouts after 2 mins. That means that for every new email the webhook will run for 2 mins. Now if you receive a lot of emails they're all in the queue and they will flood it because of the slow webhook processing and you end up with full RAM because of full redis queue.

@NickOvt
Copy link
Contributor

NickOvt commented Sep 5, 2024

Webhooks process incoming events sequentially

@louis-lau
Copy link
Member

To be fair, processing webhooks in parallel also makes quite a bit of sense. Not entirely sure why sequential webhooks would be advantageous for a multi-user system. Forwarders also generate requests to external smtp servers that may not respond, but are handled fine.

I think it may not make sense right now because of the architecture, which could be changed. Unless there's something I'm not seeing.

@NickOvt
Copy link
Contributor

NickOvt commented Sep 5, 2024

Yeah, as I understand it's because of the current architecture. But indeed it could be done for example by using Kafka or RabbitMQ.

@louis-lau
Copy link
Member

louis-lau commented Sep 5, 2024

bullmq also has concurrency settings, it's just set to 1 for this job queue worker. Not sure why though.

@catthecreator
Copy link

Getting information about incoming emails is very important for automation. For example, we want to redirect corporate mail to a messenger for prompt response..

Based on some emails, create tasks automatically.

Polling is not suitable for us

I am ready to take responsibility for monitoring redis

Perhaps the best solution would be to add such an option disabled by default, with an explanation of why it is not recommended. And what kind of risk is it hiding

It may also be a good practice to put an empty event function somewhere about a new letter. And give the implementation into the hands of users (then they can transfer it to a database, radish, send it via udp, or do what they need for their task)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants