You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose message ID list from ReferencesHeader #148797
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 caseif"In-Reply-To"inmsgand"References"inmsg:
[in_reply_to_token] =msg["In-Reply-To"].message_ids
[*_, most_recent_reference_token] =msg["References"].message_idsifin_reply_to_token.value!=most_recent_reference_token.value:
raiseValueError(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
Agreed that this would be a nice feature to add. Could have done it when we added the header type, but we were focused on fixing the incorrect encoding problem ;)
Activity
picnixz commentedon Apr 20, 2026
cc @bitdancer
bitdancer commentedon Apr 20, 2026
Agreed that this would be a nice feature to add. Could have done it when we added the header type, but we were focused on fixing the incorrect encoding problem ;)
Abdur-rahmaanJ commentedon May 19, 2026
Having a go at it at the CPython PyCon Sprints
septatrix commentedon Oct 12, 2026
I assume nothing came of that?^^
Abdur-rahmaanJ commentedon Oct 12, 2026
@septatrix Sorry forgot to update, went to the Android side of things.