POP と IMAP の管理
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
設定を使用して、POP プロトコルと IMAP プロトコル経由でアクセスしたときの Gmail の動作を構成できます。
getPop、updatePop、getImap、updateImap の取得方法については、設定リファレンスをご覧ください。
POP
アクセスの有効化と無効化
POP アクセスは、accessWindow
プロパティで制御できます。このプロパティは、POP が有効かどうかだけでなく、取得できるメッセージも決定します。
値 |
効果 |
disabled |
POP アクセスなし |
allMail |
すべてのメッセージが利用可能 |
fromNowOn |
新しいメッセージのみが利用可能 |
メール処理
POP で取得したメッセージの処理は、disposition
プロパティで構成できます。
値 |
効果 |
archive |
受信トレイからメールを移動する |
leaveInInbox |
何もせず、受信トレイのメールを未読のままにする |
markRead |
メッセージを既読にする |
trash |
メールがゴミ箱に移動する |
IMAP
アクセスの有効化と無効化
IMAP アクセスを制御するには、enabled
プロパティを true
または false
に設定して、アクセスをそれぞれ有効または無効にします。
Message Disposition
削除されたメッセージの処理を設定するには、expungeBehavior
プロパティを使用します。
値 |
効果 |
archive |
受信トレイからメールを移動する |
deleteForever |
メッセージを完全に削除する |
trash |
メールがゴミ箱に移動する |
また、autoExpunge
プロパティが true
に設定されている場合、IMAP 経由でメッセージが削除されると、これらのアクションが直ちに実行されます。それ以外の場合、メッセージは IMAP クライアントから明示的にリクエストされるまで残されます。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-01 UTC。
[null,null,["最終更新日 2025-08-01 UTC。"],[],[],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."]]