Skip to content

Manage your email alias using the OVH API with Python

License

Notifications You must be signed in to change notification settings

Indigo744/ovh-manage-email-alias-python

Repository files navigation

ovh-manage-email-redirection-python

Manage your email aliases using the OVH API with Python.

Prerequesite

Here what you'll need:

Configuration

OVH conf

Rename ovh.default.conf to ovh.conf and get your keys from https://eu.api.ovh.com/createToken/.

Note that this is for EU only. See others endpoints here.

Module conf

Rename config.default.py to config.py and set your domain and your private email.

Running the scripts

Add an alias

The following command line will add an alias github@mydomain.com (e.g. for creating an alias for Github)

python ovh_mail_alias_add.py https://github.com/Indigo744/ovh-manage-email-alias-python

Create email alias:
From : github@mydomain.com
To   : my-private-email@pm.me

Continue (ENTER or CTRL+C to cancel)?

Alias created (ID=123456789)

Calling the script without any parameter will ask for your input.

Remove an alias

The following command line will remove the alias we created just before

python ovh_mail_alias_rm.py 123456789

Delete the following alias:
ID    : 123456789
From  : github@mydomain.com
To    : my-private-email@pm.me

Continue (ENTER or CTRL+C to cancel)?

Deleting...
Alias deleted!

List all aliases

The following command line will list all the aliases.

python ovh_mail_alias_ls.py

ID      From    To
123456789     my-private-email@pm.me     github@mydomain.com
123545619     my-private-email@pm.me     youtube@mydomain.com
351493542     my-private-email@pm.me     ovh@mydomain.com

It procudes a TSV file (Tab-Separated File).

You can redirect the output to a file in order to open it in Excel or Calc.

python ovh_mail_alias_ls.py > list.tsv

About

Manage your email alias using the OVH API with Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages