mark_read_by_search
Batch-mark emails as read or unread by folder, sender, subject, or date range. Preview the affected count with a dry run before confirming to avoid losing track of unseen messages.
Instructions
条件に一致するメールをまとめて既読(または未読)にする。
mark_messages_read の大量版。メールは移動しないので、居場所も 短縮IDも変わらない。既定は dry_run=True で件数を数えるだけ。
注意: 既読/未読は「まだ見ていない」という情報そのものなので、 まとめて既読にすると何が未処理だったかは復元できない。 実行前に必ず対象と件数を利用者に示して確認を取ること。
Args: folder: 対象フォルダ。省略するとメールボックス全体。 from_address: 差出人の部分一致(アドレスと表示名の両方を見る)。 subject_contains: 件名の部分一致。 since: この日以降 YYYY-MM-DD。 until: この日まで(その日を含む) YYYY-MM-DD。 read: True(既定)で既読、False で未読に戻す。 max_messages: 1回で処理する上限。既定5000、上限25000。 dry_run: True(既定)なら件数を数えるだけ。False で実際に変更する。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| read | No | ||
| since | No | ||
| until | No | ||
| folder | No | ||
| dry_run | No | ||
| from_address | No | ||
| max_messages | No | ||
| subject_contains | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |