python / python/cpython

Expose message ID list from `ReferencesHeader`

オープン 初心者向け
#148,797 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

stdlib topic-email type-feature
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Feature or enhancement

Proposal:

When sending, parsing or validating mails which are replies to other mails it is necessary to access the message IDs from the In-Reply-To and References headers. These, however, are currently not exposed.

# Example use case
if "In-Reply-To" in msg and "References" in msg:
    [in_reply_to_token] = msg["In-Reply-To"].message_ids
    [*_, most_recent_reference_token] = msg["References"].message_ids

    if in_reply_to_token.value != most_recent_reference_token.value:
        raise ValueError(f"Error: References list end must match In-Reply-To message ID")

A workaround is to access the private _parse_tree property which does expose the message_id, though like any private property that should obviously be avoided. This is comparable to AddressHeader which already exposes addresses.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず ReferencesHeader と既存の AddressHeader API を読み、次に ReferencesHeader が現在どのように非公開の _parse_tree データを公開しているかを調べます。公開ヘッダーインターフェースからメッセージ ID を利用できるようにして、示されている In-Reply-To と References の使用が非公開アクセスなしで機能するようにし、公開された値が既存のメッセージ ID 情報を保持していることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
backend
issue の種類
機能追加
難易度
2/5
見積もり時間
1〜3時間
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
70/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。