Skip to content

Show Reply-To header in message panel#126

Open
klement wants to merge 1 commit into
akissinger:masterfrom
klement:reply-to
Open

Show Reply-To header in message panel#126
klement wants to merge 1 commit into
akissinger:masterfrom
klement:reply-to

Conversation

@klement

@klement klement commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Co-Authored-By: Claude Opus 4.6 [email protected]

@The-Compiler

Copy link
Copy Markdown
Collaborator

Seems fine to me! I wonder if we should turn this into a setting though (similarly to what neomutt has, but in our case probably just the list of headers to show instead). What do you think?

@klement

klement commented Mar 15, 2026

Copy link
Copy Markdown
Contributor Author

I like the configurable idea. How’s this for a simple solution? I don’t see much added value in the convoluted neomutt style.

@The-Compiler

The-Compiler commented Mar 15, 2026

Copy link
Copy Markdown
Collaborator

What's the point in the config option being a function, rather than just a list of headers to show? The only reason I could see is if you wanted to say "show header A if available, else show B" but that seems too convoluted to me as well.

@klement

klement commented Mar 15, 2026 via email

Copy link
Copy Markdown
Contributor Author

Comment thread dodo/settings.py Outdated

message_headers = lambda headers: [h for h in
['Subject', 'Date', 'From', 'To', 'Cc', 'Reply-To']
if h in headers]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: this really should not be a callable. Look at the rest of the configuration options: almost none of them is callable, the only two exceptions are keybindings and the message2html_filters list of functions, both of which are natural fit for this. Here, the natural fit is just a plain list of headers, e.g.

message_headers = ['Subject', 'Date', 'From', 'To', 'Cc', 'Reply-To']

Think of it this way: what's the expected use case? AFAICT we're expecting people to add (or remove?) a couple of fields. Well, with the above, you can just do

dodo.settings.message_headers.append("List-ID")

whereas this simple operation becomes much more complex if you have to reimplement the entire function. The empty header filtering should be done in thread.py anyway.


nitpick: the field name is ambiguous, could also be about headers populated when writing a new email. Sadly I can't come up with anything better rn.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My goal was to have it easily extensible and IMO the simple lambda function is still plenty readable, albeit not elegant as the .append(“XX”) syntax. I don’t really mind which it is for my use case (+Reply-To).

Would display_message_headers be a better name?

@klement klement Mar 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the use case which I don’t see how a simple list could cover is something along the lines of “display [From, To, …] and all headers which [don’t] start with ‘x-‘“.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me this sounds like a case of premature generalization. If someone wanted to display all the X-Something-* headers (which is already kind of a stretch in my eyes, but might be valid), this could still be a list but matched with fnmatch (don't really see a downside to that, as the performance aspect is negligible and the special characters can't be in a header name anyways).

Then the only thing you couldn't do is really complex stuff, and IMHO, that's completely okay.

Allow users to customize which headers are displayed and in what order
via a function that receives the message headers dict and returns a
list of header names to show.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@klement

klement commented Mar 17, 2026

Copy link
Copy Markdown
Contributor Author

Re naming, do you want to keep it as message_headers? Other names I can think of are already suggested display_message_headers or a shortened display_headers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants