help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The order of the headers in Message Mode is peculiar!


From: Eric Abrahamsen
Subject: Re: The order of the headers in Message Mode is peculiar!
Date: Thu, 25 Jan 2024 16:20:40 -0800
User-agent: Gnus/5.13 (Gnus v5.13)

rameiko87@posteo.net writes:

> I read on https://www.rfc-editor.org/rfc/rfc5322.html#section-3.6 that
> the order of the headers does not matter when sending emails.
> But I can't explain why Message Mode defaults to the following order
> when crafting a new emails:
>
> To:
> Subject:
> From:
>
> given that the default value of message-header-format-alist is
> different! Is there any reason for this order (and where is such order
> decided?), and do you agree that the default order of the headers
> appearing after C-x m should be the default value of the variable
> message-header-format-alist ?

The short answer is, there is no code that attempts or guarantees to
sort the headers in a new message. The current ordering results from
code in `message-mail', where a header list containing "To" and
"Subject" is passed down, ultimately to `message-setup-1', which does
the actual header insertion (see the comment ";; Insert all the
headers").

The weird thing is that `message-sort-headers' is called before
*sending* a message, in `message-send' -> `message-fix-before-sending'.
Why sort order matters for an outgoing message I don't know.

Anyway, if I were you I would add `message-sort-headers' to the
`gnus-message-setup-hook', or if you don't want it to be gnus-specific,
to the `message-header-setup-hook', with a higher DEPTH argument.

HTH,
Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]