wildduck icon indicating copy to clipboard operation
wildduck copied to clipboard

Add message inbox event

Open dimkabelkov opened this issue 4 years ago • 15 comments

dimkabelkov avatar Nov 17 '20 13:11 dimkabelkov

Please, add inbox message event on webhooks

dimkabelkov avatar Nov 17 '20 15:11 dimkabelkov

See https://github.com/nodemailer/wildduck/issues/274#issuecomment-713747499

louis-lau avatar Nov 17 '20 15:11 louis-lau

@louis-lau what's the appropriate way to do it for now?

For example, if I want to pass every new message to some other service, how should I do it without a webhook? Fetching API endpoint every second?

What's the best way?

scofield-ua avatar Jan 20 '22 19:01 scofield-ua

@scofield-ua If you don't need something global, you can subscribe to the eventstream of any specific user. That will notify you when a new message arrives.

louis-lau avatar Jan 20 '22 19:01 louis-lau

If you do need something global, I'm pretty sure you can connect to mongodb from your application an watch the db for changes.

louis-lau avatar Jan 20 '22 20:01 louis-lau

@louis-lau thanks for a quick response, by global do you mean something with a high load? I'm currently looking for a solution that will deal with a high load :)

I'm not very familiar with mongodb, by watch the db for changes do you mean this - https://docs.mongodb.com/manual/changeStreams/

scofield-ua avatar Jan 20 '22 20:01 scofield-ua

By global in this context I mean "all messages of all users".

do you mean this

Yes!

Keep in mind if you need events for a specific user (so non global), just use this api endpoint: https://docs.wildduck.email/api/#operation/getUpdates

louis-lau avatar Jan 20 '22 20:01 louis-lau

Yeah I'm looking into something global, currently I'm not sure how to just catch all emails for a specific domain(s), so I created a user with *@domaim.com address and trying to work it.

scofield-ua avatar Jan 20 '22 21:01 scofield-ua

While that may be global in the context of a domain, that's still a single user ;).

I'm not sure how

Seems you're managing fine, or am I misunderstanding? :)

louis-lau avatar Jan 20 '22 21:01 louis-lau

Using user for global stuff it's the only method I found so far. Maybe there is some better solution for it which you can recommend? Because as far I know users has some limitation which is bad in terms of the system where I want to collect any email for a set of domains.

scofield-ua avatar Jan 20 '22 21:01 scofield-ua

I'm not sure what your usecase is, but if you want a single inbox for all mail of multiple domains, a single user is indeed the solution.

Because as far I know users has some limitation

What limitation is that?

Do you actually need IMAP access to the account? If you only need to feed the mail to your application you don't really need wildduck, you can just write a plugin for haraka that stores the email to your application.

louis-lau avatar Jan 20 '22 21:01 louis-lau

All I need it's accept the mail and pass it next to the application.

but if you want a single inbox for all mail of multiple domains, a single user is indeed the solution

Okay, great.

Thank you for the answers.

scofield-ua avatar Jan 20 '22 22:01 scofield-ua

What limitation is that?

for example this one: https://github.com/nodemailer/wildduck/issues/319

scofield-ua avatar Jan 20 '22 22:01 scofield-ua

That's not really intended behaviour. The original poster didn't really elaborate on his specific issue or what could have cause it, but reate limits should only be applied after you've actually reached a set limit. If it didn't work that way it would be a bug :)

But again, I don't think you need wildduck for your usecase ;)

louis-lau avatar Jan 21 '22 00:01 louis-lau

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar Feb 20 '24 01:02 github-actions[bot]

This issue was closed because it has been stalled for 15 days with no activity.

github-actions[bot] avatar Mar 08 '24 01:03 github-actions[bot]