We can do all operations using mailgun API if we know our API key. More about it
on https://documentation.mailgun.com/.
There is 'Add New Domain' on the https://mailgun.com/app/domains to add new domains.
All domains that we add manually should be verified.
After adding your domain you will see the https://mailgun.com/app/domains/<yourdomain>/verify page
with instructions on how to verify and use new domain.
To receive incoming messages we specify so called routes on mailgun.
You can see more about the routes here https://documentation.mailgun.com/user_manual.html#receiving-forwarding-and-storing-messages
Instruction how to check that module works. What shall user do and what would user get, e.g.
* Open menu ...
* Click ...
* register on http://mailgun.com
* On https://mailgun.com/app/domains click on sandbox...mailgun.org domain. Here you can see all information needed to configure odoo outgoing mail feature
* Copy API Key value into odoo
* Open menu Settings/Parameters/System Parameters
* Edit mailgun.apikey parameter
* Put API Key from mailgun into Value field and save
* From https://mailgun.com/cp/routes create new route