管理 POP 和 IMAP
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
您可以使用设置来配置通过 POP 和 IMAP 协议访问 Gmail 时的行为。
如需了解如何 getPop、updatePop、getImap 或 updateImap,请参阅设置参考。
流行
启用和停用访问权限
您可以使用 accessWindow
属性控制 POP 访问权限。该属性不仅决定了是否启用 POP,还决定了可以检索哪些邮件。
值 |
效果 |
disabled |
无法访问 POP |
allMail |
所有消息均可使用 |
fromNowOn |
仅提供新消息 |
消息处置
您可以使用 disposition
属性配置通过 POP 检索到的邮件的处置方式。
值 |
效果 |
archive |
将邮件移出收件箱 |
leaveInInbox |
不执行任何操作,让邮件在收件箱中保持未读状态 |
markRead |
将消息标记为已读 |
trash |
将邮件移至回收站 |
IMAP
启用和停用访问权限
您可以通过将 enabled
属性设置为 true
或 false
来分别启用或停用 IMAP 访问权限,从而控制 IMAP 访问权限。
消息处置
如需设置已删除邮件的处置方式,请使用 expungeBehavior
属性。
值 |
效果 |
archive |
将邮件移出收件箱 |
deleteForever |
永久删除消息 |
trash |
将邮件移至回收站 |
此外,如果 autoExpunge
属性设置为 true
,则当通过 IMAP 删除相应邮件时,系统会立即执行这些操作。否则,消息会保留在服务器上,直到 IMAP 客户端明确请求为止。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-01。
[null,null,["最后更新时间 (UTC):2025-08-01。"],[],[],null,["# Managing POP and IMAP\n\nYou can use [Settings](/workspace/gmail/api/reference/rest/v1/users.settings) to configure\nthe behavior of Gmail when accessed via the POP and IMAP protocols.\n\nFor information on how to\n[getPop](/workspace/gmail/api/reference/rest/v1/users.settings/getPop),\n[updatePop](/workspace/gmail/api/reference/rest/v1/users.settings/updatePop),\n[getImap](/workspace/gmail/api/reference/rest/v1/users.settings/getImap),\nor [updateImap](/workspace/gmail/api/reference/rest/v1/users.settings/updateImap), see\nthe [Settings reference](/workspace/gmail/api/reference/rest/v1/users.settings).\n\nPOP\n---\n\n### Enabling and disabling access\n\nYou can control POP access with the `accessWindow` property. The property not\nonly determines whether or not POP is enabled, but also which messages may be\nretrieved.\n\n| Value | Effect |\n|-------------|---------------------------------|\n| `disabled` | No POP access |\n| `allMail` | All messages are available |\n| `fromNowOn` | Only new messages are available |\n\n### Message disposition\n\nYou can configure the disposition of messages retrieved via POP with\nthe `disposition` property.\n\n| Value | Effect |\n|----------------|------------------------------------------------|\n| `archive` | Move messages out of the inbox |\n| `leaveInInbox` | Do nothing, leave messages unread in the inbox |\n| `markRead` | Mark the messages as read |\n| `trash` | Moves the message to the trash |\n\nIMAP\n----\n\n### Enabling and disabling access\n\nYou can control IMAP access by setting the `enabled` property to `true`\nor `false`, to enable or disable access respectively.\n\n### Message Disposition\n\nTo set the disposition for deleted messages, use the `expungeBehavior` property.\n\n| Value | Effect |\n|-----------------|--------------------------------|\n| `archive` | Move messages out of the inbox |\n| `deleteForever` | Permanently delete the message |\n| `trash` | Moves the message to the trash |\n\nAdditionally, if the `autoExpunge` property is set to `true` these actions\nare performed immediately when the message is deleted via IMAP. Otherwise\nmessages are left until explicitly requested from the IMAP client."]]