On_new_email Trigger

Hello community!
Is exists way to create some new doctype when we receive new email on one Email Domain?)

Does something like this work?

https://github.com/frappe/frappe/pull/8603