Yes you could create your own (custom) Rules Condition. But in this case I don't think that's needed. The clue to what you're asking for, is a Rules Condition which is a "text comparison".
In that comparison, you use a regular expression to indicate "the email address should end with "@examplecompany.com
".
For an example rule which also uses such RegEx-expressions, refer to the answer to "http"https://drupal.stackexchange.com/questions/195799/how-to-use-the-rules-module-to-perform-a-simple-anti-spam-validation-using-speci/195866#195866".
Be aware: I'm not a RegEx expert ..., but here a few dozens of similar examples using a RegExhere a few dozens of similar examples using a RegEx ...
However, I predict you'll have multiple domains/roles to be processed. So the real Rules fun starts when this (typical) question arises: "I need to add something like a Rules Condition inside the Rules Actions, how can I do that?"
To resolve this typical question, there are basically 2 approaches (that I am aware of):
- Use the Conditional Rules module. For an example using the Conditional Rules module (for which there is not a lot of docu available), refer to my answer to the question "http"https://drupal.stackexchange.com/questions/114955/how-to-prevent-a-node-being-saved-when-using-the-rules-module/178623#178623".
- Rework the relevant part of your Rules Action(s) into performing a Rules Component. Because in a Rules Component, it is possible to also add Rules Conditions.