gdata.apps.emailsettings.client.EmailSettingsClient クラスでRetrieveForwardingを使用して GDEntry オブジェクトを取得できます。
正規表現または XML モジュールを使用して、このオブジェクトに「ForwardTo」アドレスが含まれている XML オブジェクトを確認できます。出力例には、(とりわけ) 次の行が含まれます。
<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" />
各 forwardTo アドレスを取得したので、それらを削除します。単純に転送を無効にしたくありません。私のオプションを見ると、関連する唯一の呼び出し可能なメソッドは、gdata.apps.emailsettings.client.EmailSettingsClientの UpdateForwarding です。ただし、ご覧のとおり、このメソッドでは forwardTo アドレスを削除できません。
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.
目標は、既存の転送アドレスを削除することです。これらのアカウントはある人から別の人に移動し、シームレスな移行を作成しようとしています. これには、古い転送アドレスの削除が含まれます。現時点では、各アカウントにログインして手動で行う必要があります。