I am able to get a GDEntry object using RetrieveForwarding in the gdata.apps.emailsettings.client.EmailSettingsClient class.
I am able to see which XML objects contain the "ForwardTo" address in this object using Regex or an XML module. An example output includes (among others) the following lines:
<ns0:property xmlns:ns0="http://schemas.google.com/apps/2006" name="enable" value="true" />
<ns0:property xmlns:ns0="http://schemas.google.com/apps/2006" name="action" value="KEEP" />
<ns0:property xmlns:ns0="http://schemas.google.com/apps/2006" name="forwardTo" value="name@email.com" />
Now that I have each of the forwardTo addresses, I want to delete them. I do not want to simple disable forwarding. When looking at my options, the only method I see that can be called which is relevant is the UpdateForwarding in gdata.apps.emailsettings.client.EmailSettingsClient. However, as you can see this method doesn't allow me to delete a forwardTo address.
update_forwarding(self, username, enable, forward_to=None, action=None, **kwargs)
Update Google Mail Forwarding settings.
Args:
username: string The name of the user.
enable: Boolean Whether to enable incoming email forwarding.
forward_to: (optional) string The address email will be forwarded to.
action: string (optional) The action to perform after forwarding
an email (ACTION_KEEP, ACTION_ARCHIVE, ACTION_DELETE).
kwargs: The other parameters to pass to the update method.
The goal is to remove an existing forwarding address. These accounts move from one person to another and I am trying to create a seamless transition. This includes removing old forwarding addresses, something which at the moment must be done manually by logging into each account.