代码之家  ›  专栏  ›  技术社区  ›  Spack

电子邮件迁移和多域帐户

  •  0
  • Spack  · 技术社区  · 13 年前

    我正在使用 Google data Python client library 将电子邮件导入我的用户帐户。

    如果这对主域中的用户来说是正常的,那么对于单独域中的使用者,我会得到一个错误。

    from gdata.apps.migration import service
    
    user  = "user@example.fr"
    admin = "admin@example.com"
    admin_pwd = "hackme"
    
    srv = service.MigrationService(email = admin, password = admin_pwd, domain = "example.com")
    

    所以如果我设置 domain 对于主批,当我尝试提交批时,会收到以下错误消息:

    gdata.apps.service.AppsForYourDomainException: {'status': 403, 'body': '<HTML>\n<HEAD>\n<TITLE>Authorization failed.  Ensure that the destination user exists and try again.</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Authorization failed.  Ensure that the destination user exists and try again.</H1>\n<H2>Error 403</H2>\n</BODY>\n</HTML>\n', 'reason': 'Authorization failed.  Ensure that the destination user exists and try again.'}
    

    如果我没有设置域名,我会得到这个域名:

    gdata.apps.service.AppsForYourDomainException: {'status': 403, 'body': '<HTML>\n<HEAD>\n<TITLE>Invalid domain.</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Invalid domain.</H1>\n<H2>Error 403</H2>\n</BODY>\n</HTML>\n', 'reason': 'Invalid domain.'}
    

    我可以理解为什么我会出现这些错误,但问题是:我可以在单独的域上导入用户的电子邮件吗?如果是,怎么做?

    1 回复  |  直到 13 年前
        1
  •  0
  •   Jay Lee    13 年前

    首先,你真的应该使用 new Email Migration API 以及 google-api-python-client 为了这个而不是 old and deprecated GData-based API .

    话虽如此,这应该只是将域值设置为您希望将邮件迁移到的用户邮箱的值,而不是管理域:

    user  = "user@example.fr"
    admin = "admin@example.com"
    admin_pwd = "hackme"
    
    srv = service.MigrationService(email = admin, password = admin_pwd, domain = "example.fr")