Manage Gandi mail alias from command line
Published by slubman on January 11th, 2014
When creating an accounts on a website, I like to have one mail address for each website.
My registrar is Gandi and I also host some mailboxes on their server.
Unfortunately, there is no catch all address available and creating an alias for a mail address is a cumbersome process using the website. I would prefer to have something more accessible, like a command line utility.
Fortunately, Gandi does provide an XML-RPC API , so I just wrote a little script to ease my alias handling.
The script is available there: https://bitbucket.org/slubman/gandimailalias
There is a sample configuration file provided, you can modify this file and rename it as $HOME/.gandimailalias.rc . You should made this file readable only by your user via chmod 600 $HOME/.gandimailalias.rc .
The usage is simple:
- GandiMailAlias list : will list the aliases for all your configured accounts
- GandiMailAlias add account alias: will add alias to the provided account
- GandiMailAlias delete account alias: will remove alias from the provided account
For example, to add an alias foo to an email address bar@example.com the command is: GandiMailAlias add bar@example.com foo .
I have tested the script on Linux and OS X on python2 (require 2.7 minimum) and python3.